@appolabs/ui 0.1.33 → 0.1.34

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.
@@ -5,7 +5,7 @@ import { cva } from 'class-variance-authority';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var labelVariants = cva(
8
- "text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
8
+ "block text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
9
  );
10
10
  var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
11
11
  LabelPrimitive.Root,
@@ -18,5 +18,5 @@ var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
18
18
  Label.displayName = LabelPrimitive.Root.displayName;
19
19
 
20
20
  export { Label };
21
- //# sourceMappingURL=chunk-2GQIQAYX.js.map
22
- //# sourceMappingURL=chunk-2GQIQAYX.js.map
21
+ //# sourceMappingURL=chunk-DBC4TH6J.js.map
22
+ //# sourceMappingURL=chunk-DBC4TH6J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/label.tsx"],"names":[],"mappings":";;;;;;AAMA,IAAM,aAAA,GAAgB,GAAA;AAAA,EAClB;AACJ,CAAA;AAEA,IAAM,KAAA,GAAc,iBAIlB,CAAC,EAAC,WAAW,GAAG,KAAA,IAAQ,GAAA,qBACtB,GAAA;AAAA,EAAgB,cAAA,CAAA,IAAA;AAAA,EAAf;AAAA,IACG,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,aAAA,EAAc,EAAG,SAAS,CAAA;AAAA,IACvC,GAAG;AAAA;AACR,CACH;AACD,KAAA,CAAM,cAA6B,cAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-DBC4TH6J.js","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {cva, type VariantProps} from \"class-variance-authority\"\n\nimport { cn } from '../lib/utils'\n\nconst labelVariants = cva(\n \"block text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({className, ...props}, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport {Label}\n"]}
@@ -28,7 +28,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
28
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
29
29
 
30
30
  var labelVariants = classVarianceAuthority.cva(
31
- "text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
31
+ "block text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
32
32
  );
33
33
  var Label = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
34
34
  LabelPrimitive__namespace.Root,
@@ -41,5 +41,5 @@ var Label = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__
41
41
  Label.displayName = LabelPrimitive__namespace.Root.displayName;
42
42
 
43
43
  exports.Label = Label;
44
- //# sourceMappingURL=chunk-I7S4IZIT.cjs.map
45
- //# sourceMappingURL=chunk-I7S4IZIT.cjs.map
44
+ //# sourceMappingURL=chunk-JFNNKVYO.cjs.map
45
+ //# sourceMappingURL=chunk-JFNNKVYO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/label.tsx"],"names":["cva","React","jsx","LabelPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAM,aAAA,GAAgBA,0BAAA;AAAA,EAClB;AACJ,CAAA;AAEA,IAAM,KAAA,GAAcC,4BAIlB,CAAC,EAAC,WAAW,GAAG,KAAA,IAAQ,GAAA,qBACtBC,cAAA;AAAA,EAAgBC,yBAAA,CAAA,IAAA;AAAA,EAAf;AAAA,IACG,GAAA;AAAA,IACA,SAAA,EAAWC,oBAAA,CAAG,aAAA,EAAc,EAAG,SAAS,CAAA;AAAA,IACvC,GAAG;AAAA;AACR,CACH;AACD,KAAA,CAAM,cAA6BD,yBAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-I7S4IZIT.cjs","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {cva, type VariantProps} from \"class-variance-authority\"\n\nimport { cn } from '../lib/utils'\n\nconst labelVariants = cva(\n \"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({className, ...props}, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport {Label}\n"]}
1
+ {"version":3,"sources":["../src/components/label.tsx"],"names":["cva","React","jsx","LabelPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAM,aAAA,GAAgBA,0BAAA;AAAA,EAClB;AACJ,CAAA;AAEA,IAAM,KAAA,GAAcC,4BAIlB,CAAC,EAAC,WAAW,GAAG,KAAA,IAAQ,GAAA,qBACtBC,cAAA;AAAA,EAAgBC,yBAAA,CAAA,IAAA;AAAA,EAAf;AAAA,IACG,GAAA;AAAA,IACA,SAAA,EAAWC,oBAAA,CAAG,aAAA,EAAc,EAAG,SAAS,CAAA;AAAA,IACvC,GAAG;AAAA;AACR,CACH;AACD,KAAA,CAAM,cAA6BD,yBAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-JFNNKVYO.cjs","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {cva, type VariantProps} from \"class-variance-authority\"\n\nimport { cn } from '../lib/utils'\n\nconst labelVariants = cva(\n \"block text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({className, ...props}, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport {Label}\n"]}
@@ -1,4 +1,4 @@
1
- import { Label } from './chunk-2GQIQAYX.js';
1
+ import { Label } from './chunk-DBC4TH6J.js';
2
2
  import { cn } from './chunk-C6QNNG2X.js';
3
3
  import * as React from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
@@ -100,5 +100,5 @@ var FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
100
100
  FormMessage.displayName = "FormMessage";
101
101
 
102
102
  export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
103
- //# sourceMappingURL=chunk-VYLORU4Q.js.map
104
- //# sourceMappingURL=chunk-VYLORU4Q.js.map
103
+ //# sourceMappingURL=chunk-KDG3NFTV.js.map
104
+ //# sourceMappingURL=chunk-KDG3NFTV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/form.tsx"],"names":[],"mappings":";;;;;;;AAQA,IAAM,IAAA,GAAO;AASb,IAAM,gBAAA,GAAyB,KAAA,CAAA,aAAA;AAAA,EAC3B;AACJ,CAAA;AAEA,IAAM,YAAY,CAGhB;AAAA,EACI,GAAG;AACP,CAAA,KAA4C;AAC1C,EAAA,uBACI,GAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,OAAO,EAAC,IAAA,EAAM,KAAA,CAAM,IAAA,EAAI,EAC/C,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EA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,GACR;AAER,CAAC;AACD,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAE9B,IAAM,WAAA,GAAoB,iBAGxB,CAAC,EAAC,WAAW,QAAA,EAAU,GAAG,KAAA,EAAK,EAAG,GAAA,KAAQ;AACxC,EAAA,MAAM,EAAC,KAAA,EAAO,aAAA,EAAa,GAAI,YAAA,EAAa;AAC5C,EAAA,MAAM,IAAA,GAAO,KAAA,GAAQ,MAAA,CAAO,KAAA,EAAO,OAAO,CAAA,GAAI,QAAA;AAE9C,EAAA,IAAI,CAAC,IAAA,EAAM;AACP,IAAA,OAAO,IAAA;AAAA,EACX;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,EAAA,EAAI,aAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,MAChE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAC;AACD,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-VYLORU4Q.js","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {Slot} from \"@radix-ui/react-slot\"\nimport {Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext,} from \"react-hook-form\"\n\nimport {cn} from \"../lib/utils\"\nimport {Label} from \"./label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{name: props.name}}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const {getFieldState, formState} = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const {id} = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({className, ...props}, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{id}}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n})\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({className, ...props}, ref) => {\n const {error, formItemId} = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({...props}, ref) => {\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, ...props}, ref) => {\n const {formDescriptionId} = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-base text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, children, ...props}, ref) => {\n const {error, formMessageId} = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-base font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"]}
1
+ {"version":3,"sources":["../src/components/form.tsx"],"names":[],"mappings":";;;;;;;AAQA,IAAM,IAAA,GAAO;AASb,IAAM,gBAAA,GAAyB,KAAA,CAAA,aAAA;AAAA,EAC3B;AACJ,CAAA;AAEA,IAAM,YAAY,CAGhB;AAAA,EACI,GAAG;AACP,CAAA,KAA4C;AAC1C,EAAA,uBACI,GAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,OAAO,EAAC,IAAA,EAAM,KAAA,CAAM,IAAA,EAAI,EAC/C,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,OAAO,CAAA,EAC3B,CAAA;AAER;AAEA,IAAM,eAAe,MAAM;AACvB,EAAA,MAAM,YAAA,GAAqB,iBAAW,gBAAgB,CAAA;AACtD,EAAA,MAAM,WAAA,GAAoB,iBAAW,eAAe,CAAA;AACpD,EAAA,MAAM,EAAC,aAAA,EAAe,SAAA,EAAS,GAAI,cAAA,EAAe;AAElD,EAAA,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,CAAa,IAAA,EAAM,SAAS,CAAA;AAE7D,EAAA,IAAI,CAAC,YAAA,EAAc;AACf,IAAA,MAAM,IAAI,MAA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AAAA,EACX;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,EAAA,EAAI,aAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,MAChE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAC;AACD,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-KDG3NFTV.js","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {Slot} from \"@radix-ui/react-slot\"\nimport {Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext,} from \"react-hook-form\"\n\nimport {cn} from \"../lib/utils\"\nimport {Label} from \"./label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{name: props.name}}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const {getFieldState, formState} = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const {id} = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({className, ...props}, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{id}}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n})\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({className, ...props}, ref) => {\n const {error, formItemId} = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({...props}, ref) => {\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, ...props}, ref) => {\n const {formDescriptionId} = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-base text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, children, ...props}, ref) => {\n const {error, formMessageId} = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-base font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkI7S4IZIT_cjs = require('./chunk-I7S4IZIT.cjs');
3
+ var chunkJFNNKVYO_cjs = require('./chunk-JFNNKVYO.cjs');
4
4
  var chunkK3WGYDSA_cjs = require('./chunk-K3WGYDSA.cjs');
5
5
  var React = require('react');
6
6
  var reactSlot = require('@radix-ui/react-slot');
@@ -65,7 +65,7 @@ FormItem.displayName = "FormItem";
65
65
  var FormLabel = React__namespace.forwardRef(({ className, ...props }, ref) => {
66
66
  const { error, formItemId } = useFormField();
67
67
  return /* @__PURE__ */ jsxRuntime.jsx(
68
- chunkI7S4IZIT_cjs.Label,
68
+ chunkJFNNKVYO_cjs.Label,
69
69
  {
70
70
  ref,
71
71
  className: chunkK3WGYDSA_cjs.cn(error && "text-destructive", className),
@@ -129,5 +129,5 @@ exports.FormItem = FormItem;
129
129
  exports.FormLabel = FormLabel;
130
130
  exports.FormMessage = FormMessage;
131
131
  exports.useFormField = useFormField;
132
- //# sourceMappingURL=chunk-AD7OQ67X.cjs.map
133
- //# sourceMappingURL=chunk-AD7OQ67X.cjs.map
132
+ //# sourceMappingURL=chunk-RCR5S647.cjs.map
133
+ //# sourceMappingURL=chunk-RCR5S647.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/form.tsx"],"names":["FormProvider","React","jsx","Controller","useFormContext","cn","Label","Slot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAM,IAAA,GAAOA;AASb,IAAM,gBAAA,GAAyBC,gBAAA,CAAA,aAAA;AAAA,EAC3B;AACJ,CAAA;AAEA,IAAM,YAAY,CAGhB;AAAA,EACI,GAAG;AACP,CAAA,KAA4C;AAC1C,EAAA,uBACIC,cAAA,CAAC,gBAAA,CAAiB,QAAA,EAA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AAA,MACG,GAAA;AAAA,MACA,EAAA,EAAI,iBAAA;AAAA,MACJ,SAAA,EAAWG,oBAAA,CAAG,iCAAA,EAAmC,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACR;AAER,CAAC;AACD,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAE9B,IAAM,WAAA,GAAoBJ,4BAGxB,CAAC,EAAC,WAAW,QAAA,EAAU,GAAG,KAAA,EAAK,EAAG,GAAA,KAAQ;AACxC,EAAA,MAAM,EAAC,KAAA,EAAO,aAAA,EAAa,GAAI,YAAA,EAAa;AAC5C,EAAA,MAAM,IAAA,GAAO,KAAA,GAAQ,MAAA,CAAO,KAAA,EAAO,OAAO,CAAA,GAAI,QAAA;AAE9C,EAAA,IAAI,CAAC,IAAA,EAAM;AACP,IAAA,OAAO,IAAA;AAAA,EACX;AAEA,EAAA,uBACIC,cAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,EAAA,EAAI,aAAA;AAAA,MACJ,SAAA,EAAWG,oBAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,MAChE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAC;AACD,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-AD7OQ67X.cjs","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {Slot} from \"@radix-ui/react-slot\"\nimport {Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext,} from \"react-hook-form\"\n\nimport {cn} from \"../lib/utils\"\nimport {Label} from \"./label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{name: props.name}}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const {getFieldState, formState} = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const {id} = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({className, ...props}, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{id}}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n})\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({className, ...props}, ref) => {\n const {error, formItemId} = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({...props}, ref) => {\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, ...props}, ref) => {\n const {formDescriptionId} = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-base text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, children, ...props}, ref) => {\n const {error, formMessageId} = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-base font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"]}
1
+ {"version":3,"sources":["../src/components/form.tsx"],"names":["FormProvider","React","jsx","Controller","useFormContext","cn","Label","Slot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAM,IAAA,GAAOA;AASb,IAAM,gBAAA,GAAyBC,gBAAA,CAAA,aAAA;AAAA,EAC3B;AACJ,CAAA;AAEA,IAAM,YAAY,CAGhB;AAAA,EACI,GAAG;AACP,CAAA,KAA4C;AAC1C,EAAA,uBACIC,cAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,OAAO,EAAC,IAAA,EAAM,KAAA,CAAM,IAAA,EAAI,EAC/C,QAAA,kBAAAA,cAAA,CAACC,wBAAA,EAAA,EAAY,GAAG,OAAO,CAAA,EAC3B,CAAA;AAER;AAEA,IAAM,eAAe,MAAM;AACvB,EAAA,MAAM,YAAA,GAAqBF,4BAAW,gBAAgB,CAAA;AACtD,EAAA,MAAM,WAAA,GAAoBA,4BAA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AG,KAAA,EAAK,EAAG,GAAA,KAAQ;AACxC,EAAA,MAAM,EAAC,KAAA,EAAO,aAAA,EAAa,GAAI,YAAA,EAAa;AAC5C,EAAA,MAAM,IAAA,GAAO,KAAA,GAAQ,MAAA,CAAO,KAAA,EAAO,OAAO,CAAA,GAAI,QAAA;AAE9C,EAAA,IAAI,CAAC,IAAA,EAAM;AACP,IAAA,OAAO,IAAA;AAAA,EACX;AAEA,EAAA,uBACIC,cAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,EAAA,EAAI,aAAA;AAAA,MACJ,SAAA,EAAWG,oBAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,MAChE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAC;AACD,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-RCR5S647.cjs","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {Slot} from \"@radix-ui/react-slot\"\nimport {Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext,} from \"react-hook-form\"\n\nimport {cn} from \"../lib/utils\"\nimport {Label} from \"./label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{name: props.name}}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const {getFieldState, formState} = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const {id} = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({className, ...props}, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{id}}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n})\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({className, ...props}, ref) => {\n const {error, formItemId} = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({...props}, ref) => {\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, ...props}, ref) => {\n const {formDescriptionId} = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-base text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({className, children, ...props}, ref) => {\n const {error, formMessageId} = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-base font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"]}
package/dist/form.cjs CHANGED
@@ -1,42 +1,42 @@
1
1
  'use strict';
2
2
 
3
- var chunkAD7OQ67X_cjs = require('./chunk-AD7OQ67X.cjs');
4
- require('./chunk-I7S4IZIT.cjs');
3
+ var chunkRCR5S647_cjs = require('./chunk-RCR5S647.cjs');
4
+ require('./chunk-JFNNKVYO.cjs');
5
5
  require('./chunk-K3WGYDSA.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "Form", {
10
10
  enumerable: true,
11
- get: function () { return chunkAD7OQ67X_cjs.Form; }
11
+ get: function () { return chunkRCR5S647_cjs.Form; }
12
12
  });
13
13
  Object.defineProperty(exports, "FormControl", {
14
14
  enumerable: true,
15
- get: function () { return chunkAD7OQ67X_cjs.FormControl; }
15
+ get: function () { return chunkRCR5S647_cjs.FormControl; }
16
16
  });
17
17
  Object.defineProperty(exports, "FormDescription", {
18
18
  enumerable: true,
19
- get: function () { return chunkAD7OQ67X_cjs.FormDescription; }
19
+ get: function () { return chunkRCR5S647_cjs.FormDescription; }
20
20
  });
21
21
  Object.defineProperty(exports, "FormField", {
22
22
  enumerable: true,
23
- get: function () { return chunkAD7OQ67X_cjs.FormField; }
23
+ get: function () { return chunkRCR5S647_cjs.FormField; }
24
24
  });
25
25
  Object.defineProperty(exports, "FormItem", {
26
26
  enumerable: true,
27
- get: function () { return chunkAD7OQ67X_cjs.FormItem; }
27
+ get: function () { return chunkRCR5S647_cjs.FormItem; }
28
28
  });
29
29
  Object.defineProperty(exports, "FormLabel", {
30
30
  enumerable: true,
31
- get: function () { return chunkAD7OQ67X_cjs.FormLabel; }
31
+ get: function () { return chunkRCR5S647_cjs.FormLabel; }
32
32
  });
33
33
  Object.defineProperty(exports, "FormMessage", {
34
34
  enumerable: true,
35
- get: function () { return chunkAD7OQ67X_cjs.FormMessage; }
35
+ get: function () { return chunkRCR5S647_cjs.FormMessage; }
36
36
  });
37
37
  Object.defineProperty(exports, "useFormField", {
38
38
  enumerable: true,
39
- get: function () { return chunkAD7OQ67X_cjs.useFormField; }
39
+ get: function () { return chunkRCR5S647_cjs.useFormField; }
40
40
  });
41
41
  //# sourceMappingURL=form.cjs.map
42
42
  //# sourceMappingURL=form.cjs.map
package/dist/form.js CHANGED
@@ -1,5 +1,5 @@
1
- export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './chunk-VYLORU4Q.js';
2
- import './chunk-2GQIQAYX.js';
1
+ export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './chunk-KDG3NFTV.js';
2
+ import './chunk-DBC4TH6J.js';
3
3
  import './chunk-C6QNNG2X.js';
4
4
  //# sourceMappingURL=form.js.map
5
5
  //# sourceMappingURL=form.js.map
package/dist/index.cjs CHANGED
@@ -30,8 +30,8 @@ var chunk2FWBIU36_cjs = require('./chunk-2FWBIU36.cjs');
30
30
  var chunk3SQHEJFP_cjs = require('./chunk-3SQHEJFP.cjs');
31
31
  var chunkAPCEE7AC_cjs = require('./chunk-APCEE7AC.cjs');
32
32
  var chunk4I42GSNI_cjs = require('./chunk-4I42GSNI.cjs');
33
- var chunkAD7OQ67X_cjs = require('./chunk-AD7OQ67X.cjs');
34
- var chunkI7S4IZIT_cjs = require('./chunk-I7S4IZIT.cjs');
33
+ var chunkRCR5S647_cjs = require('./chunk-RCR5S647.cjs');
34
+ var chunkJFNNKVYO_cjs = require('./chunk-JFNNKVYO.cjs');
35
35
  var chunkNRKNWFX7_cjs = require('./chunk-NRKNWFX7.cjs');
36
36
  var chunkJ7BT4W2Q_cjs = require('./chunk-J7BT4W2Q.cjs');
37
37
  var chunkXRUHTINK_cjs = require('./chunk-XRUHTINK.cjs');
@@ -663,39 +663,39 @@ Object.defineProperty(exports, "EmptyState", {
663
663
  });
664
664
  Object.defineProperty(exports, "Form", {
665
665
  enumerable: true,
666
- get: function () { return chunkAD7OQ67X_cjs.Form; }
666
+ get: function () { return chunkRCR5S647_cjs.Form; }
667
667
  });
668
668
  Object.defineProperty(exports, "FormControl", {
669
669
  enumerable: true,
670
- get: function () { return chunkAD7OQ67X_cjs.FormControl; }
670
+ get: function () { return chunkRCR5S647_cjs.FormControl; }
671
671
  });
672
672
  Object.defineProperty(exports, "FormDescription", {
673
673
  enumerable: true,
674
- get: function () { return chunkAD7OQ67X_cjs.FormDescription; }
674
+ get: function () { return chunkRCR5S647_cjs.FormDescription; }
675
675
  });
676
676
  Object.defineProperty(exports, "FormField", {
677
677
  enumerable: true,
678
- get: function () { return chunkAD7OQ67X_cjs.FormField; }
678
+ get: function () { return chunkRCR5S647_cjs.FormField; }
679
679
  });
680
680
  Object.defineProperty(exports, "FormItem", {
681
681
  enumerable: true,
682
- get: function () { return chunkAD7OQ67X_cjs.FormItem; }
682
+ get: function () { return chunkRCR5S647_cjs.FormItem; }
683
683
  });
684
684
  Object.defineProperty(exports, "FormLabel", {
685
685
  enumerable: true,
686
- get: function () { return chunkAD7OQ67X_cjs.FormLabel; }
686
+ get: function () { return chunkRCR5S647_cjs.FormLabel; }
687
687
  });
688
688
  Object.defineProperty(exports, "FormMessage", {
689
689
  enumerable: true,
690
- get: function () { return chunkAD7OQ67X_cjs.FormMessage; }
690
+ get: function () { return chunkRCR5S647_cjs.FormMessage; }
691
691
  });
692
692
  Object.defineProperty(exports, "useFormField", {
693
693
  enumerable: true,
694
- get: function () { return chunkAD7OQ67X_cjs.useFormField; }
694
+ get: function () { return chunkRCR5S647_cjs.useFormField; }
695
695
  });
696
696
  Object.defineProperty(exports, "Label", {
697
697
  enumerable: true,
698
- get: function () { return chunkI7S4IZIT_cjs.Label; }
698
+ get: function () { return chunkJFNNKVYO_cjs.Label; }
699
699
  });
700
700
  Object.defineProperty(exports, "GlassCard", {
701
701
  enumerable: true,
package/dist/index.js CHANGED
@@ -28,8 +28,8 @@ export { Pagination } from './chunk-TANKSTI6.js';
28
28
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './chunk-VHVVKUFM.js';
29
29
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './chunk-FOTJ6OCK.js';
30
30
  export { EmptyState } from './chunk-THHVTFFE.js';
31
- export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './chunk-VYLORU4Q.js';
32
- export { Label } from './chunk-2GQIQAYX.js';
31
+ export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './chunk-KDG3NFTV.js';
32
+ export { Label } from './chunk-DBC4TH6J.js';
33
33
  export { GlassCard, GlassCardContent, GlassCardDescription, GlassCardFooter, GlassCardHeader, GlassCardTitle, glassCardVariants } from './chunk-NFXFGOJ4.js';
34
34
  export { GlassHeader, glassHeaderVariants } from './chunk-HAOGXPMB.js';
35
35
  export { GlassOverlay, glassOverlayVariants } from './chunk-GINYLBFK.js';
package/dist/label.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkI7S4IZIT_cjs = require('./chunk-I7S4IZIT.cjs');
3
+ var chunkJFNNKVYO_cjs = require('./chunk-JFNNKVYO.cjs');
4
4
  require('./chunk-K3WGYDSA.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Label", {
9
9
  enumerable: true,
10
- get: function () { return chunkI7S4IZIT_cjs.Label; }
10
+ get: function () { return chunkJFNNKVYO_cjs.Label; }
11
11
  });
12
12
  //# sourceMappingURL=label.cjs.map
13
13
  //# sourceMappingURL=label.cjs.map
package/dist/label.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Label } from './chunk-2GQIQAYX.js';
1
+ export { Label } from './chunk-DBC4TH6J.js';
2
2
  import './chunk-C6QNNG2X.js';
3
3
  //# sourceMappingURL=label.js.map
4
4
  //# sourceMappingURL=label.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appolabs/ui",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "React UI component library for Appo Labs",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/label.tsx"],"names":[],"mappings":";;;;;;AAMA,IAAM,aAAA,GAAgB,GAAA;AAAA,EAClB;AACJ,CAAA;AAEA,IAAM,KAAA,GAAc,iBAIlB,CAAC,EAAC,WAAW,GAAG,KAAA,IAAQ,GAAA,qBACtB,GAAA;AAAA,EAAgB,cAAA,CAAA,IAAA;AAAA,EAAf;AAAA,IACG,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,aAAA,EAAc,EAAG,SAAS,CAAA;AAAA,IACvC,GAAG;AAAA;AACR,CACH;AACD,KAAA,CAAM,cAA6B,cAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-2GQIQAYX.js","sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport {cva, type VariantProps} from \"class-variance-authority\"\n\nimport { cn } from '../lib/utils'\n\nconst labelVariants = cva(\n \"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({className, ...props}, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport {Label}\n"]}