@use-stall/ui 0.0.9 → 0.1.1

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/index.d.mts CHANGED
@@ -24,6 +24,7 @@ import * as react_hook_form from 'react-hook-form';
24
24
  import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
25
25
  import * as LabelPrimitive from '@radix-ui/react-label';
26
26
  import * as input_otp from 'input-otp';
27
+ import * as RPNInput from 'react-phone-number-input';
27
28
  import * as PopoverPrimitive from '@radix-ui/react-popover';
28
29
  import * as ProgressPrimitive from '@radix-ui/react-progress';
29
30
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
@@ -663,6 +664,13 @@ interface PasswordInputProps extends React__default.InputHTMLAttributes<HTMLInpu
663
664
  onSubmit?: (event: React__default.FormEvent) => void;
664
665
  }
665
666
 
667
+ type PhoneProps = {
668
+ className?: string;
669
+ value: string | number;
670
+ onChange: (value: any) => void;
671
+ } & React__default.ComponentProps<typeof RPNInput.default>;
672
+ declare function PhoneNumberInput({ className, ...props }: PhoneProps): react_jsx_runtime.JSX.Element;
673
+
666
674
  declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
667
675
  declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
668
676
  interface PopoverProps extends React$1.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
@@ -774,4 +782,4 @@ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrim
774
782
 
775
783
  declare function cn(...inputs: ClassValue[]): string;
776
784
 
777
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ComboboxChip, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, Combobox$1 as ComboboxMulti, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, CopyButton, CountryPicker, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ButtonRoot as FancyButton, Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldValidity, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, ButtonIcon as Icon, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MultiSelect, type PasswordInputProps, type PolymorphicComponent, type PolymorphicComponentProps, type PolymorphicComponentPropsWithRef, type PolymorphicRef, Popover, PopoverContent, PopoverTrigger, PriceInput, Progress, ButtonRoot as Root, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, StatusIndicator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, type TimelineDotProps, TimelineItem, type TimelineProps, TimelineSeparator, TimelineTitle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, statusIndicatorVariants, useComboboxFilter, useFormField };
785
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ComboboxChip, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, Combobox$1 as ComboboxMulti, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, CopyButton, CountryPicker, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ButtonRoot as FancyButton, Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldValidity, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, ButtonIcon as Icon, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MultiSelect, type PasswordInputProps, PhoneNumberInput, type PolymorphicComponent, type PolymorphicComponentProps, type PolymorphicComponentPropsWithRef, type PolymorphicRef, Popover, PopoverContent, PopoverTrigger, PriceInput, Progress, ButtonRoot as Root, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, StatusIndicator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, type TimelineDotProps, TimelineItem, type TimelineProps, TimelineSeparator, TimelineTitle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, statusIndicatorVariants, useComboboxFilter, useFormField };
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ import * as react_hook_form from 'react-hook-form';
24
24
  import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
25
25
  import * as LabelPrimitive from '@radix-ui/react-label';
26
26
  import * as input_otp from 'input-otp';
27
+ import * as RPNInput from 'react-phone-number-input';
27
28
  import * as PopoverPrimitive from '@radix-ui/react-popover';
28
29
  import * as ProgressPrimitive from '@radix-ui/react-progress';
29
30
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
@@ -663,6 +664,13 @@ interface PasswordInputProps extends React__default.InputHTMLAttributes<HTMLInpu
663
664
  onSubmit?: (event: React__default.FormEvent) => void;
664
665
  }
665
666
 
667
+ type PhoneProps = {
668
+ className?: string;
669
+ value: string | number;
670
+ onChange: (value: any) => void;
671
+ } & React__default.ComponentProps<typeof RPNInput.default>;
672
+ declare function PhoneNumberInput({ className, ...props }: PhoneProps): react_jsx_runtime.JSX.Element;
673
+
666
674
  declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
667
675
  declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
668
676
  interface PopoverProps extends React$1.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
@@ -774,4 +782,4 @@ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrim
774
782
 
775
783
  declare function cn(...inputs: ClassValue[]): string;
776
784
 
777
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ComboboxChip, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, Combobox$1 as ComboboxMulti, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, CopyButton, CountryPicker, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ButtonRoot as FancyButton, Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldValidity, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, ButtonIcon as Icon, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MultiSelect, type PasswordInputProps, type PolymorphicComponent, type PolymorphicComponentProps, type PolymorphicComponentPropsWithRef, type PolymorphicRef, Popover, PopoverContent, PopoverTrigger, PriceInput, Progress, ButtonRoot as Root, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, StatusIndicator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, type TimelineDotProps, TimelineItem, type TimelineProps, TimelineSeparator, TimelineTitle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, statusIndicatorVariants, useComboboxFilter, useFormField };
785
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ComboboxChip, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, Combobox$1 as ComboboxMulti, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, CopyButton, CountryPicker, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ButtonRoot as FancyButton, Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldValidity, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, ButtonIcon as Icon, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MultiSelect, type PasswordInputProps, PhoneNumberInput, type PolymorphicComponent, type PolymorphicComponentProps, type PolymorphicComponentPropsWithRef, type PolymorphicRef, Popover, PopoverContent, PopoverTrigger, PriceInput, Progress, ButtonRoot as Root, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, StatusIndicator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, type TimelineDotProps, TimelineItem, type TimelineProps, TimelineSeparator, TimelineTitle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, statusIndicatorVariants, useComboboxFilter, useFormField };
package/dist/index.js CHANGED
@@ -154,6 +154,7 @@ __export(index_exports, {
154
154
  InputOTPSlot: () => InputOTPSlot,
155
155
  Label: () => Label2,
156
156
  MultiSelect: () => MultiSelect,
157
+ PhoneNumberInput: () => PhoneNumberInput,
157
158
  Popover: () => Popover,
158
159
  PopoverContent: () => PopoverContent,
159
160
  PopoverTrigger: () => PopoverTrigger,
@@ -1514,7 +1515,7 @@ var fancyButtonVariants = tv({
1514
1515
  slots: {
1515
1516
  root: [
1516
1517
  // base
1517
- "group relative inline-flex items-center justify-center whitespace-nowrap text-label-sm text-sm outline-none",
1518
+ "group relative inline-flex items-center justify-center whitespace-nowrap text-label-sm text-sm font-medium outline-none",
1518
1519
  "transition duration-200 ease-out cursor-pointer",
1519
1520
  // focus
1520
1521
  "focus:outline-none",
@@ -1624,8 +1625,7 @@ var ButtonRoot = React12.forwardRef(
1624
1625
  "div",
1625
1626
  {
1626
1627
  className: cn(
1627
- `size-4 shrink-0 rounded-full border-2 border-white/30
1628
- border-l-white animate-spin`,
1628
+ `size-4 shrink-0 rounded-full border-2 border-white/50 border-l-white animate-spin`,
1629
1629
  {
1630
1630
  "border-primary/30 border-l-primary": ![
1631
1631
  "primary",
@@ -2804,6 +2804,35 @@ var RPNInput = __toESM(require("react-phone-number-input"));
2804
2804
  var import_flags = __toESM(require("react-phone-number-input/flags"));
2805
2805
  var import_react_phone_number_input = require("react-phone-number-input");
2806
2806
  var import_jsx_runtime28 = require("react/jsx-runtime");
2807
+ function PhoneNumberInput({
2808
+ className = "",
2809
+ ...props
2810
+ }) {
2811
+ const [error, setError] = (0, import_react5.useState)(null);
2812
+ const handleChange = (newValue) => {
2813
+ if (newValue && !(0, import_react_phone_number_input.isValidPhoneNumber)(newValue)) {
2814
+ setError("Invalid phone number");
2815
+ } else {
2816
+ setError(null);
2817
+ }
2818
+ props.onChange(newValue ?? "");
2819
+ };
2820
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn(className), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2821
+ RPNInput.default,
2822
+ {
2823
+ className: cn("flex rounded-md", error && "border border-red-500/70"),
2824
+ international: true,
2825
+ flagComponent: FlagComponent,
2826
+ countrySelectComponent: CountrySelect,
2827
+ inputComponent: PhoneInput,
2828
+ id: "input-46",
2829
+ placeholder: "Enter phone number",
2830
+ ...props,
2831
+ value: props.value,
2832
+ onChange: (e) => handleChange(e ?? "")
2833
+ }
2834
+ ) });
2835
+ }
2807
2836
  var PhoneInput = (0, import_react5.forwardRef)(
2808
2837
  ({ className, ...props }, ref) => {
2809
2838
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
@@ -2820,6 +2849,53 @@ var PhoneInput = (0, import_react5.forwardRef)(
2820
2849
  }
2821
2850
  );
2822
2851
  PhoneInput.displayName = "PhoneInput";
2852
+ var CountrySelect = ({
2853
+ disabled,
2854
+ value,
2855
+ onChange,
2856
+ options: options2
2857
+ }) => {
2858
+ const handleSelect = (event) => {
2859
+ onChange(event.target.value);
2860
+ };
2861
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2862
+ "div",
2863
+ {
2864
+ className: cn(`relative inline-flex items-center self-stretch rounded-s-10 border border-input
2865
+ bg-inherit py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10
2866
+ focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20
2867
+ hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50`),
2868
+ children: [
2869
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [
2870
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FlagComponent, { country: value, countryName: value, "aria-hidden": "true" }),
2871
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-muted-foreground/80", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.ChevronDown, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
2872
+ ] }),
2873
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2874
+ "select",
2875
+ {
2876
+ disabled,
2877
+ value,
2878
+ onChange: handleSelect,
2879
+ className: "absolute inset-0 text-sm opacity-0",
2880
+ "aria-label": "Select country",
2881
+ children: [
2882
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "", children: "Select a country" }, "default"),
2883
+ options2.filter((x) => x.value).map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: option.value, children: [
2884
+ option.label,
2885
+ " ",
2886
+ option.value && `+${RPNInput.getCountryCallingCode(option.value)}`
2887
+ ] }, option.value ?? `empty-${i}`))
2888
+ ]
2889
+ }
2890
+ )
2891
+ ]
2892
+ }
2893
+ );
2894
+ };
2895
+ var FlagComponent = ({ country, countryName }) => {
2896
+ const Flag = import_flags.default[country];
2897
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Flag, { title: countryName }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.Phone, { size: 16, "aria-hidden": "true" }) });
2898
+ };
2823
2899
 
2824
2900
  // src/components/price-input.tsx
2825
2901
  var import_react6 = __toESM(require("react"));
@@ -3673,6 +3749,7 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
3673
3749
  InputOTPSlot,
3674
3750
  Label,
3675
3751
  MultiSelect,
3752
+ PhoneNumberInput,
3676
3753
  Popover,
3677
3754
  PopoverContent,
3678
3755
  PopoverTrigger,
package/dist/index.mjs CHANGED
@@ -1292,7 +1292,7 @@ var fancyButtonVariants = tv({
1292
1292
  slots: {
1293
1293
  root: [
1294
1294
  // base
1295
- "group relative inline-flex items-center justify-center whitespace-nowrap text-label-sm text-sm outline-none",
1295
+ "group relative inline-flex items-center justify-center whitespace-nowrap text-label-sm text-sm font-medium outline-none",
1296
1296
  "transition duration-200 ease-out cursor-pointer",
1297
1297
  // focus
1298
1298
  "focus:outline-none",
@@ -1402,8 +1402,7 @@ var ButtonRoot = React12.forwardRef(
1402
1402
  "div",
1403
1403
  {
1404
1404
  className: cn(
1405
- `size-4 shrink-0 rounded-full border-2 border-white/30
1406
- border-l-white animate-spin`,
1405
+ `size-4 shrink-0 rounded-full border-2 border-white/50 border-l-white animate-spin`,
1407
1406
  {
1408
1407
  "border-primary/30 border-l-primary": ![
1409
1408
  "primary",
@@ -2586,6 +2585,35 @@ import * as RPNInput from "react-phone-number-input";
2586
2585
  import flags from "react-phone-number-input/flags";
2587
2586
  import { isValidPhoneNumber } from "react-phone-number-input";
2588
2587
  import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
2588
+ function PhoneNumberInput({
2589
+ className = "",
2590
+ ...props
2591
+ }) {
2592
+ const [error, setError] = useState3(null);
2593
+ const handleChange = (newValue) => {
2594
+ if (newValue && !isValidPhoneNumber(newValue)) {
2595
+ setError("Invalid phone number");
2596
+ } else {
2597
+ setError(null);
2598
+ }
2599
+ props.onChange(newValue ?? "");
2600
+ };
2601
+ return /* @__PURE__ */ jsx28("div", { className: cn(className), children: /* @__PURE__ */ jsx28(
2602
+ RPNInput.default,
2603
+ {
2604
+ className: cn("flex rounded-md", error && "border border-red-500/70"),
2605
+ international: true,
2606
+ flagComponent: FlagComponent,
2607
+ countrySelectComponent: CountrySelect,
2608
+ inputComponent: PhoneInput,
2609
+ id: "input-46",
2610
+ placeholder: "Enter phone number",
2611
+ ...props,
2612
+ value: props.value,
2613
+ onChange: (e) => handleChange(e ?? "")
2614
+ }
2615
+ ) });
2616
+ }
2589
2617
  var PhoneInput = forwardRef16(
2590
2618
  ({ className, ...props }, ref) => {
2591
2619
  return /* @__PURE__ */ jsx28(
@@ -2602,6 +2630,53 @@ var PhoneInput = forwardRef16(
2602
2630
  }
2603
2631
  );
2604
2632
  PhoneInput.displayName = "PhoneInput";
2633
+ var CountrySelect = ({
2634
+ disabled,
2635
+ value,
2636
+ onChange,
2637
+ options: options2
2638
+ }) => {
2639
+ const handleSelect = (event) => {
2640
+ onChange(event.target.value);
2641
+ };
2642
+ return /* @__PURE__ */ jsxs18(
2643
+ "div",
2644
+ {
2645
+ className: cn(`relative inline-flex items-center self-stretch rounded-s-10 border border-input
2646
+ bg-inherit py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10
2647
+ focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20
2648
+ hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50`),
2649
+ children: [
2650
+ /* @__PURE__ */ jsxs18("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [
2651
+ /* @__PURE__ */ jsx28(FlagComponent, { country: value, countryName: value, "aria-hidden": "true" }),
2652
+ /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground/80", children: /* @__PURE__ */ jsx28(ChevronDown2, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
2653
+ ] }),
2654
+ /* @__PURE__ */ jsxs18(
2655
+ "select",
2656
+ {
2657
+ disabled,
2658
+ value,
2659
+ onChange: handleSelect,
2660
+ className: "absolute inset-0 text-sm opacity-0",
2661
+ "aria-label": "Select country",
2662
+ children: [
2663
+ /* @__PURE__ */ jsx28("option", { value: "", children: "Select a country" }, "default"),
2664
+ options2.filter((x) => x.value).map((option, i) => /* @__PURE__ */ jsxs18("option", { value: option.value, children: [
2665
+ option.label,
2666
+ " ",
2667
+ option.value && `+${RPNInput.getCountryCallingCode(option.value)}`
2668
+ ] }, option.value ?? `empty-${i}`))
2669
+ ]
2670
+ }
2671
+ )
2672
+ ]
2673
+ }
2674
+ );
2675
+ };
2676
+ var FlagComponent = ({ country, countryName }) => {
2677
+ const Flag = flags[country];
2678
+ return /* @__PURE__ */ jsx28("span", { className: "w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ jsx28(Flag, { title: countryName }) : /* @__PURE__ */ jsx28(Phone, { size: 16, "aria-hidden": "true" }) });
2679
+ };
2605
2680
 
2606
2681
  // src/components/price-input.tsx
2607
2682
  import React25 from "react";
@@ -3454,6 +3529,7 @@ export {
3454
3529
  InputOTPSlot,
3455
3530
  Label2 as Label,
3456
3531
  MultiSelect,
3532
+ PhoneNumberInput,
3457
3533
  Popover,
3458
3534
  PopoverContent,
3459
3535
  PopoverTrigger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/ui",
3
- "version": "0.0.9",
3
+ "version": "0.1.1",
4
4
  "author": "Stall",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",