@sikka/hawa 0.31.17-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 +14 -4
- package/dist/blocks/auth/index.mjs +20 -5
- package/dist/blocks/index.d.mts +3 -1
- package/dist/blocks/index.d.ts +3 -1
- package/dist/blocks/index.js +14 -4
- package/dist/blocks/index.mjs +18 -5
- 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 +14 -4
- package/dist/index.mjs +20 -5
- 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
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
|
)
|
@@ -10378,7 +10380,15 @@ var LoginForm = ({
|
|
10378
10380
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
10379
10381
|
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
10380
10382
|
preferredCountry: { label: "+966" },
|
10381
|
-
|
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
|
+
}
|
10382
10392
|
}
|
10383
10393
|
);
|
10384
10394
|
}
|
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
|
)
|
@@ -10155,7 +10162,15 @@ var LoginForm = ({
|
|
10155
10162
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
10156
10163
|
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
10157
10164
|
preferredCountry: { label: "+966" },
|
10158
|
-
|
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
|
+
}
|
10159
10174
|
}
|
10160
10175
|
);
|
10161
10176
|
}
|
@@ -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
|