@sikka/hawa 0.31.16-next → 0.32.0-next
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/{Radio-D52-m4Ns.d.mts → Radio-BpXOu4Hr.d.mts} +17 -1
- package/dist/{Radio-B-DG0FMr.d.ts → Radio-CREjhlGz.d.ts} +17 -1
- package/dist/blocks/auth/index.d.mts +25 -8
- package/dist/blocks/auth/index.d.ts +25 -8
- package/dist/blocks/auth/index.js +32 -8
- package/dist/blocks/auth/index.mjs +38 -9
- package/dist/blocks/index.d.mts +3 -1
- package/dist/blocks/index.d.ts +3 -1
- package/dist/blocks/index.js +32 -8
- package/dist/blocks/index.mjs +36 -9
- package/dist/{chunk-VZNDYO6H.mjs → chunk-WFPAI2QC.mjs} +3 -1
- package/dist/elements/index.d.mts +3 -16
- package/dist/elements/index.d.ts +3 -16
- package/dist/elements/index.js +3 -1
- package/dist/elements/index.mjs +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +32 -8
- package/dist/index.mjs +38 -9
- package/dist/phoneInput/index.d.mts +6 -3
- package/dist/phoneInput/index.d.ts +6 -3
- package/dist/phoneInput/index.js +3 -1
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +3 -1
- package/dist/phoneInput/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -13,8 +13,8 @@ import { DialogProps } from '@radix-ui/react-dialog';
|
|
13
13
|
import { VariantProps } from 'class-variance-authority';
|
14
14
|
import { RowData, ColumnDef } from '@tanstack/react-table';
|
15
15
|
export { ColumnDef } from '@tanstack/react-table';
|
16
|
-
import { L as LabelProps } from '../Radio-
|
17
|
-
export { b as Label, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-
|
16
|
+
import { L as LabelProps } from '../Radio-BpXOu4Hr.mjs';
|
17
|
+
export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-BpXOu4Hr.mjs';
|
18
18
|
import { Command as Command$1 } from 'cmdk';
|
19
19
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
20
20
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
@@ -650,19 +650,6 @@ type BadgeTypes = {
|
|
650
650
|
declare const Badge: FC<BadgeTypes>;
|
651
651
|
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
|
652
652
|
|
653
|
-
type PhoneInputTypes = {
|
654
|
-
preferredCountry?: {
|
655
|
-
label: string;
|
656
|
-
};
|
657
|
-
helperText?: any;
|
658
|
-
label?: string;
|
659
|
-
labelProps?: LabelProps;
|
660
|
-
placeholder?: string;
|
661
|
-
handleChange?: (value: string) => void;
|
662
|
-
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
663
|
-
};
|
664
|
-
declare const PhoneInput: FC<PhoneInputTypes>;
|
665
|
-
|
666
653
|
type PinInputTypes = {
|
667
654
|
/** Label text to display for the Pin Input */
|
668
655
|
label?: string;
|
@@ -888,4 +875,4 @@ type PhoneMockupProps = {
|
|
888
875
|
};
|
889
876
|
declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
|
890
877
|
|
891
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator,
|
878
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
|
package/dist/elements/index.d.ts
CHANGED
@@ -13,8 +13,8 @@ import { DialogProps } from '@radix-ui/react-dialog';
|
|
13
13
|
import { VariantProps } from 'class-variance-authority';
|
14
14
|
import { RowData, ColumnDef } from '@tanstack/react-table';
|
15
15
|
export { ColumnDef } from '@tanstack/react-table';
|
16
|
-
import { L as LabelProps } from '../Radio-
|
17
|
-
export { b as Label, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-
|
16
|
+
import { L as LabelProps } from '../Radio-CREjhlGz.js';
|
17
|
+
export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-CREjhlGz.js';
|
18
18
|
import { Command as Command$1 } from 'cmdk';
|
19
19
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
20
20
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
@@ -650,19 +650,6 @@ type BadgeTypes = {
|
|
650
650
|
declare const Badge: FC<BadgeTypes>;
|
651
651
|
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
|
652
652
|
|
653
|
-
type PhoneInputTypes = {
|
654
|
-
preferredCountry?: {
|
655
|
-
label: string;
|
656
|
-
};
|
657
|
-
helperText?: any;
|
658
|
-
label?: string;
|
659
|
-
labelProps?: LabelProps;
|
660
|
-
placeholder?: string;
|
661
|
-
handleChange?: (value: string) => void;
|
662
|
-
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
663
|
-
};
|
664
|
-
declare const PhoneInput: FC<PhoneInputTypes>;
|
665
|
-
|
666
653
|
type PinInputTypes = {
|
667
654
|
/** Label text to display for the Pin Input */
|
668
655
|
label?: string;
|
@@ -888,4 +875,4 @@ type PhoneMockupProps = {
|
|
888
875
|
};
|
889
876
|
declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
|
890
877
|
|
891
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator,
|
878
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
|
package/dist/elements/index.js
CHANGED
@@ -6692,12 +6692,14 @@ var countries_default = countries;
|
|
6692
6692
|
var PhoneInput = ({
|
6693
6693
|
labelProps,
|
6694
6694
|
inputProps,
|
6695
|
+
countryCodes,
|
6695
6696
|
...props
|
6696
6697
|
}) => {
|
6697
6698
|
const [phoneNumber, setPhoneNumber] = (0, import_react34.useState)("");
|
6698
6699
|
const [countryCode, setCountryCode] = (0, import_react34.useState)(props.preferredCountry);
|
6699
6700
|
const inputRef = (0, import_react34.useRef)(null);
|
6700
6701
|
const handleInputChange = (e) => {
|
6702
|
+
console.log("test e ", e.target.value);
|
6701
6703
|
const validChars = /^[0-9-()]+$/;
|
6702
6704
|
const input = e.target.value;
|
6703
6705
|
if (input === "" || validChars.test(input)) {
|
@@ -6720,7 +6722,7 @@ var PhoneInput = ({
|
|
6720
6722
|
isSearchable: true,
|
6721
6723
|
isClearable: false,
|
6722
6724
|
placeholder: "Code",
|
6723
|
-
options: countries_default,
|
6725
|
+
options: countryCodes || countries_default,
|
6724
6726
|
onChange: setCountryCode,
|
6725
6727
|
value: countryCode == null ? void 0 : countryCode.label,
|
6726
6728
|
defaultValue: props.preferredCountry
|
package/dist/elements/index.mjs
CHANGED
package/dist/index.d.mts
CHANGED
@@ -851,7 +851,7 @@ type BadgeTypes = {
|
|
851
851
|
declare const Badge: FC<BadgeTypes>;
|
852
852
|
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
|
853
853
|
|
854
|
-
type
|
854
|
+
type PhoneInputProps = {
|
855
855
|
preferredCountry?: {
|
856
856
|
label: string;
|
857
857
|
};
|
@@ -861,8 +861,11 @@ type PhoneInputTypes = {
|
|
861
861
|
placeholder?: string;
|
862
862
|
handleChange?: (value: string) => void;
|
863
863
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
864
|
+
countryCodes?: {
|
865
|
+
label: string;
|
866
|
+
}[];
|
864
867
|
};
|
865
|
-
declare const PhoneInput: FC<
|
868
|
+
declare const PhoneInput: FC<PhoneInputProps>;
|
866
869
|
|
867
870
|
type PinInputTypes = {
|
868
871
|
/** Label text to display for the Pin Input */
|
@@ -1572,6 +1575,8 @@ type LoginFormTypes = {
|
|
1572
1575
|
passwordLength?: number;
|
1573
1576
|
/** If true, the form is displayed without a card container styling.*/
|
1574
1577
|
cardless?: boolean;
|
1578
|
+
/** Props to pass to the PhoneInput component */
|
1579
|
+
phoneInputProps: PhoneInputProps;
|
1575
1580
|
};
|
1576
1581
|
declare const LoginForm: FC<LoginFormTypes>;
|
1577
1582
|
|
@@ -2137,4 +2142,4 @@ interface ContentRect {
|
|
2137
2142
|
}
|
2138
2143
|
declare const useMeasureDirty: (ref: RefObject<HTMLElement>) => ContentRect;
|
2139
2144
|
|
2140
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };
|
2145
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, type PhoneInputProps, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
@@ -851,7 +851,7 @@ type BadgeTypes = {
|
|
851
851
|
declare const Badge: FC<BadgeTypes>;
|
852
852
|
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
|
853
853
|
|
854
|
-
type
|
854
|
+
type PhoneInputProps = {
|
855
855
|
preferredCountry?: {
|
856
856
|
label: string;
|
857
857
|
};
|
@@ -861,8 +861,11 @@ type PhoneInputTypes = {
|
|
861
861
|
placeholder?: string;
|
862
862
|
handleChange?: (value: string) => void;
|
863
863
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
864
|
+
countryCodes?: {
|
865
|
+
label: string;
|
866
|
+
}[];
|
864
867
|
};
|
865
|
-
declare const PhoneInput: FC<
|
868
|
+
declare const PhoneInput: FC<PhoneInputProps>;
|
866
869
|
|
867
870
|
type PinInputTypes = {
|
868
871
|
/** Label text to display for the Pin Input */
|
@@ -1572,6 +1575,8 @@ type LoginFormTypes = {
|
|
1572
1575
|
passwordLength?: number;
|
1573
1576
|
/** If true, the form is displayed without a card container styling.*/
|
1574
1577
|
cardless?: boolean;
|
1578
|
+
/** Props to pass to the PhoneInput component */
|
1579
|
+
phoneInputProps: PhoneInputProps;
|
1575
1580
|
};
|
1576
1581
|
declare const LoginForm: FC<LoginFormTypes>;
|
1577
1582
|
|
@@ -2137,4 +2142,4 @@ interface ContentRect {
|
|
2137
2142
|
}
|
2138
2143
|
declare const useMeasureDirty: (ref: RefObject<HTMLElement>) => ContentRect;
|
2139
2144
|
|
2140
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };
|
2145
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, type PhoneInputProps, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };
|
package/dist/index.js
CHANGED
@@ -7086,12 +7086,14 @@ var countries_default = countries;
|
|
7086
7086
|
var PhoneInput = ({
|
7087
7087
|
labelProps,
|
7088
7088
|
inputProps,
|
7089
|
+
countryCodes,
|
7089
7090
|
...props
|
7090
7091
|
}) => {
|
7091
7092
|
const [phoneNumber, setPhoneNumber] = (0, import_react34.useState)("");
|
7092
7093
|
const [countryCode, setCountryCode] = (0, import_react34.useState)(props.preferredCountry);
|
7093
7094
|
const inputRef = (0, import_react34.useRef)(null);
|
7094
7095
|
const handleInputChange = (e) => {
|
7096
|
+
console.log("test e ", e.target.value);
|
7095
7097
|
const validChars = /^[0-9-()]+$/;
|
7096
7098
|
const input = e.target.value;
|
7097
7099
|
if (input === "" || validChars.test(input)) {
|
@@ -7114,7 +7116,7 @@ var PhoneInput = ({
|
|
7114
7116
|
isSearchable: true,
|
7115
7117
|
isClearable: false,
|
7116
7118
|
placeholder: "Code",
|
7117
|
-
options: countries_default,
|
7119
|
+
options: countryCodes || countries_default,
|
7118
7120
|
onChange: setCountryCode,
|
7119
7121
|
value: countryCode == null ? void 0 : countryCode.label,
|
7120
7122
|
defaultValue: props.preferredCountry
|
@@ -10223,8 +10225,8 @@ var LoginForm = ({
|
|
10223
10225
|
required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
|
10224
10226
|
}).refine(
|
10225
10227
|
(value) => {
|
10226
|
-
let
|
10227
|
-
return
|
10228
|
+
let isPhoneValid = (0, import_libphonenumber_js.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js.isValidPhoneNumber)(value) && (0, import_libphonenumber_js.validatePhoneNumberLength)(value) === void 0;
|
10229
|
+
return isPhoneValid;
|
10228
10230
|
},
|
10229
10231
|
{ message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
|
10230
10232
|
)
|
@@ -10261,7 +10263,10 @@ var LoginForm = ({
|
|
10261
10263
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10262
10264
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10263
10265
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
10264
|
-
...field
|
10266
|
+
...field,
|
10267
|
+
onChange: (e) => {
|
10268
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
10269
|
+
}
|
10265
10270
|
}
|
10266
10271
|
);
|
10267
10272
|
}
|
@@ -10375,7 +10380,15 @@ var LoginForm = ({
|
|
10375
10380
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
10376
10381
|
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
10377
10382
|
preferredCountry: { label: "+966" },
|
10378
|
-
|
10383
|
+
...props.phoneInputProps,
|
10384
|
+
handleChange: (e) => {
|
10385
|
+
if ((0, import_libphonenumber_js.isValidPhoneNumber)(e) && (0, import_libphonenumber_js.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js.validatePhoneNumberLength)(e) === void 0) {
|
10386
|
+
let parsed = (0, import_libphonenumber_js.parsePhoneNumber)(e);
|
10387
|
+
field.onChange(parsed.number);
|
10388
|
+
} else {
|
10389
|
+
field.onChange(e);
|
10390
|
+
}
|
10391
|
+
}
|
10379
10392
|
}
|
10380
10393
|
);
|
10381
10394
|
}
|
@@ -10397,7 +10410,10 @@ var LoginForm = ({
|
|
10397
10410
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10398
10411
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10399
10412
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
10400
|
-
...field
|
10413
|
+
...field,
|
10414
|
+
onChange: (e) => {
|
10415
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
10416
|
+
}
|
10401
10417
|
}
|
10402
10418
|
);
|
10403
10419
|
}
|
@@ -10654,7 +10670,12 @@ var RegisterForm = ({
|
|
10654
10670
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10655
10671
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10656
10672
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
10657
|
-
...field
|
10673
|
+
...field,
|
10674
|
+
onChange: (e) => {
|
10675
|
+
field.onChange(
|
10676
|
+
e.target.value.toLowerCase().trim()
|
10677
|
+
);
|
10678
|
+
}
|
10658
10679
|
}
|
10659
10680
|
);
|
10660
10681
|
}
|
@@ -11084,7 +11105,10 @@ var ResetPasswordForm = ({
|
|
11084
11105
|
label: ((_b2 = (_a2 = props.texts) == null ? void 0 : _a2.email) == null ? void 0 : _b2.label) || "Email",
|
11085
11106
|
helperText: (_c2 = formState.errors.email) == null ? void 0 : _c2.message,
|
11086
11107
|
placeholder: (_e2 = (_d2 = props.texts) == null ? void 0 : _d2.email) == null ? void 0 : _e2.placeholder,
|
11087
|
-
...field
|
11108
|
+
...field,
|
11109
|
+
onChange: (e) => {
|
11110
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
11111
|
+
}
|
11088
11112
|
}
|
11089
11113
|
);
|
11090
11114
|
}
|
package/dist/index.mjs
CHANGED
@@ -6856,12 +6856,14 @@ var countries_default = countries;
|
|
6856
6856
|
var PhoneInput = ({
|
6857
6857
|
labelProps,
|
6858
6858
|
inputProps,
|
6859
|
+
countryCodes,
|
6859
6860
|
...props
|
6860
6861
|
}) => {
|
6861
6862
|
const [phoneNumber, setPhoneNumber] = useState26("");
|
6862
6863
|
const [countryCode, setCountryCode] = useState26(props.preferredCountry);
|
6863
6864
|
const inputRef = useRef16(null);
|
6864
6865
|
const handleInputChange = (e) => {
|
6866
|
+
console.log("test e ", e.target.value);
|
6865
6867
|
const validChars = /^[0-9-()]+$/;
|
6866
6868
|
const input = e.target.value;
|
6867
6869
|
if (input === "" || validChars.test(input)) {
|
@@ -6884,7 +6886,7 @@ var PhoneInput = ({
|
|
6884
6886
|
isSearchable: true,
|
6885
6887
|
isClearable: false,
|
6886
6888
|
placeholder: "Code",
|
6887
|
-
options: countries_default,
|
6889
|
+
options: countryCodes || countries_default,
|
6888
6890
|
onChange: setCountryCode,
|
6889
6891
|
value: countryCode == null ? void 0 : countryCode.label,
|
6890
6892
|
defaultValue: props.preferredCountry
|
@@ -9948,7 +9950,12 @@ import React83 from "react";
|
|
9948
9950
|
import { useState as useState39 } from "react";
|
9949
9951
|
import { Controller, useForm } from "react-hook-form";
|
9950
9952
|
import { zodResolver } from "@hookform/resolvers/zod";
|
9951
|
-
import {
|
9953
|
+
import {
|
9954
|
+
isPossiblePhoneNumber,
|
9955
|
+
isValidPhoneNumber,
|
9956
|
+
parsePhoneNumber,
|
9957
|
+
validatePhoneNumberLength
|
9958
|
+
} from "libphonenumber-js";
|
9952
9959
|
import * as z from "zod";
|
9953
9960
|
var LoginForm = ({
|
9954
9961
|
loginType = "email",
|
@@ -10000,8 +10007,8 @@ var LoginForm = ({
|
|
10000
10007
|
required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
|
10001
10008
|
}).refine(
|
10002
10009
|
(value) => {
|
10003
|
-
let
|
10004
|
-
return
|
10010
|
+
let isPhoneValid = isPossiblePhoneNumber(value) && isValidPhoneNumber(value) && validatePhoneNumberLength(value) === void 0;
|
10011
|
+
return isPhoneValid;
|
10005
10012
|
},
|
10006
10013
|
{ message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
|
10007
10014
|
)
|
@@ -10038,7 +10045,10 @@ var LoginForm = ({
|
|
10038
10045
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10039
10046
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10040
10047
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
10041
|
-
...field
|
10048
|
+
...field,
|
10049
|
+
onChange: (e) => {
|
10050
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
10051
|
+
}
|
10042
10052
|
}
|
10043
10053
|
);
|
10044
10054
|
}
|
@@ -10152,7 +10162,15 @@ var LoginForm = ({
|
|
10152
10162
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
10153
10163
|
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
10154
10164
|
preferredCountry: { label: "+966" },
|
10155
|
-
|
10165
|
+
...props.phoneInputProps,
|
10166
|
+
handleChange: (e) => {
|
10167
|
+
if (isValidPhoneNumber(e) && isPossiblePhoneNumber(e) && validatePhoneNumberLength(e) === void 0) {
|
10168
|
+
let parsed = parsePhoneNumber(e);
|
10169
|
+
field.onChange(parsed.number);
|
10170
|
+
} else {
|
10171
|
+
field.onChange(e);
|
10172
|
+
}
|
10173
|
+
}
|
10156
10174
|
}
|
10157
10175
|
);
|
10158
10176
|
}
|
@@ -10174,7 +10192,10 @@ var LoginForm = ({
|
|
10174
10192
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10175
10193
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10176
10194
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
10177
|
-
...field
|
10195
|
+
...field,
|
10196
|
+
onChange: (e) => {
|
10197
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
10198
|
+
}
|
10178
10199
|
}
|
10179
10200
|
);
|
10180
10201
|
}
|
@@ -10431,7 +10452,12 @@ var RegisterForm = ({
|
|
10431
10452
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10432
10453
|
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10433
10454
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
10434
|
-
...field
|
10455
|
+
...field,
|
10456
|
+
onChange: (e) => {
|
10457
|
+
field.onChange(
|
10458
|
+
e.target.value.toLowerCase().trim()
|
10459
|
+
);
|
10460
|
+
}
|
10435
10461
|
}
|
10436
10462
|
);
|
10437
10463
|
}
|
@@ -10861,7 +10887,10 @@ var ResetPasswordForm = ({
|
|
10861
10887
|
label: ((_b2 = (_a2 = props.texts) == null ? void 0 : _a2.email) == null ? void 0 : _b2.label) || "Email",
|
10862
10888
|
helperText: (_c2 = formState.errors.email) == null ? void 0 : _c2.message,
|
10863
10889
|
placeholder: (_e2 = (_d2 = props.texts) == null ? void 0 : _d2.email) == null ? void 0 : _e2.placeholder,
|
10864
|
-
...field
|
10890
|
+
...field,
|
10891
|
+
onChange: (e) => {
|
10892
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
10893
|
+
}
|
10865
10894
|
}
|
10866
10895
|
);
|
10867
10896
|
}
|
@@ -10,7 +10,7 @@ type LabelProps = {
|
|
10
10
|
required?: boolean;
|
11
11
|
};
|
12
12
|
|
13
|
-
type
|
13
|
+
type PhoneInputProps = {
|
14
14
|
preferredCountry?: {
|
15
15
|
label: string;
|
16
16
|
};
|
@@ -20,7 +20,10 @@ type PhoneInputTypes = {
|
|
20
20
|
placeholder?: string;
|
21
21
|
handleChange?: (value: string) => void;
|
22
22
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
23
|
+
countryCodes?: {
|
24
|
+
label: string;
|
25
|
+
}[];
|
23
26
|
};
|
24
|
-
declare const PhoneInput: FC<
|
27
|
+
declare const PhoneInput: FC<PhoneInputProps>;
|
25
28
|
|
26
|
-
export { PhoneInput };
|
29
|
+
export { PhoneInput, type PhoneInputProps };
|
@@ -10,7 +10,7 @@ type LabelProps = {
|
|
10
10
|
required?: boolean;
|
11
11
|
};
|
12
12
|
|
13
|
-
type
|
13
|
+
type PhoneInputProps = {
|
14
14
|
preferredCountry?: {
|
15
15
|
label: string;
|
16
16
|
};
|
@@ -20,7 +20,10 @@ type PhoneInputTypes = {
|
|
20
20
|
placeholder?: string;
|
21
21
|
handleChange?: (value: string) => void;
|
22
22
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
23
|
+
countryCodes?: {
|
24
|
+
label: string;
|
25
|
+
}[];
|
23
26
|
};
|
24
|
-
declare const PhoneInput: FC<
|
27
|
+
declare const PhoneInput: FC<PhoneInputProps>;
|
25
28
|
|
26
|
-
export { PhoneInput };
|
29
|
+
export { PhoneInput, type PhoneInputProps };
|
package/dist/phoneInput/index.js
CHANGED
@@ -2083,12 +2083,14 @@ var Select = ({
|
|
2083
2083
|
var PhoneInput = ({
|
2084
2084
|
labelProps,
|
2085
2085
|
inputProps,
|
2086
|
+
countryCodes,
|
2086
2087
|
...props
|
2087
2088
|
}) => {
|
2088
2089
|
const [phoneNumber, setPhoneNumber] = (0, import_react4.useState)("");
|
2089
2090
|
const [countryCode, setCountryCode] = (0, import_react4.useState)(props.preferredCountry);
|
2090
2091
|
const inputRef = (0, import_react4.useRef)(null);
|
2091
2092
|
const handleInputChange = (e) => {
|
2093
|
+
console.log("test e ", e.target.value);
|
2092
2094
|
const validChars = /^[0-9-()]+$/;
|
2093
2095
|
const input = e.target.value;
|
2094
2096
|
if (input === "" || validChars.test(input)) {
|
@@ -2111,7 +2113,7 @@ var PhoneInput = ({
|
|
2111
2113
|
isSearchable: true,
|
2112
2114
|
isClearable: false,
|
2113
2115
|
placeholder: "Code",
|
2114
|
-
options: countries_default,
|
2116
|
+
options: countryCodes || countries_default,
|
2115
2117
|
onChange: setCountryCode,
|
2116
2118
|
value: countryCode == null ? void 0 : countryCode.label,
|
2117
2119
|
defaultValue: props.preferredCountry
|