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,101 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Popover from '../popover';
|
|
3
|
+
import Button from '../button/button.svelte';
|
|
4
|
+
import * as Command from '../command';
|
|
5
|
+
import { ScrollArea } from '../scroll-area';
|
|
6
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
7
|
+
import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
|
|
8
|
+
import { cn } from '../../../utils.js';
|
|
9
|
+
import Flag from './flag.svelte';
|
|
10
|
+
import type { Country, CountryCode } from 'svelte-tel-input/types';
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
/** List of countries */
|
|
14
|
+
countries: Country[];
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
selected?: CountryCode | null;
|
|
17
|
+
onselect?: (val: CountryCode | null) => void;
|
|
18
|
+
/** Default ordering is alphabetical by country name supply this function to customize the sorting behavior */
|
|
19
|
+
order?: (a: Country, b: Country) => number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let {
|
|
23
|
+
countries,
|
|
24
|
+
disabled = false,
|
|
25
|
+
selected = $bindable(null),
|
|
26
|
+
onselect = undefined,
|
|
27
|
+
order = (a, b) => {
|
|
28
|
+
return a.name.localeCompare(b.name);
|
|
29
|
+
}
|
|
30
|
+
}: Props = $props();
|
|
31
|
+
|
|
32
|
+
let selectedCountry = $derived(countries.find((a) => a.iso2 == selected));
|
|
33
|
+
|
|
34
|
+
let open = $state(false);
|
|
35
|
+
let selectedValue = $state(false);
|
|
36
|
+
|
|
37
|
+
function selectCountry(country: Country) {
|
|
38
|
+
selected = country.iso2;
|
|
39
|
+
selectedValue = true;
|
|
40
|
+
open = false;
|
|
41
|
+
onselect?.(selected);
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<Popover.Root bind:open>
|
|
46
|
+
<Popover.Trigger>
|
|
47
|
+
{#snippet child({ props })}
|
|
48
|
+
<Button
|
|
49
|
+
{...props}
|
|
50
|
+
type="button"
|
|
51
|
+
variant="outline"
|
|
52
|
+
class={cn('flex shrink-0 gap-1 rounded-l-lg rounded-r-none px-3')}
|
|
53
|
+
{disabled}
|
|
54
|
+
>
|
|
55
|
+
<Flag country={selectedCountry} />
|
|
56
|
+
<ChevronsUpDownIcon
|
|
57
|
+
class={cn('-mr-2 h-4 w-4 opacity-50', disabled ? 'hidden' : 'opacity-100')}
|
|
58
|
+
/>
|
|
59
|
+
</Button>
|
|
60
|
+
{/snippet}
|
|
61
|
+
</Popover.Trigger>
|
|
62
|
+
<Popover.Content
|
|
63
|
+
class="w-[300px] p-0"
|
|
64
|
+
align="start"
|
|
65
|
+
onCloseAutoFocus={(e) => {
|
|
66
|
+
if (selectedValue) {
|
|
67
|
+
selectedValue = false;
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
}
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<Command.Root>
|
|
73
|
+
<Command.Input placeholder="Search..." />
|
|
74
|
+
<Command.List>
|
|
75
|
+
<ScrollArea class="h-72">
|
|
76
|
+
<Command.Empty>No country found.</Command.Empty>
|
|
77
|
+
<Command.Group class="overflow-clip">
|
|
78
|
+
{#each countries.sort(order) as country (country.id)}
|
|
79
|
+
<Command.Item
|
|
80
|
+
class="gap-2 [&_.cn-command-item-indicator]:hidden"
|
|
81
|
+
value={country.name}
|
|
82
|
+
onSelect={() => selectCountry(country)}
|
|
83
|
+
>
|
|
84
|
+
<Flag {country} />
|
|
85
|
+
<span class="flex-1 text-sm">{country.name}</span>
|
|
86
|
+
<span class="text-foreground/50 text-sm">
|
|
87
|
+
+{country.dialCode}
|
|
88
|
+
</span>
|
|
89
|
+
<div class="w-4">
|
|
90
|
+
{#if country.iso2 == selected}
|
|
91
|
+
<CheckIcon class="phone-input-check-icon size-4" />
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
|
94
|
+
</Command.Item>
|
|
95
|
+
{/each}
|
|
96
|
+
</Command.Group>
|
|
97
|
+
</ScrollArea>
|
|
98
|
+
</Command.List>
|
|
99
|
+
</Command.Root>
|
|
100
|
+
</Popover.Content>
|
|
101
|
+
</Popover.Root>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Country, CountryCode } from 'svelte-tel-input/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** List of countries */
|
|
4
|
+
countries: Country[];
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
selected?: CountryCode | null;
|
|
7
|
+
onselect?: (val: CountryCode | null) => void;
|
|
8
|
+
/** Default ordering is alphabetical by country name supply this function to customize the sorting behavior */
|
|
9
|
+
order?: (a: Country, b: Country) => number;
|
|
10
|
+
}
|
|
11
|
+
declare const CountrySelector: import("svelte").Component<Props, {}, "selected">;
|
|
12
|
+
type CountrySelector = ReturnType<typeof CountrySelector>;
|
|
13
|
+
export default CountrySelector;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Country } from 'svelte-tel-input/types';
|
|
3
|
+
import { getFlag } from './flags';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
country?: Country | null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { country = null }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<span
|
|
13
|
+
class="bg-foreground/20 flex h-4 w-6 shrink-0 overflow-clip rounded-sm [&>svg]:h-4! [&>svg]:w-6!"
|
|
14
|
+
>
|
|
15
|
+
{#await getFlag(country) then flag}
|
|
16
|
+
{#if flag}
|
|
17
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
18
|
+
{@html flag}
|
|
19
|
+
{/if}
|
|
20
|
+
{/await}
|
|
21
|
+
</span>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { hasFlag } from 'country-flag-icons';
|
|
2
|
+
let flagIcons = null;
|
|
3
|
+
export async function getFlag(country) {
|
|
4
|
+
if (!country)
|
|
5
|
+
return null;
|
|
6
|
+
if (!hasFlag(country.iso2))
|
|
7
|
+
return null;
|
|
8
|
+
flagIcons ??= await import('country-flag-icons/string/3x2');
|
|
9
|
+
return flagIcons[country.iso2] ?? null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export const defaultOptions: TelInputOptions = {
|
|
3
|
+
spaces: true,
|
|
4
|
+
autoPlaceholder: true
|
|
5
|
+
};
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import CountrySelector from './country-selector.svelte';
|
|
10
|
+
import { type PhoneInputProps } from '.';
|
|
11
|
+
import { cn } from '../../../utils.js';
|
|
12
|
+
import { TelInput, countries } from 'svelte-tel-input';
|
|
13
|
+
import 'svelte-tel-input/styles/flags.css';
|
|
14
|
+
import type { TelInputOptions } from 'svelte-tel-input/types';
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
class: className = undefined,
|
|
18
|
+
defaultCountry = null,
|
|
19
|
+
country = $bindable(defaultCountry),
|
|
20
|
+
options = defaultOptions,
|
|
21
|
+
placeholder,
|
|
22
|
+
readonly = false,
|
|
23
|
+
disabled = false,
|
|
24
|
+
value = $bindable(''),
|
|
25
|
+
valid = $bindable(true),
|
|
26
|
+
detailedValue = $bindable(null),
|
|
27
|
+
order = undefined,
|
|
28
|
+
name = undefined,
|
|
29
|
+
...rest
|
|
30
|
+
}: PhoneInputProps = $props();
|
|
31
|
+
|
|
32
|
+
let el: HTMLInputElement | undefined = $state();
|
|
33
|
+
|
|
34
|
+
function focus() {
|
|
35
|
+
// sort of an after update kinda thing
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
el?.focus();
|
|
38
|
+
}, 0);
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div class="flex place-items-center">
|
|
43
|
+
<CountrySelector {order} {countries} bind:selected={country} onselect={focus} />
|
|
44
|
+
<TelInput
|
|
45
|
+
{name}
|
|
46
|
+
bind:country
|
|
47
|
+
bind:detailedValue
|
|
48
|
+
bind:value
|
|
49
|
+
bind:valid
|
|
50
|
+
{readonly}
|
|
51
|
+
{disabled}
|
|
52
|
+
{placeholder}
|
|
53
|
+
bind:el
|
|
54
|
+
{options}
|
|
55
|
+
class={cn(
|
|
56
|
+
'border-input border-l-none bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-l-none rounded-r-md border-y border-r px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
57
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
58
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...rest}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const defaultOptions: TelInputOptions;
|
|
2
|
+
import { type PhoneInputProps } from '.';
|
|
3
|
+
import 'svelte-tel-input/styles/flags.css';
|
|
4
|
+
import type { TelInputOptions } from 'svelte-tel-input/types';
|
|
5
|
+
declare const PhoneInput: import("svelte").Component<PhoneInputProps, {}, "value" | "country" | "valid" | "detailedValue">;
|
|
6
|
+
type PhoneInput = ReturnType<typeof PhoneInput>;
|
|
7
|
+
export default PhoneInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Country, CountryCode, DetailedValue, TelInputOptions } from 'svelte-tel-input/types';
|
|
2
|
+
export type PhoneInputProps = {
|
|
3
|
+
country?: CountryCode | null;
|
|
4
|
+
defaultCountry?: CountryCode | null;
|
|
5
|
+
name?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
valid?: boolean;
|
|
13
|
+
detailedValue?: Partial<DetailedValue> | null;
|
|
14
|
+
options?: TelInputOptions;
|
|
15
|
+
order?: ((a: Country, b: Country) => number) | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Root from './popover.svelte';
|
|
2
|
+
import Close from './popover-close.svelte';
|
|
3
|
+
import Content from './popover-content.svelte';
|
|
4
|
+
import Description from './popover-description.svelte';
|
|
5
|
+
import Header from './popover-header.svelte';
|
|
6
|
+
import Title from './popover-title.svelte';
|
|
7
|
+
import Trigger from './popover-trigger.svelte';
|
|
8
|
+
import Portal from './popover-portal.svelte';
|
|
9
|
+
export { Root, Content, Description, Header, Title, Trigger, Close, Portal, Root as Popover, Content as PopoverContent, Description as PopoverDescription, Header as PopoverHeader, Title as PopoverTitle, Trigger as PopoverTrigger, Close as PopoverClose, Portal as PopoverPortal };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Root from './popover.svelte';
|
|
2
|
+
import Close from './popover-close.svelte';
|
|
3
|
+
import Content from './popover-content.svelte';
|
|
4
|
+
import Description from './popover-description.svelte';
|
|
5
|
+
import Header from './popover-header.svelte';
|
|
6
|
+
import Title from './popover-title.svelte';
|
|
7
|
+
import Trigger from './popover-trigger.svelte';
|
|
8
|
+
import Portal from './popover-portal.svelte';
|
|
9
|
+
export { Root, Content, Description, Header, Title, Trigger, Close, Portal,
|
|
10
|
+
//
|
|
11
|
+
Root as Popover, Content as PopoverContent, Description as PopoverDescription, Header as PopoverHeader, Title as PopoverTitle, Trigger as PopoverTrigger, Close as PopoverClose, Portal as PopoverPortal };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Popover as PopoverPrimitive } from 'bits-ui';
|
|
3
|
+
import PopoverPortal from './popover-portal.svelte';
|
|
4
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
5
|
+
import type { ComponentProps } from 'svelte';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
sideOffset = 4,
|
|
11
|
+
align = 'center',
|
|
12
|
+
portalProps,
|
|
13
|
+
...restProps
|
|
14
|
+
}: PopoverPrimitive.ContentProps & {
|
|
15
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof PopoverPortal>>;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<PopoverPortal {...portalProps}>
|
|
20
|
+
<PopoverPrimitive.Content
|
|
21
|
+
bind:ref
|
|
22
|
+
data-slot="popover-content"
|
|
23
|
+
{sideOffset}
|
|
24
|
+
{align}
|
|
25
|
+
class={cn(
|
|
26
|
+
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 outline-hidden duration-100',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
/>
|
|
31
|
+
</PopoverPortal>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from 'bits-ui';
|
|
2
|
+
import PopoverPortal from './popover-portal.svelte';
|
|
3
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
type $$ComponentProps = PopoverPrimitive.ContentProps & {
|
|
6
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof PopoverPortal>>;
|
|
7
|
+
};
|
|
8
|
+
declare const PopoverContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
9
|
+
type PopoverContent = ReturnType<typeof PopoverContent>;
|
|
10
|
+
export default PopoverContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="popover-description"
|
|
16
|
+
class={cn('text-muted-foreground', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const PopoverDescription: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type PopoverDescription = ReturnType<typeof PopoverDescription>;
|
|
5
|
+
export default PopoverDescription;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="popover-header"
|
|
16
|
+
class={cn('flex flex-col gap-1 text-sm', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const PopoverHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type PopoverHeader = ReturnType<typeof PopoverHeader>;
|
|
5
|
+
export default PopoverHeader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div bind:this={ref} data-slot="popover-title" class={cn('font-medium', className)} {...restProps}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const PopoverTitle: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type PopoverTitle = ReturnType<typeof PopoverTitle>;
|
|
5
|
+
export default PopoverTitle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../utils.js';
|
|
3
|
+
import { Popover as PopoverPrimitive } from 'bits-ui';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: PopoverPrimitive.TriggerProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<PopoverPrimitive.Trigger
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="popover-trigger"
|
|
15
|
+
class={cn('', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
orientation = 'vertical',
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChild<ScrollAreaPrimitive.ScrollbarProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<ScrollAreaPrimitive.Scrollbar
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="scroll-area-scrollbar"
|
|
17
|
+
data-orientation={orientation}
|
|
18
|
+
{orientation}
|
|
19
|
+
class={cn(
|
|
20
|
+
'flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent',
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...restProps}
|
|
24
|
+
>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
<ScrollAreaPrimitive.Thumb
|
|
27
|
+
data-slot="scroll-area-thumb"
|
|
28
|
+
class="bg-border relative flex-1 rounded-full"
|
|
29
|
+
/>
|
|
30
|
+
</ScrollAreaPrimitive.Scrollbar>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui';
|
|
2
|
+
declare const ScrollAreaScrollbar: import("svelte").Component<Omit<ScrollAreaPrimitive.ScrollbarProps, "child">, {}, "ref">;
|
|
3
|
+
type ScrollAreaScrollbar = ReturnType<typeof ScrollAreaScrollbar>;
|
|
4
|
+
export default ScrollAreaScrollbar;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui';
|
|
3
|
+
import { Scrollbar } from './index.js';
|
|
4
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
viewportRef = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
orientation = 'vertical',
|
|
11
|
+
scrollbarXClasses = '',
|
|
12
|
+
scrollbarYClasses = '',
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
}: WithoutChild<ScrollAreaPrimitive.RootProps> & {
|
|
16
|
+
orientation?: 'vertical' | 'horizontal' | 'both' | undefined;
|
|
17
|
+
scrollbarXClasses?: string | undefined;
|
|
18
|
+
scrollbarYClasses?: string | undefined;
|
|
19
|
+
viewportRef?: HTMLElement | null;
|
|
20
|
+
} = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<ScrollAreaPrimitive.Root
|
|
24
|
+
bind:ref
|
|
25
|
+
data-slot="scroll-area"
|
|
26
|
+
class={cn('relative', className)}
|
|
27
|
+
{...restProps}
|
|
28
|
+
>
|
|
29
|
+
<ScrollAreaPrimitive.Viewport
|
|
30
|
+
bind:ref={viewportRef}
|
|
31
|
+
data-slot="scroll-area-viewport"
|
|
32
|
+
class="cn-scroll-area-viewport focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
33
|
+
>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</ScrollAreaPrimitive.Viewport>
|
|
36
|
+
{#if orientation === 'vertical' || orientation === 'both'}
|
|
37
|
+
<Scrollbar orientation="vertical" class={scrollbarYClasses} />
|
|
38
|
+
{/if}
|
|
39
|
+
{#if orientation === 'horizontal' || orientation === 'both'}
|
|
40
|
+
<Scrollbar orientation="horizontal" class={scrollbarXClasses} />
|
|
41
|
+
{/if}
|
|
42
|
+
<ScrollAreaPrimitive.Corner />
|
|
43
|
+
</ScrollAreaPrimitive.Root>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChild } from '../../../utils.js';
|
|
3
|
+
type $$ComponentProps = WithoutChild<ScrollAreaPrimitive.RootProps> & {
|
|
4
|
+
orientation?: 'vertical' | 'horizontal' | 'both' | undefined;
|
|
5
|
+
scrollbarXClasses?: string | undefined;
|
|
6
|
+
scrollbarYClasses?: string | undefined;
|
|
7
|
+
viewportRef?: HTMLElement | null;
|
|
8
|
+
};
|
|
9
|
+
declare const ScrollArea: import("svelte").Component<$$ComponentProps, {}, "ref" | "viewportRef">;
|
|
10
|
+
type ScrollArea = ReturnType<typeof ScrollArea>;
|
|
11
|
+
export default ScrollArea;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const sidebarMenuButtonVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
variant: {
|
|
4
|
-
default:
|
|
5
|
-
outline:
|
|
4
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground";
|
|
5
|
+
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]";
|
|
6
6
|
};
|
|
7
7
|
size: {
|
|
8
|
-
default:
|
|
9
|
-
sm:
|
|
10
|
-
lg:
|
|
8
|
+
default: "h-9 text-sm";
|
|
9
|
+
sm: "h-8 text-xs";
|
|
10
|
+
lg: "h-14 px-3 text-sm group-data-[collapsible=icon]:p-0!";
|
|
11
11
|
};
|
|
12
12
|
}, undefined, "ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-lg px-3 py-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
13
13
|
variant: {
|
|
14
|
-
default:
|
|
15
|
-
outline:
|
|
14
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground";
|
|
15
|
+
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]";
|
|
16
16
|
};
|
|
17
17
|
size: {
|
|
18
|
-
default:
|
|
19
|
-
sm:
|
|
20
|
-
lg:
|
|
18
|
+
default: "h-9 text-sm";
|
|
19
|
+
sm: "h-8 text-xs";
|
|
20
|
+
lg: "h-14 px-3 text-sm group-data-[collapsible=icon]:p-0!";
|
|
21
21
|
};
|
|
22
|
-
}, undefined, import("tailwind-variants").
|
|
22
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
23
23
|
variant: {
|
|
24
|
-
default:
|
|
25
|
-
outline:
|
|
24
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground";
|
|
25
|
+
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]";
|
|
26
26
|
};
|
|
27
27
|
size: {
|
|
28
|
-
default:
|
|
29
|
-
sm:
|
|
30
|
-
lg:
|
|
28
|
+
default: "h-9 text-sm";
|
|
29
|
+
sm: "h-8 text-xs";
|
|
30
|
+
lg: "h-14 px-3 text-sm group-data-[collapsible=icon]:p-0!";
|
|
31
31
|
};
|
|
32
|
-
}, undefined
|
|
32
|
+
}, undefined>>;
|
|
33
33
|
export type SidebarMenuButtonVariant = VariantProps<typeof sidebarMenuButtonVariants>["variant"];
|
|
34
34
|
export type SidebarMenuButtonSize = VariantProps<typeof sidebarMenuButtonVariants>["size"];
|
|
35
35
|
import * as Tooltip from "../tooltip/index.js";
|