negodesign 0.0.7 → 0.0.8
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/dist/components/NegoDesign.svelte +24 -0
- package/dist/components/NegoDesign.svelte.d.ts +9 -0
- package/dist/components/core/button/ButtonSend.svelte +15 -0
- package/dist/components/core/button/ButtonSend.svelte.d.ts +4 -0
- package/dist/components/core/datatable/ui/DataTableActions.svelte +1 -1
- package/dist/components/core/datatable/ui/DataTableListFilter.svelte +1 -1
- package/dist/components/core/datatable/ui/DataTableListPagination.svelte +1 -1
- package/dist/components/core/form/ui/input-code-otp.svelte +58 -0
- package/dist/components/core/form/ui/input-code-otp.svelte.d.ts +10 -0
- package/dist/components/core/form/ui/input-email-or-phone.svelte +23 -0
- package/dist/components/core/form/ui/input-email-or-phone.svelte.d.ts +4 -0
- package/dist/components/core/form/ui/input-phone.svelte +21 -11
- package/dist/components/{pages/login/01/ui → core/panel}/LeftHero.svelte +10 -6
- package/dist/components/{pages/login/01/ui → core/panel}/LeftHero.svelte.d.ts +1 -1
- package/dist/components/core/tabs/data/TabModel.d.ts +1 -1
- package/dist/components/core/tabs/ui/tab-underline.svelte +3 -1
- package/dist/components/pages/forget-password/01/ui/ForgetPasswordCard.svelte +59 -0
- package/dist/components/pages/forget-password/01/ui/ForgetPasswordCard.svelte.d.ts +15 -0
- package/dist/components/pages/forget-password/01/ui/FormForgetPassword.svelte +37 -0
- package/dist/components/pages/forget-password/01/ui/FormForgetPassword.svelte.d.ts +8 -0
- package/dist/components/pages/forget-password/01/ui/PageForgetPassword01.svelte +74 -0
- package/dist/components/pages/forget-password/01/ui/PageForgetPassword01.svelte.d.ts +4 -0
- package/dist/components/pages/forget-password/PageForgetPassword.svelte +19 -0
- package/dist/components/pages/forget-password/PageForgetPassword.svelte.d.ts +15 -0
- package/dist/components/pages/forget-password/types.d.ts +15 -0
- package/dist/components/pages/login/01/ui/FormLogin.svelte +6 -4
- package/dist/components/pages/login/01/ui/FormLogin.svelte.d.ts +4 -2
- package/dist/components/pages/login/01/ui/FormLoginEmailPassword.svelte +5 -4
- package/dist/components/pages/login/01/ui/FormLoginEmailPassword.svelte.d.ts +3 -2
- package/dist/components/pages/login/01/ui/FormLoginPhonePassword.svelte +5 -4
- package/dist/components/pages/login/01/ui/FormLoginPhonePassword.svelte.d.ts +3 -2
- package/dist/components/pages/login/01/ui/FormLoginUsernamePassword.svelte +5 -4
- package/dist/components/pages/login/01/ui/FormLoginUsernamePassword.svelte.d.ts +3 -2
- package/dist/components/pages/login/01/ui/{AuthCard.svelte → LoginCard.svelte} +16 -8
- package/dist/components/pages/login/01/ui/{AuthCard.svelte.d.ts → LoginCard.svelte.d.ts} +6 -5
- package/dist/components/pages/login/01/ui/PageLogin01.svelte +86 -57
- package/dist/components/pages/login/01/ui/PageLogin01.svelte.d.ts +1 -1
- package/dist/components/pages/login/PageLogin.svelte +1 -1
- package/dist/components/pages/login/PageLogin.svelte.d.ts +1 -1
- package/dist/components/pages/login/{01/data/page-props.d.ts → types.d.ts} +4 -2
- package/dist/components/pages/login/types.js +1 -0
- package/dist/components/pages/otp-verification/01/ui/FormOtpVerification.svelte +29 -0
- package/dist/components/pages/otp-verification/01/ui/FormOtpVerification.svelte.d.ts +8 -0
- package/dist/components/pages/otp-verification/01/ui/OtpVerificationCard.svelte +56 -0
- package/dist/components/pages/otp-verification/01/ui/OtpVerificationCard.svelte.d.ts +15 -0
- package/dist/components/pages/otp-verification/01/ui/PageOtpVerification01.svelte +72 -0
- package/dist/components/pages/otp-verification/01/ui/PageOtpVerification01.svelte.d.ts +4 -0
- package/dist/components/pages/otp-verification/PageOtpVerification.svelte +16 -0
- package/dist/components/pages/otp-verification/PageOtpVerification.svelte.d.ts +12 -0
- package/dist/components/pages/otp-verification/types.d.ts +13 -0
- package/dist/components/pages/otp-verification/types.js +1 -0
- package/dist/components/pages/reset-password/01/ui/FormResetPassword.svelte +41 -0
- package/dist/components/pages/reset-password/01/ui/FormResetPassword.svelte.d.ts +8 -0
- package/dist/components/pages/reset-password/01/ui/PageResetPassword01.svelte +72 -0
- package/dist/components/pages/reset-password/01/ui/PageResetPassword01.svelte.d.ts +4 -0
- package/dist/components/pages/reset-password/01/ui/ResetPasswordCard.svelte +56 -0
- package/dist/components/pages/reset-password/01/ui/ResetPasswordCard.svelte.d.ts +15 -0
- package/dist/components/pages/reset-password/PageResetPassword.svelte +16 -0
- package/dist/components/pages/reset-password/PageResetPassword.svelte.d.ts +12 -0
- package/dist/components/pages/reset-password/types.d.ts +15 -0
- package/dist/components/pages/reset-password/types.js +1 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +20 -20
- package/dist/components/ui/button/button.svelte +47 -28
- package/dist/components/ui/button/button.svelte.d.ts +77 -50
- package/dist/components/ui/button/index.d.ts +2 -2
- package/dist/components/ui/button/index.js +2 -2
- package/dist/components/ui/command/command-dialog.svelte +42 -0
- package/dist/components/ui/command/command-dialog.svelte.d.ts +14 -0
- package/dist/components/ui/command/command-empty.svelte +17 -0
- package/dist/components/ui/command/command-empty.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-group.svelte +33 -0
- package/dist/components/ui/command/command-group.svelte.d.ts +7 -0
- package/dist/components/ui/command/command-input.svelte +33 -0
- package/dist/components/ui/command/command-input.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-item.svelte +27 -0
- package/dist/components/ui/command/command-item.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-link-item.svelte +20 -0
- package/dist/components/ui/command/command-link-item.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-list.svelte +20 -0
- package/dist/components/ui/command/command-list.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-loading.svelte +7 -0
- package/dist/components/ui/command/command-loading.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-separator.svelte +17 -0
- package/dist/components/ui/command/command-separator.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-shortcut.svelte +23 -0
- package/dist/components/ui/command/command-shortcut.svelte.d.ts +5 -0
- package/dist/components/ui/command/command.svelte +28 -0
- package/dist/components/ui/command/command.svelte.d.ts +8 -0
- package/dist/components/ui/command/index.d.ts +12 -0
- package/dist/components/ui/command/index.js +14 -0
- package/dist/components/ui/dialog/dialog-close.svelte +11 -0
- package/dist/components/ui/dialog/dialog-close.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-content.svelte +48 -0
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +13 -0
- package/dist/components/ui/dialog/dialog-description.svelte +20 -0
- package/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-footer.svelte +32 -0
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +8 -0
- package/dist/components/ui/dialog/dialog-header.svelte +20 -0
- package/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-portal.svelte +7 -0
- package/dist/components/ui/dialog/dialog-portal.svelte.d.ts +3 -0
- package/dist/components/ui/dialog/dialog-title.svelte +17 -0
- package/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/dist/components/ui/dialog/dialog-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog.svelte +7 -0
- package/dist/components/ui/dialog/dialog.svelte.d.ts +3 -0
- package/dist/components/ui/dialog/index.d.ts +11 -0
- package/dist/components/ui/dialog/index.js +13 -0
- package/dist/components/ui/input/index.d.ts +2 -2
- package/dist/components/ui/input/index.js +2 -2
- package/dist/components/ui/input/input.svelte +9 -9
- package/dist/components/ui/input/input.svelte.d.ts +5 -5
- package/dist/components/ui/input-group/index.d.ts +7 -0
- package/dist/components/ui/input-group/index.js +9 -0
- package/dist/components/ui/input-group/input-group-addon.svelte +53 -0
- package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +32 -0
- package/dist/components/ui/input-group/input-group-button.svelte +49 -0
- package/dist/components/ui/input-group/input-group-button.svelte.d.ts +32 -0
- package/dist/components/ui/input-group/input-group-input.svelte +23 -0
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +11 -0
- package/dist/components/ui/input-group/input-group-text.svelte +22 -0
- package/dist/components/ui/input-group/input-group-text.svelte.d.ts +5 -0
- package/dist/components/ui/input-group/input-group-textarea.svelte +23 -0
- package/dist/components/ui/input-group/input-group-textarea.svelte.d.ts +3 -0
- package/dist/components/ui/input-group/input-group.svelte +24 -0
- package/dist/components/ui/input-group/input-group.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/index.d.ts +5 -0
- package/dist/components/ui/input-otp/index.js +5 -0
- package/dist/components/ui/input-otp/input-otp-group.svelte +20 -0
- package/dist/components/ui/input-otp/input-otp-group.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/input-otp-separator.svelte +28 -0
- package/dist/components/ui/input-otp/input-otp-separator.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/input-otp-slot.svelte +31 -0
- package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +4 -0
- package/dist/components/ui/input-otp/input-otp.svelte +23 -0
- package/dist/components/ui/input-otp/input-otp.svelte.d.ts +4 -0
- package/dist/components/ui/language-switcher/index.d.ts +1 -1
- package/dist/components/ui/light-switch/light-switch.svelte +2 -2
- package/dist/components/ui/light-switch/light-switch.svelte.d.ts +1 -1
- package/dist/components/ui/phone-input/country-selector.svelte +101 -0
- package/dist/components/ui/phone-input/country-selector.svelte.d.ts +13 -0
- package/dist/components/ui/phone-input/flag.svelte +21 -0
- package/dist/components/ui/phone-input/flag.svelte.d.ts +7 -0
- package/dist/components/ui/phone-input/flags.d.ts +2 -0
- package/dist/components/ui/phone-input/flags.js +10 -0
- package/dist/components/ui/phone-input/index.d.ts +3 -0
- package/dist/components/ui/phone-input/index.js +2 -0
- package/dist/components/ui/phone-input/phone-input.svelte +63 -0
- package/dist/components/ui/phone-input/phone-input.svelte.d.ts +7 -0
- package/dist/components/ui/phone-input/types.d.ts +16 -0
- package/dist/components/ui/phone-input/types.js +1 -0
- package/dist/components/ui/popover/index.d.ts +9 -0
- package/dist/components/ui/popover/index.js +11 -0
- package/dist/components/ui/popover/popover-close.svelte +7 -0
- package/dist/components/ui/popover/popover-close.svelte.d.ts +4 -0
- package/dist/components/ui/popover/popover-content.svelte +31 -0
- package/dist/components/ui/popover/popover-content.svelte.d.ts +10 -0
- package/dist/components/ui/popover/popover-description.svelte +20 -0
- package/dist/components/ui/popover/popover-description.svelte.d.ts +5 -0
- package/dist/components/ui/popover/popover-header.svelte +20 -0
- package/dist/components/ui/popover/popover-header.svelte.d.ts +5 -0
- package/dist/components/ui/popover/popover-portal.svelte +7 -0
- package/dist/components/ui/popover/popover-portal.svelte.d.ts +3 -0
- package/dist/components/ui/popover/popover-title.svelte +15 -0
- package/dist/components/ui/popover/popover-title.svelte.d.ts +5 -0
- package/dist/components/ui/popover/popover-trigger.svelte +17 -0
- package/dist/components/ui/popover/popover-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/popover/popover.svelte +7 -0
- package/dist/components/ui/popover/popover.svelte.d.ts +3 -0
- package/dist/components/ui/scroll-area/index.d.ts +3 -0
- package/dist/components/ui/scroll-area/index.js +5 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +30 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte +43 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +11 -0
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte.d.ts +17 -17
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +8 -8
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/index.js +4 -0
- package/dist/components/ui/textarea/textarea.svelte +23 -0
- package/dist/components/ui/textarea/textarea.svelte.d.ts +5 -0
- package/dist/globals.css +550 -20
- package/dist/i18n/config.d.ts +11 -0
- package/dist/i18n/config.js +16 -4
- package/dist/i18n/index.d.ts +13 -0
- package/dist/i18n/index.js +13 -0
- package/dist/i18n/langs/en.d.ts +76 -0
- package/dist/i18n/langs/en.js +75 -0
- package/dist/i18n/langs/pt.d.ts +76 -0
- package/dist/i18n/langs/pt.js +75 -0
- package/dist/i18n/translations.d.ts +74 -0
- package/dist/i18n/translations.js +4 -76
- package/dist/index.d.ts +28 -6
- package/dist/index.js +28 -6
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.js +1 -0
- package/package.json +9 -3
- package/dist/components/NegoDesignLayout.svelte +0 -23
- package/dist/components/NegoDesignLayout.svelte.d.ts +0 -8
- package/dist/config.d.ts +0 -7
- package/dist/config.js +0 -8
- /package/dist/components/pages/{login/01/data/page-props.js → forget-password/types.js} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ResetPasswordCard from "./ResetPasswordCard.svelte";
|
|
3
|
+
import LeftHero from "../../../../core/panel/LeftHero.svelte";
|
|
4
|
+
import type { PageResetPasswordProps } from "../../types";
|
|
5
|
+
import { t } from "../../../../../i18n";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Variante 01 da página de redefinição de senha.
|
|
9
|
+
* Layout split: hero à esquerda (reutiliza do login), card de redefinição à direita.
|
|
10
|
+
*/
|
|
11
|
+
let {
|
|
12
|
+
carousel,
|
|
13
|
+
varient,
|
|
14
|
+
title,
|
|
15
|
+
children,
|
|
16
|
+
otpLength,
|
|
17
|
+
onSubmit,
|
|
18
|
+
}: PageResetPasswordProps = $props();
|
|
19
|
+
|
|
20
|
+
const defaultCarousel = $derived([
|
|
21
|
+
{
|
|
22
|
+
buttonText: $t("label.next"),
|
|
23
|
+
title: $t("carousel.reset-password.slide1.title"),
|
|
24
|
+
description: $t("carousel.reset-password.slide1.description"),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
buttonText: $t("label.next"),
|
|
28
|
+
title: $t("carousel.reset-password.slide2.title"),
|
|
29
|
+
description: $t("carousel.reset-password.slide2.description"),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
buttonText: $t("label.next"),
|
|
33
|
+
title: $t("carousel.reset-password.slide3.title"),
|
|
34
|
+
description: $t("carousel.reset-password.slide3.description"),
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
const carouselItems = $derived(carousel ?? defaultCarousel);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<main class="h-screen w-screen flex items-center">
|
|
42
|
+
<svg width="0" height="0" class="absolute">
|
|
43
|
+
<defs>
|
|
44
|
+
<clipPath id="grid-curve-clip" clipPathUnits="objectBoundingBox">
|
|
45
|
+
<path d="M0.35,0 L1,0 C0.85,0.3 1,0.6 0.4,1 L1,1 Z" />
|
|
46
|
+
</clipPath>
|
|
47
|
+
</defs>
|
|
48
|
+
</svg>
|
|
49
|
+
<div class="hidden md:block md:w-8/12">
|
|
50
|
+
<LeftHero {title} varient={varient ?? "POINTER"} items={carouselItems} />
|
|
51
|
+
</div>
|
|
52
|
+
<div class="w-full md:px-0 md:w-4/12 border-gray-900">
|
|
53
|
+
{#if children}
|
|
54
|
+
{@render children()}
|
|
55
|
+
{:else}
|
|
56
|
+
<ResetPasswordCard {otpLength} {onSubmit} />
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
</main>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
:global(.grid-pattern) {
|
|
63
|
+
background-size: 40px 40px;
|
|
64
|
+
background-image: linear-gradient(
|
|
65
|
+
to right,
|
|
66
|
+
rgba(0, 0, 0, 0.1) 1px,
|
|
67
|
+
transparent 1px
|
|
68
|
+
),
|
|
69
|
+
linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
|
|
70
|
+
clip-path: url(#grid-curve-clip);
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LanguageSwitcher from "../../../../ui/language-switcher/language-switcher.svelte";
|
|
3
|
+
import ButtonBack from "../../../../core/button/ButtonBack.svelte";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
import { LightSwitch } from "../../../../ui/light-switch";
|
|
6
|
+
import { t } from "../../../../../i18n";
|
|
7
|
+
import type { ResetPasswordRequestDto } from "../../types";
|
|
8
|
+
import FormResetPassword from "./FormResetPassword.svelte";
|
|
9
|
+
import TabUnderline from "../../../../core/tabs/ui/tab-underline.svelte";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Card de redefinição de senha.
|
|
13
|
+
* @property {number} otpLength - Quantidade de caixas do código OTP
|
|
14
|
+
* @property {(req: ResetPasswordRequestDto) => void} onSubmit - Callback ao submeter
|
|
15
|
+
*/
|
|
16
|
+
type Props = {
|
|
17
|
+
otpLength?: number;
|
|
18
|
+
onSubmit?: (request: ResetPasswordRequestDto) => void;
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let { otpLength, onSubmit, children }: Props = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class="flex-1 flex flex-col justify-between h-screen bg-gradient-right">
|
|
26
|
+
<nav class="flex justify-between p-5 md:bg-transparent">
|
|
27
|
+
<div>
|
|
28
|
+
<ButtonBack />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="flex gap-2">
|
|
31
|
+
<LightSwitch />
|
|
32
|
+
<LanguageSwitcher />
|
|
33
|
+
</div>
|
|
34
|
+
</nav>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
class="p-5 h-full border-t-2 bg-background md:border-none rounded-tl-[35px] rounded-tr-[35px]"
|
|
38
|
+
>
|
|
39
|
+
<TabUnderline
|
|
40
|
+
items={[
|
|
41
|
+
{
|
|
42
|
+
item: {
|
|
43
|
+
label: $t("label.reset-password"),
|
|
44
|
+
value: "reset-password",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
]}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
{#if children}
|
|
51
|
+
{@render children()}
|
|
52
|
+
{:else}
|
|
53
|
+
<FormResetPassword {otpLength} {onSubmit} />
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ResetPasswordRequestDto } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Card de redefinição de senha.
|
|
5
|
+
* @property {number} otpLength - Quantidade de caixas do código OTP
|
|
6
|
+
* @property {(req: ResetPasswordRequestDto) => void} onSubmit - Callback ao submeter
|
|
7
|
+
*/
|
|
8
|
+
type Props = {
|
|
9
|
+
otpLength?: number;
|
|
10
|
+
onSubmit?: (request: ResetPasswordRequestDto) => void;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
};
|
|
13
|
+
declare const ResetPasswordCard: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type ResetPasswordCard = ReturnType<typeof ResetPasswordCard>;
|
|
15
|
+
export default ResetPasswordCard;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PageResetPasswordProps } from "./types";
|
|
3
|
+
import PageResetPassword01 from "./01/ui/PageResetPassword01.svelte";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Página de redefinição de senha.
|
|
7
|
+
* @property {"01"} varient - Variante do layout
|
|
8
|
+
*/
|
|
9
|
+
type Props = {
|
|
10
|
+
varient?: "01";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let { ...props }: PageResetPasswordProps & Props = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<PageResetPassword01 {...props} />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PageResetPasswordProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Página de redefinição de senha.
|
|
4
|
+
* @property {"01"} varient - Variante do layout
|
|
5
|
+
*/
|
|
6
|
+
type Props = {
|
|
7
|
+
varient?: "01";
|
|
8
|
+
};
|
|
9
|
+
type $$ComponentProps = PageResetPasswordProps & Props;
|
|
10
|
+
declare const PageResetPassword: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
+
type PageResetPassword = ReturnType<typeof PageResetPassword>;
|
|
12
|
+
export default PageResetPassword;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CarouselItem, CarouselItemType } from "../../core/carousel/data/CarouselModel";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
export type ResetPasswordRequestDto = {
|
|
4
|
+
code: string;
|
|
5
|
+
password: string;
|
|
6
|
+
confirmPassword: string;
|
|
7
|
+
};
|
|
8
|
+
export type PageResetPasswordProps = {
|
|
9
|
+
carousel?: CarouselItem[];
|
|
10
|
+
varient?: CarouselItemType;
|
|
11
|
+
title?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
otpLength?: number;
|
|
14
|
+
onSubmit?: (request: ResetPasswordRequestDto) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
variant: {
|
|
4
|
-
default:
|
|
5
|
-
secondary:
|
|
6
|
-
destructive:
|
|
7
|
-
outline:
|
|
8
|
-
ghost:
|
|
9
|
-
link:
|
|
4
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
|
|
5
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
|
|
6
|
+
destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
|
|
7
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30";
|
|
8
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
|
|
9
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
10
10
|
};
|
|
11
11
|
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none", {
|
|
12
12
|
variant: {
|
|
13
|
-
default:
|
|
14
|
-
secondary:
|
|
15
|
-
destructive:
|
|
16
|
-
outline:
|
|
17
|
-
ghost:
|
|
18
|
-
link:
|
|
13
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
|
|
15
|
+
destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
|
|
16
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30";
|
|
17
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
|
|
18
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
19
19
|
};
|
|
20
|
-
}, undefined, import("tailwind-variants").
|
|
20
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
21
21
|
variant: {
|
|
22
|
-
default:
|
|
23
|
-
secondary:
|
|
24
|
-
destructive:
|
|
25
|
-
outline:
|
|
26
|
-
ghost:
|
|
27
|
-
link:
|
|
22
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
|
|
23
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80";
|
|
24
|
+
destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20";
|
|
25
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30";
|
|
26
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50";
|
|
27
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
28
28
|
};
|
|
29
|
-
}, undefined
|
|
29
|
+
}, undefined>>;
|
|
30
30
|
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
|
|
31
31
|
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
32
32
|
import { type WithElementRef } from "../../../utils.js";
|
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import { cn, type WithElementRef } from
|
|
3
|
-
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from
|
|
4
|
-
import { type VariantProps, tv } from
|
|
2
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
3
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
4
|
+
import { type VariantProps, tv } from 'tailwind-variants';
|
|
5
5
|
|
|
6
6
|
export const buttonVariants = tv({
|
|
7
|
-
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-
|
|
7
|
+
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default:
|
|
11
|
-
outline:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
11
|
+
outline:
|
|
12
|
+
'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs',
|
|
13
|
+
secondary:
|
|
14
|
+
'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
15
|
+
ghost:
|
|
16
|
+
'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
17
|
+
destructive:
|
|
18
|
+
'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
|
|
19
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
16
20
|
},
|
|
17
21
|
size: {
|
|
18
|
-
default:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
icon:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
default:
|
|
23
|
+
'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
24
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
25
|
+
sm: 'h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',
|
|
26
|
+
lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
27
|
+
icon: 'size-9',
|
|
28
|
+
'icon-xs':
|
|
29
|
+
"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
30
|
+
'icon-sm':
|
|
31
|
+
'size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md',
|
|
32
|
+
'icon-lg': 'size-10'
|
|
33
|
+
}
|
|
27
34
|
},
|
|
28
35
|
defaultVariants: {
|
|
29
|
-
variant:
|
|
30
|
-
size:
|
|
31
|
-
}
|
|
36
|
+
variant: 'default',
|
|
37
|
+
size: 'default'
|
|
38
|
+
}
|
|
32
39
|
});
|
|
33
40
|
|
|
34
|
-
export type ButtonVariant = VariantProps<typeof buttonVariants>[
|
|
35
|
-
export type ButtonSize = VariantProps<typeof buttonVariants>[
|
|
41
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
42
|
+
export type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;
|
|
43
|
+
export type Size = ButtonSize;
|
|
44
|
+
|
|
45
|
+
export const sizeMap = {
|
|
46
|
+
default: { icon: "icon" as ButtonSize },
|
|
47
|
+
xs: { icon: "icon-xs" as ButtonSize },
|
|
48
|
+
sm: { icon: "icon-sm" as ButtonSize },
|
|
49
|
+
lg: { icon: "icon-lg" as ButtonSize },
|
|
50
|
+
icon: { icon: "icon" as ButtonSize },
|
|
51
|
+
"icon-xs": { icon: "icon-xs" as ButtonSize },
|
|
52
|
+
"icon-sm": { icon: "icon-sm" as ButtonSize },
|
|
53
|
+
"icon-lg": { icon: "icon-lg" as ButtonSize },
|
|
54
|
+
} satisfies Record<ButtonSize, { icon: ButtonSize }>;
|
|
36
55
|
|
|
37
56
|
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
|
|
38
57
|
WithElementRef<HTMLAnchorAttributes> & {
|
|
@@ -44,11 +63,11 @@
|
|
|
44
63
|
<script lang="ts">
|
|
45
64
|
let {
|
|
46
65
|
class: className,
|
|
47
|
-
variant =
|
|
48
|
-
size =
|
|
66
|
+
variant = 'default',
|
|
67
|
+
size = 'default',
|
|
49
68
|
ref = $bindable(null),
|
|
50
69
|
href = undefined,
|
|
51
|
-
type =
|
|
70
|
+
type = 'button',
|
|
52
71
|
disabled,
|
|
53
72
|
children,
|
|
54
73
|
...restProps
|
|
@@ -62,7 +81,7 @@
|
|
|
62
81
|
class={cn(buttonVariants({ variant, size }), className)}
|
|
63
82
|
href={disabled ? undefined : href}
|
|
64
83
|
aria-disabled={disabled}
|
|
65
|
-
role={disabled ?
|
|
84
|
+
role={disabled ? 'link' : undefined}
|
|
66
85
|
tabindex={disabled ? -1 : undefined}
|
|
67
86
|
{...restProps}
|
|
68
87
|
>
|
|
@@ -1,66 +1,93 @@
|
|
|
1
|
-
import { type WithElementRef } from
|
|
2
|
-
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from
|
|
3
|
-
import { type VariantProps } from
|
|
1
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
4
4
|
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
variant: {
|
|
6
|
-
default:
|
|
7
|
-
outline:
|
|
8
|
-
secondary:
|
|
9
|
-
ghost:
|
|
10
|
-
destructive:
|
|
11
|
-
link:
|
|
6
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80";
|
|
7
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs";
|
|
8
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
|
|
9
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
|
|
10
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
|
|
11
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
12
12
|
};
|
|
13
13
|
size: {
|
|
14
|
-
default:
|
|
15
|
-
xs:
|
|
16
|
-
sm:
|
|
17
|
-
lg:
|
|
18
|
-
icon:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
15
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
|
|
16
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5";
|
|
17
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
18
|
+
icon: "size-9";
|
|
19
|
+
'icon-xs': "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3";
|
|
20
|
+
'icon-sm': "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md";
|
|
21
|
+
'icon-lg': "size-10";
|
|
22
22
|
};
|
|
23
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-
|
|
23
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
24
24
|
variant: {
|
|
25
|
-
default:
|
|
26
|
-
outline:
|
|
27
|
-
secondary:
|
|
28
|
-
ghost:
|
|
29
|
-
destructive:
|
|
30
|
-
link:
|
|
25
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80";
|
|
26
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs";
|
|
27
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
|
|
28
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
|
|
29
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
|
|
30
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
31
31
|
};
|
|
32
32
|
size: {
|
|
33
|
-
default:
|
|
34
|
-
xs:
|
|
35
|
-
sm:
|
|
36
|
-
lg:
|
|
37
|
-
icon:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
34
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
|
|
35
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5";
|
|
36
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
37
|
+
icon: "size-9";
|
|
38
|
+
'icon-xs': "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3";
|
|
39
|
+
'icon-sm': "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md";
|
|
40
|
+
'icon-lg': "size-10";
|
|
41
41
|
};
|
|
42
|
-
}, undefined, import("tailwind-variants").
|
|
42
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
43
43
|
variant: {
|
|
44
|
-
default:
|
|
45
|
-
outline:
|
|
46
|
-
secondary:
|
|
47
|
-
ghost:
|
|
48
|
-
destructive:
|
|
49
|
-
link:
|
|
44
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80";
|
|
45
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs";
|
|
46
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
|
|
47
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
|
|
48
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
|
|
49
|
+
link: "text-primary underline-offset-4 hover:underline";
|
|
50
50
|
};
|
|
51
51
|
size: {
|
|
52
|
-
default:
|
|
53
|
-
xs:
|
|
54
|
-
sm:
|
|
55
|
-
lg:
|
|
56
|
-
icon:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
53
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
|
|
54
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5";
|
|
55
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
|
|
56
|
+
icon: "size-9";
|
|
57
|
+
'icon-xs': "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3";
|
|
58
|
+
'icon-sm': "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md";
|
|
59
|
+
'icon-lg': "size-10";
|
|
60
60
|
};
|
|
61
|
-
}, undefined
|
|
62
|
-
export type ButtonVariant = VariantProps<typeof buttonVariants>[
|
|
63
|
-
export type ButtonSize = VariantProps<typeof buttonVariants>[
|
|
61
|
+
}, undefined>>;
|
|
62
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
63
|
+
export type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;
|
|
64
|
+
export type Size = ButtonSize;
|
|
65
|
+
export declare const sizeMap: {
|
|
66
|
+
default: {
|
|
67
|
+
icon: ButtonSize;
|
|
68
|
+
};
|
|
69
|
+
xs: {
|
|
70
|
+
icon: ButtonSize;
|
|
71
|
+
};
|
|
72
|
+
sm: {
|
|
73
|
+
icon: ButtonSize;
|
|
74
|
+
};
|
|
75
|
+
lg: {
|
|
76
|
+
icon: ButtonSize;
|
|
77
|
+
};
|
|
78
|
+
icon: {
|
|
79
|
+
icon: ButtonSize;
|
|
80
|
+
};
|
|
81
|
+
"icon-xs": {
|
|
82
|
+
icon: ButtonSize;
|
|
83
|
+
};
|
|
84
|
+
"icon-sm": {
|
|
85
|
+
icon: ButtonSize;
|
|
86
|
+
};
|
|
87
|
+
"icon-lg": {
|
|
88
|
+
icon: ButtonSize;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
64
91
|
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
|
|
65
92
|
variant?: ButtonVariant;
|
|
66
93
|
size?: ButtonSize;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Root, { type ButtonProps, type ButtonSize, type ButtonVariant, buttonVariants } from
|
|
2
|
-
export { Root, type ButtonProps as Props, Root as Button, buttonVariants, type ButtonProps, type ButtonSize, type ButtonVariant
|
|
1
|
+
import Root, { type ButtonProps, type ButtonSize, type ButtonVariant, buttonVariants } from './button.svelte';
|
|
2
|
+
export { Root, type ButtonProps as Props, Root as Button, buttonVariants, type ButtonProps, type ButtonSize, type ButtonVariant };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import Command from './command.svelte';
|
|
5
|
+
import * as Dialog from '../dialog/index.js';
|
|
6
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
open = $bindable(false),
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
value = $bindable(''),
|
|
12
|
+
title = 'Command Palette',
|
|
13
|
+
description = 'Search for a command to run...',
|
|
14
|
+
showCloseButton = false,
|
|
15
|
+
portalProps,
|
|
16
|
+
children,
|
|
17
|
+
class: className,
|
|
18
|
+
...restProps
|
|
19
|
+
}: WithoutChildrenOrChild<DialogPrimitive.RootProps> &
|
|
20
|
+
WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
21
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
22
|
+
children: Snippet;
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
} = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Dialog.Root bind:open {...restProps}>
|
|
31
|
+
<Dialog.Header class="sr-only">
|
|
32
|
+
<Dialog.Title>{title}</Dialog.Title>
|
|
33
|
+
<Dialog.Description>{description}</Dialog.Description>
|
|
34
|
+
</Dialog.Header>
|
|
35
|
+
<Dialog.Content
|
|
36
|
+
class={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}
|
|
37
|
+
{showCloseButton}
|
|
38
|
+
{portalProps}
|
|
39
|
+
>
|
|
40
|
+
<Command {...restProps} bind:value bind:ref {children} />
|
|
41
|
+
</Dialog.Content>
|
|
42
|
+
</Dialog.Root>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.RootProps> & WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
5
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "open">;
|
|
13
|
+
type CommandDialog = ReturnType<typeof CommandDialog>;
|
|
14
|
+
export default CommandDialog;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: CommandPrimitive.EmptyProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CommandPrimitive.Empty
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="command-empty"
|
|
15
|
+
class={cn('py-6 text-center text-sm', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|