@sikka/hawa 0.2.47-next → 0.2.48-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/index.css CHANGED
@@ -886,6 +886,9 @@ input[type="number"]::-webkit-inner-spin-button,
886
886
  .hawa-h-\[0\.8px\] {
887
887
  height: 0.8px;
888
888
  }
889
+ .hawa-h-\[1\.2rem\] {
890
+ height: 1.2rem;
891
+ }
889
892
  .hawa-h-\[16px\] {
890
893
  height: 16px;
891
894
  }
@@ -1017,6 +1020,9 @@ input[type="number"]::-webkit-inner-spin-button,
1017
1020
  .hawa-w-9 {
1018
1021
  width: 2.25rem;
1019
1022
  }
1023
+ .hawa-w-\[1\.2rem\] {
1024
+ width: 1.2rem;
1025
+ }
1020
1026
  .hawa-w-\[100px\] {
1021
1027
  width: 100px;
1022
1028
  }
@@ -1138,10 +1144,19 @@ input[type="number"]::-webkit-inner-spin-button,
1138
1144
  --tw-translate-y: -50%;
1139
1145
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1140
1146
  }
1147
+ .hawa-rotate-0 {
1148
+ --tw-rotate: 0deg;
1149
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1150
+ }
1141
1151
  .hawa-rotate-180 {
1142
1152
  --tw-rotate: 180deg;
1143
1153
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1144
1154
  }
1155
+ .hawa-scale-100 {
1156
+ --tw-scale-x: 1;
1157
+ --tw-scale-y: 1;
1158
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1159
+ }
1145
1160
  @keyframes hawa-bounce {
1146
1161
 
1147
1162
  0%, 100% {
@@ -2619,6 +2634,19 @@ body {
2619
2634
  .data-\[state\=open\]\:hawa-slide-in-from-top-full[data-state=open] {
2620
2635
  --tw-enter-translate-y: -100%;
2621
2636
  }
2637
+ :is(.hawa-dark .dark\:hawa--rotate-90) {
2638
+ --tw-rotate: -90deg;
2639
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2640
+ }
2641
+ :is(.hawa-dark .dark\:hawa-rotate-0) {
2642
+ --tw-rotate: 0deg;
2643
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2644
+ }
2645
+ :is(.hawa-dark .dark\:hawa-scale-100) {
2646
+ --tw-scale-x: 1;
2647
+ --tw-scale-y: 1;
2648
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2649
+ }
2622
2650
  :is(.hawa-dark .dark\:hawa-border-gray-700) {
2623
2651
  --tw-border-opacity: 1;
2624
2652
  border-color: rgb(55 65 81 / var(--tw-border-opacity));
package/dist/index.d.mts CHANGED
@@ -15,6 +15,9 @@ import * as SeparatorPrimitive from '@radix-ui/react-separator';
15
15
  import * as ProgressPrimitive from '@radix-ui/react-progress';
16
16
  import * as TabsPrimitive from '@radix-ui/react-tabs';
17
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
18
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
19
+ import * as react_hook_form from 'react-hook-form';
20
+ import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
18
21
 
19
22
  declare const buttonVariants: (props?: ({
20
23
  variant?: "link" | "default" | "light" | "destructive" | "outline" | "secondary" | "ghost" | "neoBrutalism" | null | undefined;
@@ -499,7 +502,7 @@ type SelectTypes = {
499
502
  helperText?: any;
500
503
  onInputChange?: any;
501
504
  native?: any;
502
- width?: "full" | "small";
505
+ width?: "full" | "small" | "fit";
503
506
  value?: any;
504
507
  children?: any;
505
508
  getOptionLabel?: any;
@@ -513,4 +516,33 @@ type SelectTypes = {
513
516
  };
514
517
  declare const Select: FC<SelectTypes>;
515
518
 
516
- export { ActionCard, Alert, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, FileDropzone, Input, Label, Loading, Logos, MenuItemType, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioOptionsTypes, ScrollArea, ScrollBar, Select, Separator, Skeleton, Slider, SubItem, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TextareaProps, Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, buttonVariants };
519
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
520
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
521
+ declare const useFormField: () => {
522
+ invalid: boolean;
523
+ isDirty: boolean;
524
+ isTouched: boolean;
525
+ error?: react_hook_form.FieldError | undefined;
526
+ id: string;
527
+ name: string;
528
+ formItemId: string;
529
+ formDescriptionId: string;
530
+ formMessageId: string;
531
+ };
532
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
533
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
534
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
535
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
536
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
537
+
538
+ type TypographyTypes = {
539
+ handleLanguage: (e: any) => void;
540
+ currentLanguage: any;
541
+ handleColorMode: (e: any) => void;
542
+ currentColorMode: any;
543
+ orientation?: "vertical" | "horizontal";
544
+ width?: "default" | "full";
545
+ };
546
+ declare const InterfaceSettings: FC<TypographyTypes>;
547
+
548
+ export { ActionCard, Alert, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, InterfaceSettings, Label, Loading, Logos, MenuItemType, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioOptionsTypes, ScrollArea, ScrollBar, Select, Separator, Skeleton, Slider, SubItem, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TextareaProps, Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, buttonVariants, useFormField };
package/dist/index.d.ts CHANGED
@@ -15,6 +15,9 @@ import * as SeparatorPrimitive from '@radix-ui/react-separator';
15
15
  import * as ProgressPrimitive from '@radix-ui/react-progress';
16
16
  import * as TabsPrimitive from '@radix-ui/react-tabs';
17
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
18
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
19
+ import * as react_hook_form from 'react-hook-form';
20
+ import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
18
21
 
19
22
  declare const buttonVariants: (props?: ({
20
23
  variant?: "link" | "default" | "light" | "destructive" | "outline" | "secondary" | "ghost" | "neoBrutalism" | null | undefined;
@@ -499,7 +502,7 @@ type SelectTypes = {
499
502
  helperText?: any;
500
503
  onInputChange?: any;
501
504
  native?: any;
502
- width?: "full" | "small";
505
+ width?: "full" | "small" | "fit";
503
506
  value?: any;
504
507
  children?: any;
505
508
  getOptionLabel?: any;
@@ -513,4 +516,33 @@ type SelectTypes = {
513
516
  };
514
517
  declare const Select: FC<SelectTypes>;
515
518
 
516
- export { ActionCard, Alert, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, FileDropzone, Input, Label, Loading, Logos, MenuItemType, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioOptionsTypes, ScrollArea, ScrollBar, Select, Separator, Skeleton, Slider, SubItem, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TextareaProps, Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, buttonVariants };
519
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
520
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
521
+ declare const useFormField: () => {
522
+ invalid: boolean;
523
+ isDirty: boolean;
524
+ isTouched: boolean;
525
+ error?: react_hook_form.FieldError | undefined;
526
+ id: string;
527
+ name: string;
528
+ formItemId: string;
529
+ formDescriptionId: string;
530
+ formMessageId: string;
531
+ };
532
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
533
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
534
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
535
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
536
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
537
+
538
+ type TypographyTypes = {
539
+ handleLanguage: (e: any) => void;
540
+ currentLanguage: any;
541
+ handleColorMode: (e: any) => void;
542
+ currentColorMode: any;
543
+ orientation?: "vertical" | "horizontal";
544
+ width?: "default" | "full";
545
+ };
546
+ declare const InterfaceSettings: FC<TypographyTypes>;
547
+
548
+ export { ActionCard, Alert, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, InterfaceSettings, Label, Loading, Logos, MenuItemType, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioOptionsTypes, ScrollArea, ScrollBar, Select, Separator, Skeleton, Slider, SubItem, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TextareaProps, Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, buttonVariants, useFormField };
package/dist/index.js CHANGED
@@ -320,9 +320,33 @@ __export(components_exports, {
320
320
  FileDropzone: function() {
321
321
  return FileDropzone;
322
322
  },
323
+ Form: function() {
324
+ return Form;
325
+ },
326
+ FormControl: function() {
327
+ return FormControl;
328
+ },
329
+ FormDescription: function() {
330
+ return FormDescription;
331
+ },
332
+ FormField: function() {
333
+ return FormField;
334
+ },
335
+ FormItem: function() {
336
+ return FormItem;
337
+ },
338
+ FormLabel: function() {
339
+ return FormLabel;
340
+ },
341
+ FormMessage: function() {
342
+ return FormMessage;
343
+ },
323
344
  Input: function() {
324
345
  return Input;
325
346
  },
347
+ InterfaceSettings: function() {
348
+ return InterfaceSettings;
349
+ },
326
350
  Label: function() {
327
351
  return Label;
328
352
  },
@@ -418,6 +442,9 @@ __export(components_exports, {
418
442
  },
419
443
  buttonVariants: function() {
420
444
  return buttonVariants;
445
+ },
446
+ useFormField: function() {
447
+ return useFormField;
421
448
  }
422
449
  });
423
450
  module.exports = __toCommonJS(components_exports);
@@ -1458,7 +1485,7 @@ var Alert = function(_param) {
1458
1485
  }, 200);
1459
1486
  }
1460
1487
  }, /* @__PURE__ */ import_react10.default.createElement("span", {
1461
- className: "sr-only"
1488
+ className: "hawa-sr-only"
1462
1489
  }, "Close"), /* @__PURE__ */ import_react10.default.createElement("svg", {
1463
1490
  "aria-label": "Close Icon",
1464
1491
  "aria-hidden": "true",
@@ -3824,10 +3851,10 @@ var Input = function(_param) {
3824
3851
  full: "hawa-w-full",
3825
3852
  auto: ""
3826
3853
  };
3827
- var defaultStyle = "hawa-flex hawa-max-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-2";
3854
+ var defaultStyle = "hawa-flex hawa-max-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
3828
3855
  var defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-black dark:hawa-text-white ";
3829
3856
  return /* @__PURE__ */ import_react15.default.createElement("div", {
3830
- className: cn(defaultStyle, marginStyles[margin], widthStyles[width], props.containerClassName, "hawa-w-full")
3857
+ className: cn(defaultStyle, marginStyles[margin], widthStyles[width], props.containerClassName, "hawa-w-full hawa-gap-2")
3831
3858
  }, props.label && /* @__PURE__ */ import_react15.default.createElement(Label, null, props.label), props.isLoading ? /* @__PURE__ */ import_react15.default.createElement(Skeleton, {
3832
3859
  className: "hawa-h-[38px] hawa-w-full"
3833
3860
  }) : /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("div", {
@@ -3838,13 +3865,16 @@ var Input = function(_param) {
3838
3865
  className: "hawa-absolute hawa-left-3 hawa-top-1/2 hawa--translate-y-1/2"
3839
3866
  }, props.icon), /* @__PURE__ */ import_react15.default.createElement("input", {
3840
3867
  className: cn(defaultInputStyle, props.icon && "hawa-pl-10", "focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0", preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0", (_props_inputProps = props.inputProps) === null || _props_inputProps === void 0 ? void 0 : _props_inputProps.className),
3868
+ onChange: props.onChange,
3869
+ autoComplete: props.autoComplete,
3841
3870
  value: props.value,
3842
3871
  defaultValue: props.defaultValue,
3843
3872
  type: props.type,
3844
3873
  placeholder: props.placeholder,
3845
3874
  disabled: preview,
3846
3875
  style: {
3847
- width: width === "auto" ? "auto" : "100%"
3876
+ minWidth: "100%",
3877
+ width: "auto"
3848
3878
  }
3849
3879
  })), props.iconInside && /* @__PURE__ */ import_react15.default.createElement("div", {
3850
3880
  className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2"
@@ -3901,14 +3931,14 @@ var Select = function(props) {
3901
3931
  return /* @__PURE__ */ import_react16.default.createElement("div", null, (_props_texts_noOptions = (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.noOptions) !== null && _props_texts_noOptions !== void 0 ? _props_texts_noOptions : "No Items Found");
3902
3932
  };
3903
3933
  return /* @__PURE__ */ import_react16.default.createElement("div", {
3904
- className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-2"
3934
+ className: cn("hawa-flex hawa-flex-col hawa-gap-2", props.width === "fit" ? "hawa-w-fit" : "hawa-w-full")
3905
3935
  }, props.label && /* @__PURE__ */ import_react16.default.createElement(Label, null, props.label), props.isLoading ? /* @__PURE__ */ import_react16.default.createElement(Skeleton, {
3906
3936
  className: "hawa-h-[38px] hawa-w-full"
3907
3937
  }) : !props.isCreatable ? /* @__PURE__ */ import_react16.default.createElement(import_react_select.default, {
3908
3938
  noOptionsMessage: NoOption,
3909
3939
  classNames: {
3910
3940
  control: function() {
3911
- return cn(" hawa-text-sm hawa-flex hawa-p-2 hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500", props.controlClassNames);
3941
+ return cn(" hawa-text-sm hawa-flex hawa-p-2 hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500", props.controlClassNames);
3912
3942
  },
3913
3943
  container: function() {
3914
3944
  return cn("hawa-rounded", props.containerClassNames, props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer");
@@ -4008,6 +4038,7 @@ var PhoneInput = function(props) {
4008
4038
  dir: "ltr",
4009
4039
  className: "hawa-flex hawa-flex-row hawa-w-full "
4010
4040
  }, /* @__PURE__ */ import_react17.default.createElement(Select, {
4041
+ width: "fit",
4011
4042
  controlClassNames: "hawa-rounded-r-none",
4012
4043
  containerClassNames: "hawa-w-[100px] hawa-p-0 hawa-rounded-r-none",
4013
4044
  options: countries_default,
@@ -4025,10 +4056,10 @@ var PhoneInput = function(props) {
4025
4056
  placeholder: "531045453",
4026
4057
  width: "auto",
4027
4058
  inputProps: {
4028
- className: "input-inside-input hawa-border-l-0 hawa-border-l-transparent hawa-rounded-l-none "
4059
+ className: "hawa-w-full hawa-min-w-full hawa-border-l-0 hawa-border-l-transparent hawa-rounded-l-none "
4029
4060
  }
4030
4061
  }), props.helperText && /* @__PURE__ */ import_react17.default.createElement("p", {
4031
- className: "hawa-mb-1 hawa-mt-1 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500"
4062
+ className: "hawa-mb-1 hawa-mt-1 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500"
4032
4063
  }, props.helperText)));
4033
4064
  };
4034
4065
  // components/elements/AppStores.tsx
@@ -4857,6 +4888,177 @@ function Combobox() {
4857
4888
  }), framework.label);
4858
4889
  })))));
4859
4890
  }
4891
+ // components/elements/Form.tsx
4892
+ var React38 = __toESM(require("react"));
4893
+ var import_react_hook_form = require("react-hook-form");
4894
+ var Form = import_react_hook_form.FormProvider;
4895
+ var FormFieldContext = React38.createContext({});
4896
+ var FormField = function(_param) {
4897
+ var props = _extends({}, _object_destructuring_empty(_param));
4898
+ return /* @__PURE__ */ React38.createElement(FormFieldContext.Provider, {
4899
+ value: {
4900
+ name: props.name
4901
+ }
4902
+ }, /* @__PURE__ */ React38.createElement(import_react_hook_form.Controller, _object_spread({}, props)));
4903
+ };
4904
+ var useFormField = function() {
4905
+ var fieldContext = React38.useContext(FormFieldContext);
4906
+ var itemContext = React38.useContext(FormItemContext);
4907
+ var _ref = (0, import_react_hook_form.useFormContext)(), getFieldState = _ref.getFieldState, formState = _ref.formState;
4908
+ var fieldState = getFieldState(fieldContext.name, formState);
4909
+ if (!fieldContext) {
4910
+ throw new Error("useFormField should be used within <FormField>");
4911
+ }
4912
+ var id = itemContext.id;
4913
+ return _object_spread({
4914
+ id: id,
4915
+ name: fieldContext.name,
4916
+ formItemId: "".concat(id, "-form-item"),
4917
+ formDescriptionId: "".concat(id, "-form-item-description"),
4918
+ formMessageId: "".concat(id, "-form-item-message")
4919
+ }, fieldState);
4920
+ };
4921
+ var FormItemContext = React38.createContext({});
4922
+ var FormItem = React38.forwardRef(function(_param, ref) {
4923
+ var className = _param.className, props = _object_without_properties(_param, [
4924
+ "className"
4925
+ ]);
4926
+ var id = React38.useId();
4927
+ return /* @__PURE__ */ React38.createElement(FormItemContext.Provider, {
4928
+ value: {
4929
+ id: id
4930
+ }
4931
+ }, /* @__PURE__ */ React38.createElement("div", _object_spread({
4932
+ ref: ref,
4933
+ className: cn("space-y-2", className)
4934
+ }, props)));
4935
+ });
4936
+ FormItem.displayName = "FormItem";
4937
+ var FormLabel = React38.forwardRef(function(_param, ref) {
4938
+ var className = _param.className, props = _object_without_properties(_param, [
4939
+ "className"
4940
+ ]);
4941
+ var _useFormField = useFormField(), error = _useFormField.error, formItemId = _useFormField.formItemId;
4942
+ return /* @__PURE__ */ React38.createElement(Label, _object_spread({
4943
+ ref: ref,
4944
+ className: cn(error && "text-destructive", className),
4945
+ htmlFor: formItemId
4946
+ }, props));
4947
+ });
4948
+ FormLabel.displayName = "FormLabel";
4949
+ var FormControl = React38.forwardRef(function(_param, ref) {
4950
+ var props = _extends({}, _object_destructuring_empty(_param));
4951
+ var _useFormField = useFormField(), error = _useFormField.error, formItemId = _useFormField.formItemId, formDescriptionId = _useFormField.formDescriptionId, formMessageId = _useFormField.formMessageId;
4952
+ return /* @__PURE__ */ React38.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, _object_spread({
4953
+ ref: ref,
4954
+ id: formItemId,
4955
+ "aria-describedby": !error ? "".concat(formDescriptionId) : "".concat(formDescriptionId, " ").concat(formMessageId),
4956
+ "aria-invalid": !!error
4957
+ }, props));
4958
+ });
4959
+ FormControl.displayName = "FormControl";
4960
+ var FormDescription = React38.forwardRef(function(_param, ref) {
4961
+ var className = _param.className, props = _object_without_properties(_param, [
4962
+ "className"
4963
+ ]);
4964
+ var formDescriptionId = useFormField().formDescriptionId;
4965
+ return /* @__PURE__ */ React38.createElement("p", _object_spread({
4966
+ ref: ref,
4967
+ id: formDescriptionId,
4968
+ className: cn("text-sm text-muted-foreground", className)
4969
+ }, props));
4970
+ });
4971
+ FormDescription.displayName = "FormDescription";
4972
+ var FormMessage = React38.forwardRef(function(_param, ref) {
4973
+ var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
4974
+ "className",
4975
+ "children"
4976
+ ]);
4977
+ var _useFormField = useFormField(), error = _useFormField.error, formMessageId = _useFormField.formMessageId;
4978
+ var body = error ? String(error === null || error === void 0 ? void 0 : error.message) : children;
4979
+ if (!body) {
4980
+ return null;
4981
+ }
4982
+ return /* @__PURE__ */ React38.createElement("p", _object_spread({
4983
+ ref: ref,
4984
+ id: formMessageId,
4985
+ className: cn("text-sm font-medium text-destructive", className)
4986
+ }, props), body);
4987
+ });
4988
+ FormMessage.displayName = "FormMessage";
4989
+ // components/elements/InterfaceSettings.tsx
4990
+ var import_react25 = __toESM(require("react"));
4991
+ var InterfaceSettings = function(_param) {
4992
+ var _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "horizontal" : _param_orientation, _param_width = _param.width, width = _param_width === void 0 ? "default" : _param_width, props = _object_without_properties(_param, [
4993
+ "orientation",
4994
+ "width"
4995
+ ]);
4996
+ var _ref = _sliced_to_array((0, import_react25.useState)(props.currentColorMode), 2), color = _ref[0], setColor = _ref[1];
4997
+ var _ref1 = _sliced_to_array((0, import_react25.useState)(props.currentLanguage), 2), language = _ref1[0], setLanguage = _ref1[1];
4998
+ var orientationStyle = {
4999
+ horizontal: "hawa-flex hawa-flex-row hawa-justify-between",
5000
+ vertical: "hawa-flex hawa-flex-col hawa-items-center hawa-gap-2"
5001
+ };
5002
+ return /* @__PURE__ */ import_react25.default.createElement("div", {
5003
+ className: cn(orientationStyle[orientation])
5004
+ }, /* @__PURE__ */ import_react25.default.createElement(Radio, {
5005
+ width: width,
5006
+ defaultValue: language,
5007
+ onChangeTab: function(e) {
5008
+ props.handleLanguage(e);
5009
+ setLanguage(e);
5010
+ },
5011
+ design: "tabs",
5012
+ options: [
5013
+ {
5014
+ value: "ar",
5015
+ label: "عربي"
5016
+ },
5017
+ {
5018
+ value: "en",
5019
+ label: "English"
5020
+ }
5021
+ ]
5022
+ }), /* @__PURE__ */ import_react25.default.createElement(Radio, {
5023
+ width: width,
5024
+ defaultValue: color,
5025
+ onChangeTab: function(e) {
5026
+ props.handleColorMode(e);
5027
+ setColor(e);
5028
+ },
5029
+ design: "tabs",
5030
+ options: [
5031
+ {
5032
+ value: "light",
5033
+ label: /* @__PURE__ */ import_react25.default.createElement("svg", {
5034
+ width: "15",
5035
+ height: "15",
5036
+ viewBox: "0 0 15 15",
5037
+ fill: "none",
5038
+ xmlns: "http://www.w3.org/2000/svg",
5039
+ className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-rotate-0 hawa-scale-100 hawa-transition-all dark:hawa--rotate-90"
5040
+ }, /* @__PURE__ */ import_react25.default.createElement("path", {
5041
+ d: "M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",
5042
+ fill: "currentColor"
5043
+ }))
5044
+ },
5045
+ {
5046
+ value: "dark",
5047
+ label: /* @__PURE__ */ import_react25.default.createElement("svg", {
5048
+ xmlns: "http://www.w3.org/2000/svg",
5049
+ width: "24",
5050
+ height: "24",
5051
+ viewBox: "0 0 24 24",
5052
+ fill: "none",
5053
+ stroke: "currentColor",
5054
+ className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-transition-all dark:hawa-rotate-0 dark:hawa-scale-100"
5055
+ }, /* @__PURE__ */ import_react25.default.createElement("path", {
5056
+ d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"
5057
+ }))
5058
+ }
5059
+ ]
5060
+ }));
5061
+ };
4860
5062
  // Annotate the CommonJS export names for ESM import in node:
4861
5063
  0 && (module.exports = {
4862
5064
  ActionCard: ActionCard,
@@ -4894,7 +5096,15 @@ function Combobox() {
4894
5096
  DialogTrigger: DialogTrigger,
4895
5097
  DropdownMenu: DropdownMenu,
4896
5098
  FileDropzone: FileDropzone,
5099
+ Form: Form,
5100
+ FormControl: FormControl,
5101
+ FormDescription: FormDescription,
5102
+ FormField: FormField,
5103
+ FormItem: FormItem,
5104
+ FormLabel: FormLabel,
5105
+ FormMessage: FormMessage,
4897
5106
  Input: Input,
5107
+ InterfaceSettings: InterfaceSettings,
4898
5108
  Label: Label,
4899
5109
  Loading: Loading,
4900
5110
  Logos: Logos,
@@ -4926,5 +5136,6 @@ function Combobox() {
4926
5136
  ToastViewport: ToastViewport,
4927
5137
  Toaster: Toaster,
4928
5138
  Tooltip: Tooltip,
4929
- buttonVariants: buttonVariants
5139
+ buttonVariants: buttonVariants,
5140
+ useFormField: useFormField
4930
5141
  });
package/dist/index.mjs CHANGED
@@ -1232,7 +1232,7 @@ var Alert = ({
1232
1232
  }, 200);
1233
1233
  }
1234
1234
  },
1235
- /* @__PURE__ */ React17.createElement("span", { className: "sr-only" }, "Close"),
1235
+ /* @__PURE__ */ React17.createElement("span", { className: "hawa-sr-only" }, "Close"),
1236
1236
  /* @__PURE__ */ React17.createElement(
1237
1237
  "svg",
1238
1238
  {
@@ -3700,7 +3700,7 @@ var Input = ({
3700
3700
  full: "hawa-w-full",
3701
3701
  auto: ""
3702
3702
  };
3703
- let defaultStyle = "hawa-flex hawa-max-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-2";
3703
+ let defaultStyle = "hawa-flex hawa-max-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
3704
3704
  let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-black dark:hawa-text-white ";
3705
3705
  return /* @__PURE__ */ React26.createElement(
3706
3706
  "div",
@@ -3710,7 +3710,7 @@ var Input = ({
3710
3710
  marginStyles[margin],
3711
3711
  widthStyles[width],
3712
3712
  props.containerClassName,
3713
- "hawa-w-full"
3713
+ "hawa-w-full hawa-gap-2"
3714
3714
  )
3715
3715
  },
3716
3716
  props.label && /* @__PURE__ */ React26.createElement(Label, null, props.label),
@@ -3732,12 +3732,14 @@ var Input = ({
3732
3732
  preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
3733
3733
  props.inputProps?.className
3734
3734
  ),
3735
+ onChange: props.onChange,
3736
+ autoComplete: props.autoComplete,
3735
3737
  value: props.value,
3736
3738
  defaultValue: props.defaultValue,
3737
3739
  type: props.type,
3738
3740
  placeholder: props.placeholder,
3739
3741
  disabled: preview,
3740
- style: { width: width === "auto" ? "auto" : "100%" }
3742
+ style: { minWidth: "100%", width: "auto" }
3741
3743
  }
3742
3744
  )), props.iconInside && /* @__PURE__ */ React26.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), props.helperText && /* @__PURE__ */ React26.createElement("p", { className: "hawa-mb-0 hawa-mt-0 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText)))
3743
3745
  );
@@ -3810,76 +3812,87 @@ var Select = (props) => {
3810
3812
  const NoOption = () => {
3811
3813
  return /* @__PURE__ */ React27.createElement("div", null, props.texts?.noOptions ?? "No Items Found");
3812
3814
  };
3813
- return /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React27.createElement(Label, null, props.label), props.isLoading ? /* @__PURE__ */ React27.createElement(Skeleton, { className: "hawa-h-[38px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React27.createElement(
3814
- ReactSelect,
3815
- {
3816
- noOptionsMessage: NoOption,
3817
- classNames: {
3818
- control: () => cn(
3819
- " hawa-text-sm hawa-flex hawa-p-2 hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500",
3820
- props.controlClassNames
3821
- ),
3822
- container: () => cn(
3823
- "hawa-rounded",
3824
- props.containerClassNames,
3825
- props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
3826
- ),
3827
- // TODO: enable keyboard to go to the next item in the list
3828
- placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
3829
- input: () => "hawa-text-primary hawa-px-2",
3830
- valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
3831
- singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
3832
- indicatorsContainer: () => " hawa-px-0 hawa-cursor-pointer hawa-text-muted-foreground"
3833
- },
3834
- unstyled: true,
3835
- isDisabled: props.disabled,
3836
- options: props.options,
3837
- defaultValue: props.defaultValue,
3838
- isClearable: props.isClearable,
3839
- isMulti: props.isMulti,
3840
- isSearchable: props.isSearchable,
3841
- autoFocus: true,
3842
- onChange: (newValue, action) => (
3843
- // props.onChange(newValue.label, action)
3844
- props.onChange(newValue, action)
3845
- ),
3846
- components: {
3847
- // Control,
3848
- Option,
3849
- Menu
3850
- },
3851
- getOptionLabel: props.getOptionLabel
3852
- }
3853
- ) : /* @__PURE__ */ React27.createElement(
3854
- CreatableSelect,
3815
+ return /* @__PURE__ */ React27.createElement(
3816
+ "div",
3855
3817
  {
3856
- formatCreateLabel: (inputValue) => `${props.texts?.createLabel ?? "Create"} "${inputValue}"`,
3857
- classNames: {
3858
- container: () => cn(
3859
- "hawa-rounded ",
3860
- props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
3818
+ className: cn(
3819
+ "hawa-flex hawa-flex-col hawa-gap-2",
3820
+ props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
3821
+ )
3822
+ },
3823
+ props.label && /* @__PURE__ */ React27.createElement(Label, null, props.label),
3824
+ props.isLoading ? /* @__PURE__ */ React27.createElement(Skeleton, { className: "hawa-h-[38px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React27.createElement(
3825
+ ReactSelect,
3826
+ {
3827
+ noOptionsMessage: NoOption,
3828
+ classNames: {
3829
+ control: () => cn(
3830
+ " hawa-text-sm hawa-flex hawa-p-2 hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500",
3831
+ props.controlClassNames
3832
+ ),
3833
+ container: () => cn(
3834
+ "hawa-rounded",
3835
+ props.containerClassNames,
3836
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
3837
+ ),
3838
+ // TODO: enable keyboard to go to the next item in the list
3839
+ placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
3840
+ input: () => "hawa-text-primary hawa-px-2",
3841
+ valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
3842
+ singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
3843
+ indicatorsContainer: () => " hawa-px-0 hawa-cursor-pointer hawa-text-muted-foreground"
3844
+ },
3845
+ unstyled: true,
3846
+ isDisabled: props.disabled,
3847
+ options: props.options,
3848
+ defaultValue: props.defaultValue,
3849
+ isClearable: props.isClearable,
3850
+ isMulti: props.isMulti,
3851
+ isSearchable: props.isSearchable,
3852
+ autoFocus: true,
3853
+ onChange: (newValue, action) => (
3854
+ // props.onChange(newValue.label, action)
3855
+ props.onChange(newValue, action)
3861
3856
  ),
3862
- placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
3863
- input: () => "hawa-text-primary hawa-px-2",
3864
- valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
3865
- singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
3866
- indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
3867
- },
3868
- unstyled: true,
3869
- options: props.options,
3870
- isClearable: props.isClearable,
3871
- isMulti: props.isMulti,
3872
- isSearchable: props.isSearchable,
3873
- onCreateOption: () => console.log("im changing"),
3874
- onChange: (newValue, action) => props.onChange(newValue, action),
3875
- onInputChange: (newValue, action) => props.onInputChange(newValue, action),
3876
- components: {
3877
- Control,
3878
- Option,
3879
- Menu
3857
+ components: {
3858
+ // Control,
3859
+ Option,
3860
+ Menu
3861
+ },
3862
+ getOptionLabel: props.getOptionLabel
3880
3863
  }
3881
- }
3882
- ), props.helperText && /* @__PURE__ */ React27.createElement("p", { className: "hawa-mt-2 hawa-text-sm hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText));
3864
+ ) : /* @__PURE__ */ React27.createElement(
3865
+ CreatableSelect,
3866
+ {
3867
+ formatCreateLabel: (inputValue) => `${props.texts?.createLabel ?? "Create"} "${inputValue}"`,
3868
+ classNames: {
3869
+ container: () => cn(
3870
+ "hawa-rounded ",
3871
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
3872
+ ),
3873
+ placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
3874
+ input: () => "hawa-text-primary hawa-px-2",
3875
+ valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
3876
+ singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
3877
+ indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
3878
+ },
3879
+ unstyled: true,
3880
+ options: props.options,
3881
+ isClearable: props.isClearable,
3882
+ isMulti: props.isMulti,
3883
+ isSearchable: props.isSearchable,
3884
+ onCreateOption: () => console.log("im changing"),
3885
+ onChange: (newValue, action) => props.onChange(newValue, action),
3886
+ onInputChange: (newValue, action) => props.onInputChange(newValue, action),
3887
+ components: {
3888
+ Control,
3889
+ Option,
3890
+ Menu
3891
+ }
3892
+ }
3893
+ ),
3894
+ props.helperText && /* @__PURE__ */ React27.createElement("p", { className: "hawa-mt-2 hawa-text-sm hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText)
3895
+ );
3883
3896
  };
3884
3897
 
3885
3898
  // components/elements/PhoneInput.tsx
@@ -3888,6 +3901,7 @@ var PhoneInput = (props) => {
3888
3901
  return /* @__PURE__ */ React28.createElement("div", { className: "hawa-mb-3 hawa-flex hawa-flex-col" }, props.label && /* @__PURE__ */ React28.createElement("label", { className: "hawa-mb-2 hawa-block hawa-text-sm hawa-font-medium" }, props.label), /* @__PURE__ */ React28.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full " }, /* @__PURE__ */ React28.createElement(
3889
3902
  Select,
3890
3903
  {
3904
+ width: "fit",
3891
3905
  controlClassNames: "hawa-rounded-r-none",
3892
3906
  containerClassNames: "hawa-w-[100px] hawa-p-0 hawa-rounded-r-none",
3893
3907
  options: countries_default,
@@ -3906,10 +3920,10 @@ var PhoneInput = (props) => {
3906
3920
  placeholder: "531045453",
3907
3921
  width: "auto",
3908
3922
  inputProps: {
3909
- className: "input-inside-input hawa-border-l-0 hawa-border-l-transparent hawa-rounded-l-none "
3923
+ className: "hawa-w-full hawa-min-w-full hawa-border-l-0 hawa-border-l-transparent hawa-rounded-l-none "
3910
3924
  }
3911
3925
  }
3912
- ), props.helperText && /* @__PURE__ */ React28.createElement("p", { className: "hawa-mb-1 hawa-mt-1 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText)));
3926
+ ), props.helperText && /* @__PURE__ */ React28.createElement("p", { className: "hawa-mb-1 hawa-mt-1 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText)));
3913
3927
  };
3914
3928
 
3915
3929
  // components/elements/AppStores.tsx
@@ -4761,6 +4775,188 @@ function Combobox() {
4761
4775
  framework.label
4762
4776
  ))))));
4763
4777
  }
4778
+
4779
+ // components/elements/Form.tsx
4780
+ import * as React38 from "react";
4781
+ import {
4782
+ Controller,
4783
+ FormProvider,
4784
+ useFormContext
4785
+ } from "react-hook-form";
4786
+ var Form = FormProvider;
4787
+ var FormFieldContext = React38.createContext(
4788
+ {}
4789
+ );
4790
+ var FormField = ({
4791
+ ...props
4792
+ }) => {
4793
+ return /* @__PURE__ */ React38.createElement(FormFieldContext.Provider, { value: { name: props.name } }, /* @__PURE__ */ React38.createElement(Controller, { ...props }));
4794
+ };
4795
+ var useFormField = () => {
4796
+ const fieldContext = React38.useContext(FormFieldContext);
4797
+ const itemContext = React38.useContext(FormItemContext);
4798
+ const { getFieldState, formState } = useFormContext();
4799
+ const fieldState = getFieldState(fieldContext.name, formState);
4800
+ if (!fieldContext) {
4801
+ throw new Error("useFormField should be used within <FormField>");
4802
+ }
4803
+ const { id } = itemContext;
4804
+ return {
4805
+ id,
4806
+ name: fieldContext.name,
4807
+ formItemId: `${id}-form-item`,
4808
+ formDescriptionId: `${id}-form-item-description`,
4809
+ formMessageId: `${id}-form-item-message`,
4810
+ ...fieldState
4811
+ };
4812
+ };
4813
+ var FormItemContext = React38.createContext(
4814
+ {}
4815
+ );
4816
+ var FormItem = React38.forwardRef(({ className, ...props }, ref) => {
4817
+ const id = React38.useId();
4818
+ return /* @__PURE__ */ React38.createElement(FormItemContext.Provider, { value: { id } }, /* @__PURE__ */ React38.createElement("div", { ref, className: cn("space-y-2", className), ...props }));
4819
+ });
4820
+ FormItem.displayName = "FormItem";
4821
+ var FormLabel = React38.forwardRef(({ className, ...props }, ref) => {
4822
+ const { error, formItemId } = useFormField();
4823
+ return /* @__PURE__ */ React38.createElement(
4824
+ Label,
4825
+ {
4826
+ ref,
4827
+ className: cn(error && "text-destructive", className),
4828
+ htmlFor: formItemId,
4829
+ ...props
4830
+ }
4831
+ );
4832
+ });
4833
+ FormLabel.displayName = "FormLabel";
4834
+ var FormControl = React38.forwardRef(({ ...props }, ref) => {
4835
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
4836
+ return /* @__PURE__ */ React38.createElement(
4837
+ $5e63c961fc1ce211$export$8c6ed5c666ac1360,
4838
+ {
4839
+ ref,
4840
+ id: formItemId,
4841
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
4842
+ "aria-invalid": !!error,
4843
+ ...props
4844
+ }
4845
+ );
4846
+ });
4847
+ FormControl.displayName = "FormControl";
4848
+ var FormDescription = React38.forwardRef(({ className, ...props }, ref) => {
4849
+ const { formDescriptionId } = useFormField();
4850
+ return /* @__PURE__ */ React38.createElement(
4851
+ "p",
4852
+ {
4853
+ ref,
4854
+ id: formDescriptionId,
4855
+ className: cn("text-sm text-muted-foreground", className),
4856
+ ...props
4857
+ }
4858
+ );
4859
+ });
4860
+ FormDescription.displayName = "FormDescription";
4861
+ var FormMessage = React38.forwardRef(({ className, children, ...props }, ref) => {
4862
+ const { error, formMessageId } = useFormField();
4863
+ const body = error ? String(error?.message) : children;
4864
+ if (!body) {
4865
+ return null;
4866
+ }
4867
+ return /* @__PURE__ */ React38.createElement(
4868
+ "p",
4869
+ {
4870
+ ref,
4871
+ id: formMessageId,
4872
+ className: cn("text-sm font-medium text-destructive", className),
4873
+ ...props
4874
+ },
4875
+ body
4876
+ );
4877
+ });
4878
+ FormMessage.displayName = "FormMessage";
4879
+
4880
+ // components/elements/InterfaceSettings.tsx
4881
+ import React39, { useState as useState14 } from "react";
4882
+ var InterfaceSettings = ({
4883
+ orientation = "horizontal",
4884
+ width = "default",
4885
+ ...props
4886
+ }) => {
4887
+ const [color, setColor] = useState14(props.currentColorMode);
4888
+ const [language, setLanguage] = useState14(props.currentLanguage);
4889
+ let orientationStyle = {
4890
+ horizontal: "hawa-flex hawa-flex-row hawa-justify-between",
4891
+ vertical: "hawa-flex hawa-flex-col hawa-items-center hawa-gap-2"
4892
+ };
4893
+ return /* @__PURE__ */ React39.createElement("div", { className: cn(orientationStyle[orientation]) }, /* @__PURE__ */ React39.createElement(
4894
+ Radio,
4895
+ {
4896
+ width,
4897
+ defaultValue: language,
4898
+ onChangeTab: (e) => {
4899
+ props.handleLanguage(e);
4900
+ setLanguage(e);
4901
+ },
4902
+ design: "tabs",
4903
+ options: [
4904
+ { value: "ar", label: "\u0639\u0631\u0628\u064A" },
4905
+ { value: "en", label: "English" }
4906
+ ]
4907
+ }
4908
+ ), /* @__PURE__ */ React39.createElement(
4909
+ Radio,
4910
+ {
4911
+ width,
4912
+ defaultValue: color,
4913
+ onChangeTab: (e) => {
4914
+ props.handleColorMode(e);
4915
+ setColor(e);
4916
+ },
4917
+ design: "tabs",
4918
+ options: [
4919
+ {
4920
+ value: "light",
4921
+ label: /* @__PURE__ */ React39.createElement(
4922
+ "svg",
4923
+ {
4924
+ width: "15",
4925
+ height: "15",
4926
+ viewBox: "0 0 15 15",
4927
+ fill: "none",
4928
+ xmlns: "http://www.w3.org/2000/svg",
4929
+ className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-rotate-0 hawa-scale-100 hawa-transition-all dark:hawa--rotate-90"
4930
+ },
4931
+ /* @__PURE__ */ React39.createElement(
4932
+ "path",
4933
+ {
4934
+ d: "M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",
4935
+ fill: "currentColor"
4936
+ }
4937
+ )
4938
+ )
4939
+ },
4940
+ {
4941
+ value: "dark",
4942
+ label: /* @__PURE__ */ React39.createElement(
4943
+ "svg",
4944
+ {
4945
+ xmlns: "http://www.w3.org/2000/svg",
4946
+ width: "24",
4947
+ height: "24",
4948
+ viewBox: "0 0 24 24",
4949
+ fill: "none",
4950
+ stroke: "currentColor",
4951
+ className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-transition-all dark:hawa-rotate-0 dark:hawa-scale-100"
4952
+ },
4953
+ /* @__PURE__ */ React39.createElement("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" })
4954
+ )
4955
+ }
4956
+ ]
4957
+ }
4958
+ ));
4959
+ };
4764
4960
  export {
4765
4961
  ActionCard,
4766
4962
  Alert,
@@ -4797,7 +4993,15 @@ export {
4797
4993
  DialogTrigger,
4798
4994
  DropdownMenu,
4799
4995
  FileDropzone,
4996
+ Form,
4997
+ FormControl,
4998
+ FormDescription,
4999
+ FormField,
5000
+ FormItem,
5001
+ FormLabel,
5002
+ FormMessage,
4800
5003
  Input,
5004
+ InterfaceSettings,
4801
5005
  Label,
4802
5006
  Loading,
4803
5007
  Logos,
@@ -4829,5 +5033,6 @@ export {
4829
5033
  ToastViewport,
4830
5034
  Toaster,
4831
5035
  Tooltip,
4832
- buttonVariants
5036
+ buttonVariants,
5037
+ useFormField
4833
5038
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.2.47-next",
3
+ "version": "0.2.48-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -25,6 +25,7 @@
25
25
  "pub": "npm publish --tag next"
26
26
  },
27
27
  "dependencies": {
28
+ "@hookform/resolvers": "^3.3.1",
28
29
  "@radix-ui/react-checkbox": "^1.0.4",
29
30
  "@radix-ui/react-dialog": "^1.0.5",
30
31
  "@radix-ui/react-dropdown-menu": "^2.0.6",
@@ -54,7 +55,8 @@
54
55
  "react-hook-form": "^7.47.0",
55
56
  "react-select": "^5.7.7",
56
57
  "tailwind-merge": "^1.14.0",
57
- "typescript": "5.2.2"
58
+ "typescript": "5.2.2",
59
+ "zod": "^3.22.3"
58
60
  },
59
61
  "devDependencies": {
60
62
  "@storybook/addon-essentials": "^7.4.5",