@underverse-ui/underverse 0.2.10 → 0.2.12

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.cts CHANGED
@@ -1463,7 +1463,9 @@ declare const useFormField: () => {
1463
1463
  formMessageId: string;
1464
1464
  };
1465
1465
  declare const FormItem: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
1466
- declare const FormLabel: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & React$1.RefAttributes<HTMLLabelElement>>;
1466
+ declare const FormLabel: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & {
1467
+ required?: boolean;
1468
+ } & React$1.RefAttributes<HTMLLabelElement>>;
1467
1469
  declare const FormControl: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
1468
1470
  declare const FormDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
1469
1471
  declare const FormMessage: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
package/dist/index.d.ts CHANGED
@@ -1463,7 +1463,9 @@ declare const useFormField: () => {
1463
1463
  formMessageId: string;
1464
1464
  };
1465
1465
  declare const FormItem: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
1466
- declare const FormLabel: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & React$1.RefAttributes<HTMLLabelElement>>;
1466
+ declare const FormLabel: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & {
1467
+ required?: boolean;
1468
+ } & React$1.RefAttributes<HTMLLabelElement>>;
1467
1469
  declare const FormControl: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
1468
1470
  declare const FormDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
1469
1471
  declare const FormMessage: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
package/dist/index.js CHANGED
@@ -12107,11 +12107,23 @@ var FormItem = React39.forwardRef(({ className, ...props }, ref) => {
12107
12107
  return /* @__PURE__ */ jsx48(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx48("div", { ref, className: cn("space-y-2", className), ...props }) });
12108
12108
  });
12109
12109
  FormItem.displayName = "FormItem";
12110
- var FormLabel = React39.forwardRef(({ className, ...props }, ref) => {
12110
+ var FormLabel = React39.forwardRef(({ className, children, required, ...props }, ref) => {
12111
12111
  const { error, formItemId } = useFormField();
12112
12112
  const config = React39.useContext(FormConfigContext);
12113
12113
  const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
12114
- return /* @__PURE__ */ jsx48(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props });
12114
+ return /* @__PURE__ */ jsxs42(
12115
+ Label,
12116
+ {
12117
+ ref,
12118
+ className: cn(sizeClass, error && "text-destructive", className),
12119
+ htmlFor: formItemId,
12120
+ ...props,
12121
+ children: [
12122
+ children,
12123
+ required && /* @__PURE__ */ jsx48("span", { className: "text-destructive ml-1", children: "*" })
12124
+ ]
12125
+ }
12126
+ );
12115
12127
  });
12116
12128
  FormLabel.displayName = "FormLabel";
12117
12129
  var FormControl = React39.forwardRef(({ ...props }, ref) => {