@skybin-tech/nebula-ui 0.0.13 → 0.0.15

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.
Files changed (39) hide show
  1. package/dist/cjs/components/Avatar/Avatar.cjs +15 -0
  2. package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -0
  3. package/dist/cjs/components/Badge/Badge.cjs +11 -0
  4. package/dist/cjs/components/Badge/Badge.cjs.map +1 -0
  5. package/dist/cjs/components/Button/Button.cjs +1 -0
  6. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  7. package/dist/cjs/components/Card/Card.cjs +24 -0
  8. package/dist/cjs/components/Card/Card.cjs.map +1 -0
  9. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +56 -0
  10. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -0
  11. package/dist/cjs/components/Form/TextBox.cjs +10 -2
  12. package/dist/cjs/components/Form/TextBox.cjs.map +1 -1
  13. package/dist/cjs/components/Separator/Separator.cjs +9 -0
  14. package/dist/cjs/components/Separator/Separator.cjs.map +1 -0
  15. package/dist/cjs/index.cjs +33 -32
  16. package/dist/cjs/index.cjs.map +1 -1
  17. package/dist/cjs/primitives/{input.cjs → textbox.cjs} +4 -4
  18. package/dist/cjs/primitives/textbox.cjs.map +1 -0
  19. package/dist/components/Avatar/Avatar.js +15 -0
  20. package/dist/components/Avatar/Avatar.js.map +1 -0
  21. package/dist/components/Badge/Badge.js +12 -0
  22. package/dist/components/Badge/Badge.js.map +1 -0
  23. package/dist/components/Button/Button.js +3 -1
  24. package/dist/components/Button/Button.js.map +1 -1
  25. package/dist/components/Card/Card.js +24 -0
  26. package/dist/components/Card/Card.js.map +1 -0
  27. package/dist/components/DropdownMenu/DropdownMenu.js +56 -0
  28. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  29. package/dist/components/Form/TextBox.js +10 -2
  30. package/dist/components/Form/TextBox.js.map +1 -1
  31. package/dist/components/Separator/Separator.js +9 -0
  32. package/dist/components/Separator/Separator.js.map +1 -0
  33. package/dist/index.js +6 -5
  34. package/dist/index.js.map +1 -1
  35. package/dist/primitives/{input.js → textbox.js} +4 -4
  36. package/dist/primitives/textbox.js.map +1 -0
  37. package/package.json +1 -1
  38. package/dist/cjs/primitives/input.cjs.map +0 -1
  39. package/dist/primitives/input.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const avatar = require("../../primitives/avatar.cjs");
6
+ const Avatar = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(avatar.Avatar, { ref, ...props }));
7
+ Avatar.displayName = "Avatar";
8
+ const AvatarImage = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { ref, ...props }));
9
+ AvatarImage.displayName = "AvatarImage";
10
+ const AvatarFallback = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { ref, ...props }));
11
+ AvatarFallback.displayName = "AvatarFallback";
12
+ exports.Avatar = Avatar;
13
+ exports.AvatarFallback = AvatarFallback;
14
+ exports.AvatarImage = AvatarImage;
15
+ //# sourceMappingURL=Avatar.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.cjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport {\n Avatar as AvatarPrimitive,\n AvatarImage as AvatarImagePrimitive,\n AvatarFallback as AvatarFallbackPrimitive,\n} from \"../../primitives/avatar\"\n\nexport const Avatar = forwardRef<\n ElementRef<typeof AvatarPrimitive>,\n ComponentPropsWithoutRef<typeof AvatarPrimitive>\n>((props, ref) => <AvatarPrimitive ref={ref} {...props} />)\nAvatar.displayName = \"Avatar\"\n\nexport const AvatarImage = forwardRef<\n ElementRef<typeof AvatarImagePrimitive>,\n ComponentPropsWithoutRef<typeof AvatarImagePrimitive>\n>((props, ref) => <AvatarImagePrimitive ref={ref} {...props} />)\nAvatarImage.displayName = \"AvatarImage\"\n\nexport const AvatarFallback = forwardRef<\n ElementRef<typeof AvatarFallbackPrimitive>,\n ComponentPropsWithoutRef<typeof AvatarFallbackPrimitive>\n>((props, ref) => <AvatarFallbackPrimitive ref={ref} {...props} />)\nAvatarFallback.displayName = \"AvatarFallback\"\n"],"names":["forwardRef","AvatarPrimitive","AvatarImagePrimitive","AvatarFallbackPrimitive"],"mappings":";;;;;AAQO,MAAM,SAASA,MAAAA,WAGpB,CAAC,OAAO,uCAASC,OAAAA,QAAA,EAAgB,KAAW,GAAG,OAAO,CAAE;AAC1D,OAAO,cAAc;AAEd,MAAM,cAAcD,MAAAA,WAGzB,CAAC,OAAO,uCAASE,OAAAA,aAAA,EAAqB,KAAW,GAAG,OAAO,CAAE;AAC/D,YAAY,cAAc;AAEnB,MAAM,iBAAiBF,MAAAA,WAG5B,CAAC,OAAO,uCAASG,OAAAA,gBAAA,EAAwB,KAAW,GAAG,OAAO,CAAE;AAClE,eAAe,cAAc;;;;"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const badge = require("../../primitives/badge.cjs");
5
+ function Badge(props) {
6
+ return /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { ...props });
7
+ }
8
+ Badge.displayName = "Badge";
9
+ exports.badgeVariants = badge.badgeVariants;
10
+ exports.Badge = Badge;
11
+ //# sourceMappingURL=Badge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.cjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { Badge as BadgePrimitive, badgeVariants } from \"../../primitives/badge\"\nimport type { BadgeProps as BadgePrimitiveProps } from \"../../primitives/badge\"\n\nexport type BadgeProps = BadgePrimitiveProps\n\nexport function Badge(props: BadgeProps) {\n return <BadgePrimitive {...props} />\n}\nBadge.displayName = \"Badge\"\n\nexport { badgeVariants }\n"],"names":["jsx","BadgePrimitive"],"mappings":";;;;AAKO,SAAS,MAAM,OAAmB;AACvC,SAAOA,+BAACC,MAAAA,OAAA,EAAgB,GAAG,MAAA,CAAO;AACpC;AACA,MAAM,cAAc;;;"}
@@ -48,5 +48,6 @@ const Button = React.forwardRef(function Button2({
48
48
  );
49
49
  });
50
50
  Button.displayName = "Button";
51
+ exports.buttonVariants = button.buttonVariants;
51
52
  exports.Button = Button;
52
53
  //# sourceMappingURL=Button.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { ButtonPrimitive, buttonVariants } from \"../../primitives/button\";\n\ntype PrimitiveVariant = NonNullable<VariantProps<typeof buttonVariants>[\"variant\"]>;\ntype PrimitiveSize = NonNullable<VariantProps<typeof buttonVariants>[\"size\"]>;\n\nconst variantMap: Record<string, PrimitiveVariant> = {\n primary: \"default\",\n secondary: \"secondary\",\n outline: \"outline\",\n ghost: \"ghost\",\n danger: \"destructive\",\n};\n\nconst sizeMap: Record<string, PrimitiveSize> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant */\n variant?: keyof typeof variantMap;\n /** Size of the button */\n size?: keyof typeof sizeMap;\n /** Stretch button to full container width */\n fullWidth?: boolean;\n /** Show a loading spinner and disable interaction */\n loading?: boolean;\n /** Render as child element via Slot (e.g. wrap a Link) */\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n disabled,\n className,\n asChild = false,\n style,\n ...props\n },\n ref\n) {\n return (\n <ButtonPrimitive\n ref={ref}\n variant={variantMap[variant]}\n size={sizeMap[size]}\n asChild={asChild}\n disabled={disabled || loading}\n className={cn(fullWidth && \"w-full\", \"relative cursor-pointer\", className)}\n style={style}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"size-4 border-2 border-current border-r-transparent rounded-full animate-spin\" />\n </span>\n )}\n <span className={cn(loading && \"invisible\")}>{children}</span>\n </>\n )}\n </ButtonPrimitive>\n );\n});\n\nButton.displayName = \"Button\";\n"],"names":["forwardRef","Button","jsx","ButtonPrimitive","cn","jsxs","Fragment"],"mappings":";;;;;;;AAQA,MAAM,aAA+C;AAAA,EACnD,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,UAAyC;AAAA,EAC7C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAgBO,MAAM,SAASA,MAAAA,WAA2C,SAASC,QACxE;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SACEC,2BAAAA;AAAAA,IAACC,OAAAA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW,OAAO;AAAA,MAC3B,MAAM,QAAQ,IAAI;AAAA,MAClB;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAWC,GAAAA,GAAG,aAAa,UAAU,2BAA2B,SAAS;AAAA,MACzE;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,UACC,WAEAC,2BAAAA,KAAAC,WAAAA,UAAA,EACG,UAAA;AAAA,QAAA,WACCJ,2BAAAA,IAAC,UAAK,WAAU,qDACd,yCAAC,QAAA,EAAK,WAAU,iFAAgF,EAAA,CAClG;AAAA,uCAED,QAAA,EAAK,WAAWE,GAAAA,GAAG,WAAW,WAAW,GAAI,SAAA,CAAS;AAAA,MAAA,EAAA,CACzD;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAED,OAAO,cAAc;;"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { ButtonPrimitive, buttonVariants } from \"../../primitives/button\"\n\nexport { buttonVariants };\n\ntype PrimitiveVariant = NonNullable<VariantProps<typeof buttonVariants>[\"variant\"]>;\ntype PrimitiveSize = NonNullable<VariantProps<typeof buttonVariants>[\"size\"]>;\n\nconst variantMap: Record<string, PrimitiveVariant> = {\n primary: \"default\",\n secondary: \"secondary\",\n outline: \"outline\",\n ghost: \"ghost\",\n danger: \"destructive\",\n};\n\nconst sizeMap: Record<string, PrimitiveSize> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant */\n variant?: keyof typeof variantMap;\n /** Size of the button */\n size?: keyof typeof sizeMap;\n /** Stretch button to full container width */\n fullWidth?: boolean;\n /** Show a loading spinner and disable interaction */\n loading?: boolean;\n /** Render as child element via Slot (e.g. wrap a Link) */\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n disabled,\n className,\n asChild = false,\n style,\n ...props\n },\n ref\n) {\n return (\n <ButtonPrimitive\n ref={ref}\n variant={variantMap[variant]}\n size={sizeMap[size]}\n asChild={asChild}\n disabled={disabled || loading}\n className={cn(fullWidth && \"w-full\", \"relative cursor-pointer\", className)}\n style={style}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"size-4 border-2 border-current border-r-transparent rounded-full animate-spin\" />\n </span>\n )}\n <span className={cn(loading && \"invisible\")}>{children}</span>\n </>\n )}\n </ButtonPrimitive>\n );\n});\n\nButton.displayName = \"Button\";\n"],"names":["forwardRef","Button","jsx","ButtonPrimitive","cn","jsxs","Fragment"],"mappings":";;;;;;;AAUA,MAAM,aAA+C;AAAA,EACnD,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,UAAyC;AAAA,EAC7C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAgBO,MAAM,SAASA,MAAAA,WAA2C,SAASC,QACxE;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SACEC,2BAAAA;AAAAA,IAACC,OAAAA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW,OAAO;AAAA,MAC3B,MAAM,QAAQ,IAAI;AAAA,MAClB;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAWC,GAAAA,GAAG,aAAa,UAAU,2BAA2B,SAAS;AAAA,MACzE;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,UACC,WAEAC,2BAAAA,KAAAC,WAAAA,UAAA,EACG,UAAA;AAAA,QAAA,WACCJ,2BAAAA,IAAC,UAAK,WAAU,qDACd,yCAAC,QAAA,EAAK,WAAU,iFAAgF,EAAA,CAClG;AAAA,uCAED,QAAA,EAAK,WAAWE,GAAAA,GAAG,WAAW,WAAW,GAAI,SAAA,CAAS;AAAA,MAAA,EAAA,CACzD;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAED,OAAO,cAAc;;;"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const card = require("../../primitives/card.cjs");
6
+ const Card = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.Card, { ref, ...props }));
7
+ Card.displayName = "Card";
8
+ const CardHeader = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.CardHeader, { ref, ...props }));
9
+ CardHeader.displayName = "CardHeader";
10
+ const CardTitle = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.CardTitle, { ref, ...props }));
11
+ CardTitle.displayName = "CardTitle";
12
+ const CardDescription = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.CardDescription, { ref, ...props }));
13
+ CardDescription.displayName = "CardDescription";
14
+ const CardContent = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.CardContent, { ref, ...props }));
15
+ CardContent.displayName = "CardContent";
16
+ const CardFooter = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { ref, ...props }));
17
+ CardFooter.displayName = "CardFooter";
18
+ exports.Card = Card;
19
+ exports.CardContent = CardContent;
20
+ exports.CardDescription = CardDescription;
21
+ exports.CardFooter = CardFooter;
22
+ exports.CardHeader = CardHeader;
23
+ exports.CardTitle = CardTitle;
24
+ //# sourceMappingURL=Card.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.cjs","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport {\n Card as CardPrimitive,\n CardHeader as CardHeaderPrimitive,\n CardTitle as CardTitlePrimitive,\n CardDescription as CardDescriptionPrimitive,\n CardContent as CardContentPrimitive,\n CardFooter as CardFooterPrimitive,\n} from \"../../primitives/card\"\n\nexport const Card = forwardRef<\n ElementRef<typeof CardPrimitive>,\n ComponentPropsWithoutRef<typeof CardPrimitive>\n>((props, ref) => <CardPrimitive ref={ref} {...props} />)\nCard.displayName = \"Card\"\n\nexport const CardHeader = forwardRef<\n ElementRef<typeof CardHeaderPrimitive>,\n ComponentPropsWithoutRef<typeof CardHeaderPrimitive>\n>((props, ref) => <CardHeaderPrimitive ref={ref} {...props} />)\nCardHeader.displayName = \"CardHeader\"\n\nexport const CardTitle = forwardRef<\n ElementRef<typeof CardTitlePrimitive>,\n ComponentPropsWithoutRef<typeof CardTitlePrimitive>\n>((props, ref) => <CardTitlePrimitive ref={ref} {...props} />)\nCardTitle.displayName = \"CardTitle\"\n\nexport const CardDescription = forwardRef<\n ElementRef<typeof CardDescriptionPrimitive>,\n ComponentPropsWithoutRef<typeof CardDescriptionPrimitive>\n>((props, ref) => <CardDescriptionPrimitive ref={ref} {...props} />)\nCardDescription.displayName = \"CardDescription\"\n\nexport const CardContent = forwardRef<\n ElementRef<typeof CardContentPrimitive>,\n ComponentPropsWithoutRef<typeof CardContentPrimitive>\n>((props, ref) => <CardContentPrimitive ref={ref} {...props} />)\nCardContent.displayName = \"CardContent\"\n\nexport const CardFooter = forwardRef<\n ElementRef<typeof CardFooterPrimitive>,\n ComponentPropsWithoutRef<typeof CardFooterPrimitive>\n>((props, ref) => <CardFooterPrimitive ref={ref} {...props} />)\nCardFooter.displayName = \"CardFooter\"\n"],"names":["forwardRef","CardPrimitive","CardHeaderPrimitive","CardTitlePrimitive","CardDescriptionPrimitive","CardContentPrimitive","CardFooterPrimitive"],"mappings":";;;;;AAWO,MAAM,OAAOA,MAAAA,WAGlB,CAAC,OAAO,uCAASC,KAAAA,MAAA,EAAc,KAAW,GAAG,OAAO,CAAE;AACxD,KAAK,cAAc;AAEZ,MAAM,aAAaD,MAAAA,WAGxB,CAAC,OAAO,uCAASE,KAAAA,YAAA,EAAoB,KAAW,GAAG,OAAO,CAAE;AAC9D,WAAW,cAAc;AAElB,MAAM,YAAYF,MAAAA,WAGvB,CAAC,OAAO,uCAASG,KAAAA,WAAA,EAAmB,KAAW,GAAG,OAAO,CAAE;AAC7D,UAAU,cAAc;AAEjB,MAAM,kBAAkBH,MAAAA,WAG7B,CAAC,OAAO,uCAASI,KAAAA,iBAAA,EAAyB,KAAW,GAAG,OAAO,CAAE;AACnE,gBAAgB,cAAc;AAEvB,MAAM,cAAcJ,MAAAA,WAGzB,CAAC,OAAO,uCAASK,KAAAA,aAAA,EAAqB,KAAW,GAAG,OAAO,CAAE;AAC/D,YAAY,cAAc;AAEnB,MAAM,aAAaL,MAAAA,WAGxB,CAAC,OAAO,uCAASM,KAAAA,YAAA,EAAoB,KAAW,GAAG,OAAO,CAAE;AAC9D,WAAW,cAAc;;;;;;;"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const dropdownMenu = require("../../primitives/dropdown-menu.cjs");
6
+ function DropdownMenu(props) {
7
+ return /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenu, { ...props });
8
+ }
9
+ function DropdownMenuPortal(props) {
10
+ return /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuPortal, { ...props });
11
+ }
12
+ function DropdownMenuSub(props) {
13
+ return /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSub, { ...props });
14
+ }
15
+ const DropdownMenuTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { ref, ...props }));
16
+ DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
17
+ const DropdownMenuGroup = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuGroup, { ref, ...props }));
18
+ DropdownMenuGroup.displayName = "DropdownMenuGroup";
19
+ const DropdownMenuRadioGroup = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuRadioGroup, { ref, ...props }));
20
+ DropdownMenuRadioGroup.displayName = "DropdownMenuRadioGroup";
21
+ const DropdownMenuContent = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuContent, { ref, ...props }));
22
+ DropdownMenuContent.displayName = "DropdownMenuContent";
23
+ const DropdownMenuSubContent = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSubContent, { ref, ...props }));
24
+ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
25
+ const DropdownMenuSubTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSubTrigger, { ref, ...props }));
26
+ DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
27
+ const DropdownMenuItem = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { ref, ...props }));
28
+ DropdownMenuItem.displayName = "DropdownMenuItem";
29
+ const DropdownMenuCheckboxItem = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuCheckboxItem, { ref, ...props }));
30
+ DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
31
+ const DropdownMenuRadioItem = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuRadioItem, { ref, ...props }));
32
+ DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
33
+ const DropdownMenuLabel = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuLabel, { ref, ...props }));
34
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
35
+ const DropdownMenuSeparator = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSeparator, { ref, ...props }));
36
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
37
+ function DropdownMenuShortcut(props) {
38
+ return /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuShortcut, { ...props });
39
+ }
40
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
41
+ exports.DropdownMenu = DropdownMenu;
42
+ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
43
+ exports.DropdownMenuContent = DropdownMenuContent;
44
+ exports.DropdownMenuGroup = DropdownMenuGroup;
45
+ exports.DropdownMenuItem = DropdownMenuItem;
46
+ exports.DropdownMenuLabel = DropdownMenuLabel;
47
+ exports.DropdownMenuPortal = DropdownMenuPortal;
48
+ exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
49
+ exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
50
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
51
+ exports.DropdownMenuShortcut = DropdownMenuShortcut;
52
+ exports.DropdownMenuSub = DropdownMenuSub;
53
+ exports.DropdownMenuSubContent = DropdownMenuSubContent;
54
+ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
55
+ exports.DropdownMenuTrigger = DropdownMenuTrigger;
56
+ //# sourceMappingURL=DropdownMenu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenu.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef, HTMLAttributes } from \"react\"\nimport {\n DropdownMenu as DropdownMenuPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuGroup as DropdownMenuGroupPrimitive,\n DropdownMenuPortal as DropdownMenuPortalPrimitive,\n DropdownMenuSub as DropdownMenuSubPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuRadioGroup as DropdownMenuRadioGroupPrimitive,\n} from \"../../primitives/dropdown-menu\"\n\n// Root / context-only components (no DOM element to ref)\nexport function DropdownMenu(props: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive>) {\n return <DropdownMenuPrimitive {...props} />\n}\n\nexport function DropdownMenuPortal(props: ComponentPropsWithoutRef<typeof DropdownMenuPortalPrimitive>) {\n return <DropdownMenuPortalPrimitive {...props} />\n}\n\nexport function DropdownMenuSub(props: ComponentPropsWithoutRef<typeof DropdownMenuSubPrimitive>) {\n return <DropdownMenuSubPrimitive {...props} />\n}\n\n// DOM-rendering components (forwardRef)\nexport const DropdownMenuTrigger = forwardRef<\n ElementRef<typeof DropdownMenuTriggerPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuTriggerPrimitive>\n>((props, ref) => <DropdownMenuTriggerPrimitive ref={ref} {...props} />)\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\"\n\nexport const DropdownMenuGroup = forwardRef<\n ElementRef<typeof DropdownMenuGroupPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuGroupPrimitive>\n>((props, ref) => <DropdownMenuGroupPrimitive ref={ref} {...props} />)\nDropdownMenuGroup.displayName = \"DropdownMenuGroup\"\n\nexport const DropdownMenuRadioGroup = forwardRef<\n ElementRef<typeof DropdownMenuRadioGroupPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuRadioGroupPrimitive>\n>((props, ref) => <DropdownMenuRadioGroupPrimitive ref={ref} {...props} />)\nDropdownMenuRadioGroup.displayName = \"DropdownMenuRadioGroup\"\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuContentPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuContentPrimitive>\n>((props, ref) => <DropdownMenuContentPrimitive ref={ref} {...props} />)\nDropdownMenuContent.displayName = \"DropdownMenuContent\"\n\nexport const DropdownMenuSubContent = forwardRef<\n ElementRef<typeof DropdownMenuSubContentPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSubContentPrimitive>\n>((props, ref) => <DropdownMenuSubContentPrimitive ref={ref} {...props} />)\nDropdownMenuSubContent.displayName = \"DropdownMenuSubContent\"\n\nexport const DropdownMenuSubTrigger = forwardRef<\n ElementRef<typeof DropdownMenuSubTriggerPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSubTriggerPrimitive>\n>((props, ref) => <DropdownMenuSubTriggerPrimitive ref={ref} {...props} />)\nDropdownMenuSubTrigger.displayName = \"DropdownMenuSubTrigger\"\n\nexport const DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuItemPrimitive>\n>((props, ref) => <DropdownMenuItemPrimitive ref={ref} {...props} />)\nDropdownMenuItem.displayName = \"DropdownMenuItem\"\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n ElementRef<typeof DropdownMenuCheckboxItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuCheckboxItemPrimitive>\n>((props, ref) => <DropdownMenuCheckboxItemPrimitive ref={ref} {...props} />)\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\"\n\nexport const DropdownMenuRadioItem = forwardRef<\n ElementRef<typeof DropdownMenuRadioItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuRadioItemPrimitive>\n>((props, ref) => <DropdownMenuRadioItemPrimitive ref={ref} {...props} />)\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\"\n\nexport const DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuLabelPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuLabelPrimitive>\n>((props, ref) => <DropdownMenuLabelPrimitive ref={ref} {...props} />)\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\"\n\nexport const DropdownMenuSeparator = forwardRef<\n ElementRef<typeof DropdownMenuSeparatorPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSeparatorPrimitive>\n>((props, ref) => <DropdownMenuSeparatorPrimitive ref={ref} {...props} />)\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\"\n\n// Utility span — no ref needed\nexport function DropdownMenuShortcut(props: HTMLAttributes<HTMLSpanElement>) {\n return <DropdownMenuShortcutPrimitive {...props} />\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n"],"names":["jsx","DropdownMenuPrimitive","DropdownMenuPortalPrimitive","DropdownMenuSubPrimitive","forwardRef","DropdownMenuTriggerPrimitive","DropdownMenuGroupPrimitive","DropdownMenuRadioGroupPrimitive","DropdownMenuContentPrimitive","DropdownMenuSubContentPrimitive","DropdownMenuSubTriggerPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"mappings":";;;;;AAqBO,SAAS,aAAa,OAA+D;AAC1F,SAAOA,+BAACC,aAAAA,cAAA,EAAuB,GAAG,MAAA,CAAO;AAC3C;AAEO,SAAS,mBAAmB,OAAqE;AACtG,SAAOD,+BAACE,aAAAA,oBAAA,EAA6B,GAAG,MAAA,CAAO;AACjD;AAEO,SAAS,gBAAgB,OAAkE;AAChG,SAAOF,+BAACG,aAAAA,iBAAA,EAA0B,GAAG,MAAA,CAAO;AAC9C;AAGO,MAAM,sBAAsBC,MAAAA,WAGjC,CAAC,OAAO,uCAASC,aAAAA,qBAAA,EAA6B,KAAW,GAAG,OAAO,CAAE;AACvE,o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sBAAsB,cAAc;AAG7B,SAAS,qBAAqB,OAAwC;AAC3E,SAAOf,+BAACgB,aAAAA,sBAAA,EAA+B,GAAG,MAAA,CAAO;AACnD;AACA,qBAAqB,cAAc;;;;;;;;;;;;;;;;"}
@@ -7,7 +7,7 @@ const classVarianceAuthority = require("class-variance-authority");
7
7
  const cn = require("../../utils/cn.cjs");
8
8
  const context = require("./context.cjs");
9
9
  const variants = require("./variants.cjs");
10
- const input = require("../../primitives/input.cjs");
10
+ const textbox = require("../../primitives/textbox.cjs");
11
11
  const label = require("../../primitives/label.cjs");
12
12
  const lucideReact = require("lucide-react");
13
13
  const textBoxVariants = classVarianceAuthority.cva(
@@ -84,6 +84,14 @@ function TextBoxInner({
84
84
  let fieldType = "string";
85
85
  if (inputType === "number") {
86
86
  fieldType = "number";
87
+ } else if (inputType === "date") {
88
+ fieldType = "date";
89
+ } else if (inputType === "email" && rules.email === void 0) {
90
+ rules.email = true;
91
+ } else if (inputType === "url" && rules.url === void 0) {
92
+ rules.url = true;
93
+ } else if (inputType === "tel" && rules.pattern === void 0) {
94
+ rules.pattern = { value: /^\+?[\d\s\-().]{7,}$/, message: "Invalid phone number" };
87
95
  }
88
96
  registerFieldValidation({
89
97
  name,
@@ -138,7 +146,7 @@ function TextBoxInner({
138
146
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
139
147
  prefix && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
140
148
  /* @__PURE__ */ jsxRuntime.jsx(
141
- input.Input,
149
+ textbox.TextBoxPrimitive,
142
150
  {
143
151
  ...props,
144
152
  ...field,
@@ -1 +1 @@
1
- {"version":3,"file":"TextBox.cjs","sources":["../../../../src/components/Form/TextBox.tsx"],"sourcesContent":["import { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { labelVariants } from \"./variants\";\nimport { Input } from \"../../primitives/input\";\nimport { Label } from \"../../primitives/label\";\nimport { X } from \"lucide-react\";\n\nconst textBoxVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-8 text-xs px-2\",\n md: \"h-10 text-sm px-3\",\n lg: \"h-12 text-base px-4\",\n },\n variant: {\n default: \"border-input focus-visible:ring-ring\",\n error: \"border-destructive focus-visible:ring-destructive\",\n success: \"border-green-500 focus-visible:ring-green-500\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n }\n);\n\n/**\n * Validation rule with optional custom message\n */\ntype ValidationRule<T> = T | { value: T; message: string };\n\nexport interface TextBoxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"name\" | \"prefix\" | \"pattern\" | \"required\" | \"minLength\" | \"maxLength\">,\n VariantProps<typeof textBoxVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the input */\n label?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** Whether the input should take full width */\n fullWidth?: boolean;\n /** Prefix element */\n prefix?: ReactNode;\n /** Suffix element */\n suffix?: ReactNode;\n /** Allow clear button */\n allowClear?: boolean;\n /** Callback when clear is clicked */\n onClear?: () => void;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n \n // Validation props\n /** Field is required */\n required?: boolean | string;\n /** Minimum length for strings */\n minLength?: ValidationRule<number>;\n /** Maximum length for strings */\n maxLength?: ValidationRule<number>;\n /** Minimum value for numbers */\n minValue?: ValidationRule<number>;\n /** Maximum value for numbers */\n maxValue?: ValidationRule<number>;\n /** Regex pattern for validation */\n pattern?: ValidationRule<RegExp>;\n /** Email validation */\n email?: boolean | string;\n /** URL validation */\n url?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * TextBox component with form integration and automatic validation registration\n * \n * This is a wrapper around the shadcn/ui Input primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * - Prefix/suffix elements\n * - Clear button functionality\n * \n * @example\n * ```tsx\n * // Inside a Form component - validation is automatically registered\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\n * <TextBox name=\"website\" label=\"Website\" url />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nfunction TextBoxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n fullWidth = true,\n className,\n disabled,\n prefix,\n suffix,\n allowClear,\n onClear,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n ...props\n }: TextBoxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<HTMLInputElement>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n\n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Destructure stable function references so the effect doesn't depend on the\n // context object identity (which changes every render due to inline construction).\n const registerFieldValidation = formConfigContext?.registerFieldValidation;\n const unregisterFieldValidation = formConfigContext?.unregisterFieldValidation;\n\n // Register validation rules with the form\n useEffect(() => {\n if (registerFieldValidation) {\n const rules: FieldValidationRules = {};\n\n if (required !== undefined) rules.required = required;\n if (minLength !== undefined) rules.minLength = minLength;\n if (maxLength !== undefined) rules.maxLength = maxLength;\n if (minValue !== undefined) rules.min = minValue;\n if (maxValue !== undefined) rules.max = maxValue;\n if (pattern !== undefined) rules.pattern = pattern;\n if (email !== undefined) rules.email = email;\n if (url !== undefined) rules.url = url;\n if (validate !== undefined) rules.validate = validate;\n\n // Determine field type based on input type\n const inputType = props.type ?? \"text\";\n let fieldType: \"string\" | \"number\" = \"string\";\n if (inputType === \"number\") {\n fieldType = \"number\";\n }\n\n registerFieldValidation({\n name: name as string,\n type: fieldType,\n rules,\n });\n\n return () => {\n unregisterFieldValidation?.(name as string);\n };\n }\n }, [\n registerFieldValidation,\n unregisterFieldValidation,\n name,\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n props.type,\n ]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n const handleClear = () => {\n field.onChange(\"\");\n onClear?.();\n };\n\n return (\n <div className={cn(\"space-y-1.5\", fullWidth && \"w-full\")}>\n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required })}\n >\n {label}\n {formConfig.colon && \":\"}\n </Label>\n )}\n \n <div className=\"relative\">\n {prefix && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {prefix}\n </div>\n )}\n \n <Input\n {...props}\n {...field}\n ref={(node) => {\n // Handle both refs\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n field.ref(node);\n }}\n id={inputId}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n textBoxVariants({ size: effectiveSize, variant: effectiveVariant }),\n prefix && \"pl-10\",\n (suffix || allowClear) && \"pr-10\",\n className\n )}\n />\n \n {(suffix || (allowClear && field.value)) && (\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1\">\n {allowClear && field.value && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n tabIndex={-1}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n {suffix && (\n <span className=\"text-muted-foreground\">{suffix}</span>\n )}\n </div>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const TextBox = forwardRef(TextBoxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: TextBoxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<HTMLInputElement> }\n) => React.ReactElement;\n\n(TextBox as React.FC).displayName = \"TextBox\";\n"],"names":["cva","label","useId","useContext","FormConfigContext","useRHFFormContext","useEffect","useController","cn","jsxs","Label","labelVariants","jsx","Input","X","forwardRef"],"mappings":";;;;;;;;;;;;AAWA,MAAM,kBAAkBA,uBAAAA;AAAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAA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AA,WAAW,YAAY;AAO7C,QAAqB,cAAc;;"}
1
+ {"version":3,"file":"TextBox.cjs","sources":["../../../../src/components/Form/TextBox.tsx"],"sourcesContent":["import { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { labelVariants } from \"./variants\";\nimport { TextBoxPrimitive } from \"../../primitives/textbox\";\nimport { Label } from \"../../primitives/label\";\nimport { X } from \"lucide-react\";\n\nconst textBoxVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-8 text-xs px-2\",\n md: \"h-10 text-sm px-3\",\n lg: \"h-12 text-base px-4\",\n },\n variant: {\n default: \"border-input focus-visible:ring-ring\",\n error: \"border-destructive focus-visible:ring-destructive\",\n success: \"border-green-500 focus-visible:ring-green-500\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n }\n);\n\n/**\n * Validation rule with optional custom message\n */\ntype ValidationRule<T> = T | { value: T; message: string };\n\nexport interface TextBoxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"name\" | \"prefix\" | \"pattern\" | \"required\" | \"minLength\" | \"maxLength\">,\n VariantProps<typeof textBoxVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the input */\n label?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** Whether the input should take full width */\n fullWidth?: boolean;\n /** Prefix element */\n prefix?: ReactNode;\n /** Suffix element */\n suffix?: ReactNode;\n /** Allow clear button */\n allowClear?: boolean;\n /** Callback when clear is clicked */\n onClear?: () => void;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n \n // Validation props\n /** Field is required */\n required?: boolean | string;\n /** Minimum length for strings */\n minLength?: ValidationRule<number>;\n /** Maximum length for strings */\n maxLength?: ValidationRule<number>;\n /** Minimum value for numbers */\n minValue?: ValidationRule<number>;\n /** Maximum value for numbers */\n maxValue?: ValidationRule<number>;\n /** Regex pattern for validation */\n pattern?: ValidationRule<RegExp>;\n /** Email validation */\n email?: boolean | string;\n /** URL validation */\n url?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * TextBox component with form integration and automatic validation registration\n * \n * This is a wrapper around the shadcn/ui Input primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * - Prefix/suffix elements\n * - Clear button functionality\n * \n * @example\n * ```tsx\n * // Inside a Form component - validation is automatically registered\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\n * <TextBox name=\"website\" label=\"Website\" url />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nfunction TextBoxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n fullWidth = true,\n className,\n disabled,\n prefix,\n suffix,\n allowClear,\n onClear,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n ...props\n }: TextBoxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<HTMLInputElement>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n\n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Destructure stable function references so the effect doesn't depend on the\n // context object identity (which changes every render due to inline construction).\n const registerFieldValidation = formConfigContext?.registerFieldValidation;\n const unregisterFieldValidation = formConfigContext?.unregisterFieldValidation;\n\n // Register validation rules with the form\n useEffect(() => {\n if (registerFieldValidation) {\n const rules: FieldValidationRules = {};\n\n if (required !== undefined) rules.required = required;\n if (minLength !== undefined) rules.minLength = minLength;\n if (maxLength !== undefined) rules.maxLength = maxLength;\n if (minValue !== undefined) rules.min = minValue;\n if (maxValue !== undefined) rules.max = maxValue;\n if (pattern !== undefined) rules.pattern = pattern;\n if (email !== undefined) rules.email = email;\n if (url !== undefined) rules.url = url;\n if (validate !== undefined) rules.validate = validate;\n\n // Determine field type and auto-infer rules from input type\n const inputType = props.type ?? \"text\";\n let fieldType: \"string\" | \"number\" | \"date\" = \"string\";\n\n if (inputType === \"number\") {\n fieldType = \"number\";\n } else if (inputType === \"date\") {\n fieldType = \"date\";\n } else if (inputType === \"email\" && rules.email === undefined) {\n rules.email = true;\n } else if (inputType === \"url\" && rules.url === undefined) {\n rules.url = true;\n } else if (inputType === \"tel\" && rules.pattern === undefined) {\n rules.pattern = { value: /^\\+?[\\d\\s\\-().]{7,}$/, message: \"Invalid phone number\" };\n }\n\n registerFieldValidation({\n name: name as string,\n type: fieldType,\n rules,\n });\n\n return () => {\n unregisterFieldValidation?.(name as string);\n };\n }\n }, [\n registerFieldValidation,\n unregisterFieldValidation,\n name,\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n props.type,\n ]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n const handleClear = () => {\n field.onChange(\"\");\n onClear?.();\n };\n\n return (\n <div className={cn(\"space-y-1.5\", fullWidth && \"w-full\")}>\n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required })}\n >\n {label}\n {formConfig.colon && \":\"}\n </Label>\n )}\n \n <div className=\"relative\">\n {prefix && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {prefix}\n </div>\n )}\n \n <TextBoxPrimitive\n {...props}\n {...field}\n ref={(node) => {\n // Handle both refs\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n field.ref(node);\n }}\n id={inputId}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n textBoxVariants({ size: effectiveSize, variant: effectiveVariant }),\n prefix && \"pl-10\",\n (suffix || allowClear) && \"pr-10\",\n className\n )}\n />\n\n {(suffix || (allowClear && field.value)) && (\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1\">\n {allowClear && field.value && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n tabIndex={-1}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n {suffix && (\n <span className=\"text-muted-foreground\">{suffix}</span>\n )}\n </div>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const TextBox = forwardRef(TextBoxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: TextBoxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<HTMLInputElement> }\n) => React.ReactElement;\n\n(TextBox as React.FC).displayName = \"TextBox\";\n"],"names":["cva","label","useId","useContext","FormConfigContext","useRHFFormContext","useEffect","useController","cn","jsxs","Label","labelVariants","jsx","TextBoxPrimitive","X","forwardRef"],"mappings":";;;;;;;;;;;;AAWA,MAAM,kBAAkBA,uBAAAA;AAAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AA6EA,SAAS,aAIP;AAAA,EACE;AAAA,EAAA,OACAC;AAAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI;AAAA,EACJ,SAAS;AAAA;AAAA,EAET;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,cAAcC,MAAAA,MAAA;AACpB,QAAM,UAAU,cAAc;AAG9B,QAAM,oBAAoBC,MAAAA,WAAWC,yBAAiB;AACtD,QAAM,aAAyB,qBAAqB,CAAA;AAGpD,QAAM,aAAaC,cAAAA,eAAA;AACnB,QAAM,UAAU,mBAAmB,YAAY;AAI/C,QAAM,0BAA0B,mBAAmB;AACnD,QAAM,4BAA4B,m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MAAM,UAC/BC,gCAAC,OAAA,EAAI,WAAU,qEACZ,UAAA;AAAA,QAAA,cAAc,MAAM,SACnBG,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAU;AAAA,YACV,UAAU;AAAA,YAEV,UAAAA,2BAAAA,IAACE,YAAAA,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAG1B,UACCF,2BAAAA,IAAC,QAAA,EAAK,WAAU,yBAAyB,UAAA,OAAA,CAAO;AAAA,MAAA,EAAA,CAEpD;AAAA,IAAA,GAEJ;AAAA,IAEC,aAAa,YACZA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QACV,MAAK;AAAA,QAEJ,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJ,cAAc,CAAC,YACdA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QAET,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;AAGO,MAAM,UAAUG,MAAAA,WAAW,YAAY;AAO7C,QAAqB,cAAc;;"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const separator = require("../../primitives/separator.cjs");
6
+ const Separator = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(separator.Separator, { ref, ...props }));
7
+ Separator.displayName = "Separator";
8
+ exports.Separator = Separator;
9
+ //# sourceMappingURL=Separator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.cjs","sources":["../../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport { Separator as SeparatorPrimitive } from \"../../primitives/separator\"\n\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive>\n>((props, ref) => <SeparatorPrimitive ref={ref} {...props} />)\nSeparator.displayName = \"Separator\"\n"],"names":["forwardRef","SeparatorPrimitive"],"mappings":";;;;;AAIO,MAAM,YAAYA,MAAAA,WAGvB,CAAC,OAAO,uCAASC,UAAAA,WAAA,EAAmB,KAAW,GAAG,OAAO,CAAE;AAC7D,UAAU,cAAc;;"}
@@ -3,53 +3,53 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const useToggle = require("./hooks/useToggle.cjs");
4
4
  const useDebounce = require("./hooks/useDebounce.cjs");
5
5
  const cn = require("./utils/cn.cjs");
6
- const avatar = require("./primitives/avatar.cjs");
7
- const badge = require("./primitives/badge.cjs");
6
+ const Avatar = require("./components/Avatar/Avatar.cjs");
7
+ const Badge = require("./components/Badge/Badge.cjs");
8
8
  const Button = require("./components/Button/Button.cjs");
9
- const card = require("./primitives/card.cjs");
9
+ const Card = require("./components/Card/Card.cjs");
10
10
  const Checkbox = require("./components/Form/Checkbox.cjs");
11
- const dropdownMenu = require("./primitives/dropdown-menu.cjs");
11
+ const DropdownMenu = require("./components/DropdownMenu/DropdownMenu.cjs");
12
12
  const Form = require("./components/Form/Form.cjs");
13
13
  const context = require("./components/Form/context.cjs");
14
14
  const Radio = require("./components/Form/Radio.cjs");
15
15
  const Select = require("./components/Form/Select.cjs");
16
- const separator = require("./primitives/separator.cjs");
16
+ const Separator = require("./components/Separator/Separator.cjs");
17
17
  const Switch = require("./components/Form/Switch.cjs");
18
18
  const TextArea = require("./components/Form/TextArea.cjs");
19
19
  const TextBox = require("./components/Form/TextBox.cjs");
20
+ const badge = require("./primitives/badge.cjs");
20
21
  const button = require("./primitives/button.cjs");
21
22
  const hooks = require("./components/Form/hooks.cjs");
22
23
  exports.useToggle = useToggle.useToggle;
23
24
  exports.useDebounce = useDebounce.useDebounce;
24
25
  exports.cn = cn.cn;
25
- exports.Avatar = avatar.Avatar;
26
- exports.AvatarFallback = avatar.AvatarFallback;
27
- exports.AvatarImage = avatar.AvatarImage;
28
- exports.Badge = badge.Badge;
29
- exports.badgeVariants = badge.badgeVariants;
26
+ exports.Avatar = Avatar.Avatar;
27
+ exports.AvatarFallback = Avatar.AvatarFallback;
28
+ exports.AvatarImage = Avatar.AvatarImage;
29
+ exports.Badge = Badge.Badge;
30
30
  exports.Button = Button.Button;
31
- exports.Card = card.Card;
32
- exports.CardContent = card.CardContent;
33
- exports.CardDescription = card.CardDescription;
34
- exports.CardFooter = card.CardFooter;
35
- exports.CardHeader = card.CardHeader;
36
- exports.CardTitle = card.CardTitle;
31
+ exports.Card = Card.Card;
32
+ exports.CardContent = Card.CardContent;
33
+ exports.CardDescription = Card.CardDescription;
34
+ exports.CardFooter = Card.CardFooter;
35
+ exports.CardHeader = Card.CardHeader;
36
+ exports.CardTitle = Card.CardTitle;
37
37
  exports.Checkbox = Checkbox.Checkbox;
38
- exports.DropdownMenu = dropdownMenu.DropdownMenu;
39
- exports.DropdownMenuCheckboxItem = dropdownMenu.DropdownMenuCheckboxItem;
40
- exports.DropdownMenuContent = dropdownMenu.DropdownMenuContent;
41
- exports.DropdownMenuGroup = dropdownMenu.DropdownMenuGroup;
42
- exports.DropdownMenuItem = dropdownMenu.DropdownMenuItem;
43
- exports.DropdownMenuLabel = dropdownMenu.DropdownMenuLabel;
44
- exports.DropdownMenuPortal = dropdownMenu.DropdownMenuPortal;
45
- exports.DropdownMenuRadioGroup = dropdownMenu.DropdownMenuRadioGroup;
46
- exports.DropdownMenuRadioItem = dropdownMenu.DropdownMenuRadioItem;
47
- exports.DropdownMenuSeparator = dropdownMenu.DropdownMenuSeparator;
48
- exports.DropdownMenuShortcut = dropdownMenu.DropdownMenuShortcut;
49
- exports.DropdownMenuSub = dropdownMenu.DropdownMenuSub;
50
- exports.DropdownMenuSubContent = dropdownMenu.DropdownMenuSubContent;
51
- exports.DropdownMenuSubTrigger = dropdownMenu.DropdownMenuSubTrigger;
52
- exports.DropdownMenuTrigger = dropdownMenu.DropdownMenuTrigger;
38
+ exports.DropdownMenu = DropdownMenu.DropdownMenu;
39
+ exports.DropdownMenuCheckboxItem = DropdownMenu.DropdownMenuCheckboxItem;
40
+ exports.DropdownMenuContent = DropdownMenu.DropdownMenuContent;
41
+ exports.DropdownMenuGroup = DropdownMenu.DropdownMenuGroup;
42
+ exports.DropdownMenuItem = DropdownMenu.DropdownMenuItem;
43
+ exports.DropdownMenuLabel = DropdownMenu.DropdownMenuLabel;
44
+ exports.DropdownMenuPortal = DropdownMenu.DropdownMenuPortal;
45
+ exports.DropdownMenuRadioGroup = DropdownMenu.DropdownMenuRadioGroup;
46
+ exports.DropdownMenuRadioItem = DropdownMenu.DropdownMenuRadioItem;
47
+ exports.DropdownMenuSeparator = DropdownMenu.DropdownMenuSeparator;
48
+ exports.DropdownMenuShortcut = DropdownMenu.DropdownMenuShortcut;
49
+ exports.DropdownMenuSub = DropdownMenu.DropdownMenuSub;
50
+ exports.DropdownMenuSubContent = DropdownMenu.DropdownMenuSubContent;
51
+ exports.DropdownMenuSubTrigger = DropdownMenu.DropdownMenuSubTrigger;
52
+ exports.DropdownMenuTrigger = DropdownMenu.DropdownMenuTrigger;
53
53
  exports.Form = Form.Form;
54
54
  exports.FormConfigContext = context.FormConfigContext;
55
55
  exports.buildZodSchemaFromRules = context.buildZodSchemaFromRules;
@@ -58,10 +58,11 @@ exports.useFieldValidationRegistry = context.useFieldValidationRegistry;
58
58
  exports.RadioGroup = Radio.RadioGroup;
59
59
  exports.RadioItem = Radio.RadioItem;
60
60
  exports.Select = Select.Select;
61
- exports.Separator = separator.Separator;
61
+ exports.Separator = Separator.Separator;
62
62
  exports.Switch = Switch.Switch;
63
63
  exports.TextArea = TextArea.TextArea;
64
64
  exports.TextBox = TextBox.TextBox;
65
+ exports.badgeVariants = badge.badgeVariants;
65
66
  exports.buttonVariants = button.buttonVariants;
66
67
  exports.useFieldError = hooks.useFieldError;
67
68
  exports.useForm = hooks.useForm;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -20,7 +20,7 @@ function _interopNamespaceDefault(e) {
20
20
  return Object.freeze(n);
21
21
  }
22
22
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
23
- const Input = React__namespace.forwardRef(
23
+ const TextBoxPrimitive = React__namespace.forwardRef(
24
24
  ({ className, type, ...props }, ref) => {
25
25
  return /* @__PURE__ */ jsxRuntime.jsx(
26
26
  "input",
@@ -36,6 +36,6 @@ const Input = React__namespace.forwardRef(
36
36
  );
37
37
  }
38
38
  );
39
- Input.displayName = "Input";
40
- exports.Input = Input;
41
- //# sourceMappingURL=input.cjs.map
39
+ TextBoxPrimitive.displayName = "TextBoxPrimitive";
40
+ exports.TextBoxPrimitive = TextBoxPrimitive;
41
+ //# sourceMappingURL=textbox.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textbox.cjs","sources":["../../../src/primitives/textbox.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nconst TextBoxPrimitive = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nTextBoxPrimitive.displayName = \"TextBoxPrimitive\"\n\nexport { TextBoxPrimitive }\n"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,mBAAmBA,iBAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,MAAM,GAAG,MAAA,GAAS,QAAQ;AACtC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,iBAAiB,cAAc;;"}
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Avatar as Avatar$1, AvatarFallback as AvatarFallback$1, AvatarImage as AvatarImage$1 } from "../../primitives/avatar.js";
4
+ const Avatar = forwardRef((props, ref) => /* @__PURE__ */ jsx(Avatar$1, { ref, ...props }));
5
+ Avatar.displayName = "Avatar";
6
+ const AvatarImage = forwardRef((props, ref) => /* @__PURE__ */ jsx(AvatarImage$1, { ref, ...props }));
7
+ AvatarImage.displayName = "AvatarImage";
8
+ const AvatarFallback = forwardRef((props, ref) => /* @__PURE__ */ jsx(AvatarFallback$1, { ref, ...props }));
9
+ AvatarFallback.displayName = "AvatarFallback";
10
+ export {
11
+ Avatar,
12
+ AvatarFallback,
13
+ AvatarImage
14
+ };
15
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport {\n Avatar as AvatarPrimitive,\n AvatarImage as AvatarImagePrimitive,\n AvatarFallback as AvatarFallbackPrimitive,\n} from \"../../primitives/avatar\"\n\nexport const Avatar = forwardRef<\n ElementRef<typeof AvatarPrimitive>,\n ComponentPropsWithoutRef<typeof AvatarPrimitive>\n>((props, ref) => <AvatarPrimitive ref={ref} {...props} />)\nAvatar.displayName = \"Avatar\"\n\nexport const AvatarImage = forwardRef<\n ElementRef<typeof AvatarImagePrimitive>,\n ComponentPropsWithoutRef<typeof AvatarImagePrimitive>\n>((props, ref) => <AvatarImagePrimitive ref={ref} {...props} />)\nAvatarImage.displayName = \"AvatarImage\"\n\nexport const AvatarFallback = forwardRef<\n ElementRef<typeof AvatarFallbackPrimitive>,\n ComponentPropsWithoutRef<typeof AvatarFallbackPrimitive>\n>((props, ref) => <AvatarFallbackPrimitive ref={ref} {...props} />)\nAvatarFallback.displayName = \"AvatarFallback\"\n"],"names":["AvatarPrimitive","AvatarImagePrimitive","AvatarFallbackPrimitive"],"mappings":";;;AAQO,MAAM,SAAS,WAGpB,CAAC,OAAO,4BAASA,UAAA,EAAgB,KAAW,GAAG,OAAO,CAAE;AAC1D,OAAO,cAAc;AAEd,MAAM,cAAc,WAGzB,CAAC,OAAO,4BAASC,eAAA,EAAqB,KAAW,GAAG,OAAO,CAAE;AAC/D,YAAY,cAAc;AAEnB,MAAM,iBAAiB,WAG5B,CAAC,OAAO,4BAASC,kBAAA,EAAwB,KAAW,GAAG,OAAO,CAAE;AAClE,eAAe,cAAc;"}
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Badge as Badge$1 } from "../../primitives/badge.js";
3
+ import { badgeVariants } from "../../primitives/badge.js";
4
+ function Badge(props) {
5
+ return /* @__PURE__ */ jsx(Badge$1, { ...props });
6
+ }
7
+ Badge.displayName = "Badge";
8
+ export {
9
+ Badge,
10
+ badgeVariants
11
+ };
12
+ //# sourceMappingURL=Badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { Badge as BadgePrimitive, badgeVariants } from \"../../primitives/badge\"\nimport type { BadgeProps as BadgePrimitiveProps } from \"../../primitives/badge\"\n\nexport type BadgeProps = BadgePrimitiveProps\n\nexport function Badge(props: BadgeProps) {\n return <BadgePrimitive {...props} />\n}\nBadge.displayName = \"Badge\"\n\nexport { badgeVariants }\n"],"names":["BadgePrimitive"],"mappings":";;;AAKO,SAAS,MAAM,OAAmB;AACvC,SAAO,oBAACA,SAAA,EAAgB,GAAG,MAAA,CAAO;AACpC;AACA,MAAM,cAAc;"}
@@ -3,6 +3,7 @@ import { forwardRef } from "react";
3
3
  import "class-variance-authority";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  import { ButtonPrimitive } from "../../primitives/button.js";
6
+ import { buttonVariants } from "../../primitives/button.js";
6
7
  const variantMap = {
7
8
  primary: "default",
8
9
  secondary: "secondary",
@@ -47,6 +48,7 @@ const Button = forwardRef(function Button2({
47
48
  });
48
49
  Button.displayName = "Button";
49
50
  export {
50
- Button
51
+ Button,
52
+ buttonVariants
51
53
  };
52
54
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { ButtonPrimitive, buttonVariants } from \"../../primitives/button\";\n\ntype PrimitiveVariant = NonNullable<VariantProps<typeof buttonVariants>[\"variant\"]>;\ntype PrimitiveSize = NonNullable<VariantProps<typeof buttonVariants>[\"size\"]>;\n\nconst variantMap: Record<string, PrimitiveVariant> = {\n primary: \"default\",\n secondary: \"secondary\",\n outline: \"outline\",\n ghost: \"ghost\",\n danger: \"destructive\",\n};\n\nconst sizeMap: Record<string, PrimitiveSize> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant */\n variant?: keyof typeof variantMap;\n /** Size of the button */\n size?: keyof typeof sizeMap;\n /** Stretch button to full container width */\n fullWidth?: boolean;\n /** Show a loading spinner and disable interaction */\n loading?: boolean;\n /** Render as child element via Slot (e.g. wrap a Link) */\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n disabled,\n className,\n asChild = false,\n style,\n ...props\n },\n ref\n) {\n return (\n <ButtonPrimitive\n ref={ref}\n variant={variantMap[variant]}\n size={sizeMap[size]}\n asChild={asChild}\n disabled={disabled || loading}\n className={cn(fullWidth && \"w-full\", \"relative cursor-pointer\", className)}\n style={style}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"size-4 border-2 border-current border-r-transparent rounded-full animate-spin\" />\n </span>\n )}\n <span className={cn(loading && \"invisible\")}>{children}</span>\n </>\n )}\n </ButtonPrimitive>\n );\n});\n\nButton.displayName = \"Button\";\n"],"names":["Button"],"mappings":";;;;;AAQA,MAAM,aAA+C;AAAA,EACnD,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,UAAyC;AAAA,EAC7C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAgBO,MAAM,SAAS,WAA2C,SAASA,QACxE;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW,OAAO;AAAA,MAC3B,MAAM,QAAQ,IAAI;AAAA,MAClB;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW,GAAG,aAAa,UAAU,2BAA2B,SAAS;AAAA,MACzE;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,UACC,WAEA,qBAAA,UAAA,EACG,UAAA;AAAA,QAAA,WACC,oBAAC,UAAK,WAAU,qDACd,8BAAC,QAAA,EAAK,WAAU,iFAAgF,EAAA,CAClG;AAAA,4BAED,QAAA,EAAK,WAAW,GAAG,WAAW,WAAW,GAAI,SAAA,CAAS;AAAA,MAAA,EAAA,CACzD;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAED,OAAO,cAAc;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { ButtonPrimitive, buttonVariants } from \"../../primitives/button\"\n\nexport { buttonVariants };\n\ntype PrimitiveVariant = NonNullable<VariantProps<typeof buttonVariants>[\"variant\"]>;\ntype PrimitiveSize = NonNullable<VariantProps<typeof buttonVariants>[\"size\"]>;\n\nconst variantMap: Record<string, PrimitiveVariant> = {\n primary: \"default\",\n secondary: \"secondary\",\n outline: \"outline\",\n ghost: \"ghost\",\n danger: \"destructive\",\n};\n\nconst sizeMap: Record<string, PrimitiveSize> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant */\n variant?: keyof typeof variantMap;\n /** Size of the button */\n size?: keyof typeof sizeMap;\n /** Stretch button to full container width */\n fullWidth?: boolean;\n /** Show a loading spinner and disable interaction */\n loading?: boolean;\n /** Render as child element via Slot (e.g. wrap a Link) */\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n disabled,\n className,\n asChild = false,\n style,\n ...props\n },\n ref\n) {\n return (\n <ButtonPrimitive\n ref={ref}\n variant={variantMap[variant]}\n size={sizeMap[size]}\n asChild={asChild}\n disabled={disabled || loading}\n className={cn(fullWidth && \"w-full\", \"relative cursor-pointer\", className)}\n style={style}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"size-4 border-2 border-current border-r-transparent rounded-full animate-spin\" />\n </span>\n )}\n <span className={cn(loading && \"invisible\")}>{children}</span>\n </>\n )}\n </ButtonPrimitive>\n );\n});\n\nButton.displayName = \"Button\";\n"],"names":["Button"],"mappings":";;;;;;AAUA,MAAM,aAA+C;AAAA,EACnD,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,UAAyC;AAAA,EAC7C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAgBO,MAAM,SAAS,WAA2C,SAASA,QACxE;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW,OAAO;AAAA,MAC3B,MAAM,QAAQ,IAAI;AAAA,MAClB;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW,GAAG,aAAa,UAAU,2BAA2B,SAAS;AAAA,MACzE;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,UACC,WAEA,qBAAA,UAAA,EACG,UAAA;AAAA,QAAA,WACC,oBAAC,UAAK,WAAU,qDACd,8BAAC,QAAA,EAAK,WAAU,iFAAgF,EAAA,CAClG;AAAA,4BAED,QAAA,EAAK,WAAW,GAAG,WAAW,WAAW,GAAI,SAAA,CAAS;AAAA,MAAA,EAAA,CACzD;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAED,OAAO,cAAc;"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Card as Card$1, CardContent as CardContent$1, CardDescription as CardDescription$1, CardFooter as CardFooter$1, CardHeader as CardHeader$1, CardTitle as CardTitle$1 } from "../../primitives/card.js";
4
+ const Card = forwardRef((props, ref) => /* @__PURE__ */ jsx(Card$1, { ref, ...props }));
5
+ Card.displayName = "Card";
6
+ const CardHeader = forwardRef((props, ref) => /* @__PURE__ */ jsx(CardHeader$1, { ref, ...props }));
7
+ CardHeader.displayName = "CardHeader";
8
+ const CardTitle = forwardRef((props, ref) => /* @__PURE__ */ jsx(CardTitle$1, { ref, ...props }));
9
+ CardTitle.displayName = "CardTitle";
10
+ const CardDescription = forwardRef((props, ref) => /* @__PURE__ */ jsx(CardDescription$1, { ref, ...props }));
11
+ CardDescription.displayName = "CardDescription";
12
+ const CardContent = forwardRef((props, ref) => /* @__PURE__ */ jsx(CardContent$1, { ref, ...props }));
13
+ CardContent.displayName = "CardContent";
14
+ const CardFooter = forwardRef((props, ref) => /* @__PURE__ */ jsx(CardFooter$1, { ref, ...props }));
15
+ CardFooter.displayName = "CardFooter";
16
+ export {
17
+ Card,
18
+ CardContent,
19
+ CardDescription,
20
+ CardFooter,
21
+ CardHeader,
22
+ CardTitle
23
+ };
24
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport {\n Card as CardPrimitive,\n CardHeader as CardHeaderPrimitive,\n CardTitle as CardTitlePrimitive,\n CardDescription as CardDescriptionPrimitive,\n CardContent as CardContentPrimitive,\n CardFooter as CardFooterPrimitive,\n} from \"../../primitives/card\"\n\nexport const Card = forwardRef<\n ElementRef<typeof CardPrimitive>,\n ComponentPropsWithoutRef<typeof CardPrimitive>\n>((props, ref) => <CardPrimitive ref={ref} {...props} />)\nCard.displayName = \"Card\"\n\nexport const CardHeader = forwardRef<\n ElementRef<typeof CardHeaderPrimitive>,\n ComponentPropsWithoutRef<typeof CardHeaderPrimitive>\n>((props, ref) => <CardHeaderPrimitive ref={ref} {...props} />)\nCardHeader.displayName = \"CardHeader\"\n\nexport const CardTitle = forwardRef<\n ElementRef<typeof CardTitlePrimitive>,\n ComponentPropsWithoutRef<typeof CardTitlePrimitive>\n>((props, ref) => <CardTitlePrimitive ref={ref} {...props} />)\nCardTitle.displayName = \"CardTitle\"\n\nexport const CardDescription = forwardRef<\n ElementRef<typeof CardDescriptionPrimitive>,\n ComponentPropsWithoutRef<typeof CardDescriptionPrimitive>\n>((props, ref) => <CardDescriptionPrimitive ref={ref} {...props} />)\nCardDescription.displayName = \"CardDescription\"\n\nexport const CardContent = forwardRef<\n ElementRef<typeof CardContentPrimitive>,\n ComponentPropsWithoutRef<typeof CardContentPrimitive>\n>((props, ref) => <CardContentPrimitive ref={ref} {...props} />)\nCardContent.displayName = \"CardContent\"\n\nexport const CardFooter = forwardRef<\n ElementRef<typeof CardFooterPrimitive>,\n ComponentPropsWithoutRef<typeof CardFooterPrimitive>\n>((props, ref) => <CardFooterPrimitive ref={ref} {...props} />)\nCardFooter.displayName = \"CardFooter\"\n"],"names":["CardPrimitive","CardHeaderPrimitive","CardTitlePrimitive","CardDescriptionPrimitive","CardContentPrimitive","CardFooterPrimitive"],"mappings":";;;AAWO,MAAM,OAAO,WAGlB,CAAC,OAAO,4BAASA,QAAA,EAAc,KAAW,GAAG,OAAO,CAAE;AACxD,KAAK,cAAc;AAEZ,MAAM,aAAa,WAGxB,CAAC,OAAO,4BAASC,cAAA,EAAoB,KAAW,GAAG,OAAO,CAAE;AAC9D,WAAW,cAAc;AAElB,MAAM,YAAY,WAGvB,CAAC,OAAO,4BAASC,aAAA,EAAmB,KAAW,GAAG,OAAO,CAAE;AAC7D,UAAU,cAAc;AAEjB,MAAM,kBAAkB,WAG7B,CAAC,OAAO,4BAASC,mBAAA,EAAyB,KAAW,GAAG,OAAO,CAAE;AACnE,gBAAgB,cAAc;AAEvB,MAAM,cAAc,WAGzB,CAAC,OAAO,4BAASC,eAAA,EAAqB,KAAW,GAAG,OAAO,CAAE;AAC/D,YAAY,cAAc;AAEnB,MAAM,aAAa,WAGxB,CAAC,OAAO,4BAASC,cAAA,EAAoB,KAAW,GAAG,OAAO,CAAE;AAC9D,WAAW,cAAc;"}
@@ -0,0 +1,56 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { DropdownMenu as DropdownMenu$1, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem$1, DropdownMenuContent as DropdownMenuContent$1, DropdownMenuGroup as DropdownMenuGroup$1, DropdownMenuItem as DropdownMenuItem$1, DropdownMenuLabel as DropdownMenuLabel$1, DropdownMenuPortal as DropdownMenuPortal$1, DropdownMenuRadioGroup as DropdownMenuRadioGroup$1, DropdownMenuRadioItem as DropdownMenuRadioItem$1, DropdownMenuSeparator as DropdownMenuSeparator$1, DropdownMenuShortcut as DropdownMenuShortcut$1, DropdownMenuSub as DropdownMenuSub$1, DropdownMenuSubContent as DropdownMenuSubContent$1, DropdownMenuSubTrigger as DropdownMenuSubTrigger$1, DropdownMenuTrigger as DropdownMenuTrigger$1 } from "../../primitives/dropdown-menu.js";
4
+ function DropdownMenu(props) {
5
+ return /* @__PURE__ */ jsx(DropdownMenu$1, { ...props });
6
+ }
7
+ function DropdownMenuPortal(props) {
8
+ return /* @__PURE__ */ jsx(DropdownMenuPortal$1, { ...props });
9
+ }
10
+ function DropdownMenuSub(props) {
11
+ return /* @__PURE__ */ jsx(DropdownMenuSub$1, { ...props });
12
+ }
13
+ const DropdownMenuTrigger = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuTrigger$1, { ref, ...props }));
14
+ DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
15
+ const DropdownMenuGroup = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuGroup$1, { ref, ...props }));
16
+ DropdownMenuGroup.displayName = "DropdownMenuGroup";
17
+ const DropdownMenuRadioGroup = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuRadioGroup$1, { ref, ...props }));
18
+ DropdownMenuRadioGroup.displayName = "DropdownMenuRadioGroup";
19
+ const DropdownMenuContent = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuContent$1, { ref, ...props }));
20
+ DropdownMenuContent.displayName = "DropdownMenuContent";
21
+ const DropdownMenuSubContent = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuSubContent$1, { ref, ...props }));
22
+ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
23
+ const DropdownMenuSubTrigger = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuSubTrigger$1, { ref, ...props }));
24
+ DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
25
+ const DropdownMenuItem = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuItem$1, { ref, ...props }));
26
+ DropdownMenuItem.displayName = "DropdownMenuItem";
27
+ const DropdownMenuCheckboxItem = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuCheckboxItem$1, { ref, ...props }));
28
+ DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
29
+ const DropdownMenuRadioItem = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuRadioItem$1, { ref, ...props }));
30
+ DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
31
+ const DropdownMenuLabel = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuLabel$1, { ref, ...props }));
32
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
33
+ const DropdownMenuSeparator = forwardRef((props, ref) => /* @__PURE__ */ jsx(DropdownMenuSeparator$1, { ref, ...props }));
34
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
35
+ function DropdownMenuShortcut(props) {
36
+ return /* @__PURE__ */ jsx(DropdownMenuShortcut$1, { ...props });
37
+ }
38
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
39
+ export {
40
+ DropdownMenu,
41
+ DropdownMenuCheckboxItem,
42
+ DropdownMenuContent,
43
+ DropdownMenuGroup,
44
+ DropdownMenuItem,
45
+ DropdownMenuLabel,
46
+ DropdownMenuPortal,
47
+ DropdownMenuRadioGroup,
48
+ DropdownMenuRadioItem,
49
+ DropdownMenuSeparator,
50
+ DropdownMenuShortcut,
51
+ DropdownMenuSub,
52
+ DropdownMenuSubContent,
53
+ DropdownMenuSubTrigger,
54
+ DropdownMenuTrigger
55
+ };
56
+ //# sourceMappingURL=DropdownMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenu.js","sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef, HTMLAttributes } from \"react\"\nimport {\n DropdownMenu as DropdownMenuPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuGroup as DropdownMenuGroupPrimitive,\n DropdownMenuPortal as DropdownMenuPortalPrimitive,\n DropdownMenuSub as DropdownMenuSubPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuRadioGroup as DropdownMenuRadioGroupPrimitive,\n} from \"../../primitives/dropdown-menu\"\n\n// Root / context-only components (no DOM element to ref)\nexport function DropdownMenu(props: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive>) {\n return <DropdownMenuPrimitive {...props} />\n}\n\nexport function DropdownMenuPortal(props: ComponentPropsWithoutRef<typeof DropdownMenuPortalPrimitive>) {\n return <DropdownMenuPortalPrimitive {...props} />\n}\n\nexport function DropdownMenuSub(props: ComponentPropsWithoutRef<typeof DropdownMenuSubPrimitive>) {\n return <DropdownMenuSubPrimitive {...props} />\n}\n\n// DOM-rendering components (forwardRef)\nexport const DropdownMenuTrigger = forwardRef<\n ElementRef<typeof DropdownMenuTriggerPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuTriggerPrimitive>\n>((props, ref) => <DropdownMenuTriggerPrimitive ref={ref} {...props} />)\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\"\n\nexport const DropdownMenuGroup = forwardRef<\n ElementRef<typeof DropdownMenuGroupPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuGroupPrimitive>\n>((props, ref) => <DropdownMenuGroupPrimitive ref={ref} {...props} />)\nDropdownMenuGroup.displayName = \"DropdownMenuGroup\"\n\nexport const DropdownMenuRadioGroup = forwardRef<\n ElementRef<typeof DropdownMenuRadioGroupPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuRadioGroupPrimitive>\n>((props, ref) => <DropdownMenuRadioGroupPrimitive ref={ref} {...props} />)\nDropdownMenuRadioGroup.displayName = \"DropdownMenuRadioGroup\"\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuContentPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuContentPrimitive>\n>((props, ref) => <DropdownMenuContentPrimitive ref={ref} {...props} />)\nDropdownMenuContent.displayName = \"DropdownMenuContent\"\n\nexport const DropdownMenuSubContent = forwardRef<\n ElementRef<typeof DropdownMenuSubContentPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSubContentPrimitive>\n>((props, ref) => <DropdownMenuSubContentPrimitive ref={ref} {...props} />)\nDropdownMenuSubContent.displayName = \"DropdownMenuSubContent\"\n\nexport const DropdownMenuSubTrigger = forwardRef<\n ElementRef<typeof DropdownMenuSubTriggerPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSubTriggerPrimitive>\n>((props, ref) => <DropdownMenuSubTriggerPrimitive ref={ref} {...props} />)\nDropdownMenuSubTrigger.displayName = \"DropdownMenuSubTrigger\"\n\nexport const DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuItemPrimitive>\n>((props, ref) => <DropdownMenuItemPrimitive ref={ref} {...props} />)\nDropdownMenuItem.displayName = \"DropdownMenuItem\"\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n ElementRef<typeof DropdownMenuCheckboxItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuCheckboxItemPrimitive>\n>((props, ref) => <DropdownMenuCheckboxItemPrimitive ref={ref} {...props} />)\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\"\n\nexport const DropdownMenuRadioItem = forwardRef<\n ElementRef<typeof DropdownMenuRadioItemPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuRadioItemPrimitive>\n>((props, ref) => <DropdownMenuRadioItemPrimitive ref={ref} {...props} />)\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\"\n\nexport const DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuLabelPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuLabelPrimitive>\n>((props, ref) => <DropdownMenuLabelPrimitive ref={ref} {...props} />)\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\"\n\nexport const DropdownMenuSeparator = forwardRef<\n ElementRef<typeof DropdownMenuSeparatorPrimitive>,\n ComponentPropsWithoutRef<typeof DropdownMenuSeparatorPrimitive>\n>((props, ref) => <DropdownMenuSeparatorPrimitive ref={ref} {...props} />)\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\"\n\n// Utility span — no ref needed\nexport function DropdownMenuShortcut(props: HTMLAttributes<HTMLSpanElement>) {\n return <DropdownMenuShortcutPrimitive {...props} />\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n"],"names":["DropdownMenuPrimitive","DropdownMenuPortalPrimitive","DropdownMenuSubPrimitive","DropdownMenuTriggerPrimitive","DropdownMenuGroupPrimitive","DropdownMenuRadioGroupPrimitive","DropdownMenuContentPrimitive","DropdownMenuSubContentPrimitive","DropdownMenuSubTriggerPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"mappings":";;;AAqBO,SAAS,aAAa,OAA+D;AAC1F,SAAO,oBAACA,gBAAA,EAAuB,GAAG,MAAA,CAAO;AAC3C;AAEO,SAAS,mBAAmB,OAAqE;AACtG,SAAO,oBAACC,sBAAA,EAA6B,GAAG,MAAA,CAAO;AACjD;AAEO,SAAS,gBAAgB,OAAkE;AAChG,SAAO,oBAACC,mBAAA,EAA0B,GAAG,MAAA,CAAO;AAC9C;AAGO,MAAM,sBAAsB,WAGjC,CAAC,OAAO,4BAASC,uBAAA,EAA6B,KAAW,GAAG,OAAO,CAAE;AACvE,oBAAoB,cAAc;AAE3B,MAAM,oBAAoB,WAG/B,CAAC,OAAO,4BAASC,qBAAA,EAA2B,KAAW,GAAG,OAAO,CAAE;AACrE,kBAAkB,cAAc;AAEzB,MAAM,yBAAyB,WAGpC,CAAC,OAAO,4BAASC,0BAAA,EAAgC,KAAW,GAAG,OAAO,CAAE;AAC1E,uBAAuB,cAAc;AAE9B,MAAM,sBAAsB,WAGjC,CAAC,OAAO,4BAASC,uBAAA,EAA6B,KAAW,GAAG,OAAO,CAAE;AACvE,oBAAoB,cAAc;AAE3B,MAAM,yBAAyB,WAGpC,CAAC,OAAO,4BAASC,0BAAA,EAAgC,KAAW,GAAG,OAAO,CAAE;AAC1E,uBAAuB,cAAc;AAE9B,MAAM,yBAAyB,WAGpC,CAAC,OAAO,4BAASC,0BAAA,EAAgC,KAAW,GAAG,OAAO,CAAE;AAC1E,uBAAuB,cAAc;AAE9B,MAAM,mBAAmB,WAG9B,CAAC,OAAO,4BAASC,oBAAA,EAA0B,KAAW,GAAG,OAAO,CAAE;AACpE,iBAAiB,cAAc;AAExB,MAAM,2BAA2B,WAGtC,CAAC,OAAO,4BAASC,4BAAA,EAAkC,KAAW,GAAG,OAAO,CAAE;AAC5E,yBAAyB,cAAc;AAEhC,MAAM,wBAAwB,WAGnC,CAAC,OAAO,4BAASC,yBAAA,EAA+B,KAAW,GAAG,OAAO,CAAE;AACzE,sBAAsB,cAAc;AAE7B,MAAM,oBAAoB,WAG/B,CAAC,OAAO,4BAASC,qBAAA,EAA2B,KAAW,GAAG,OAAO,CAAE;AACrE,kBAAkB,cAAc;AAEzB,MAAM,wBAAwB,WAGnC,CAAC,OAAO,4BAASC,yBAAA,EAA+B,KAAW,GAAG,OAAO,CAAE;AACzE,sBAAsB,cAAc;AAG7B,SAAS,qBAAqB,OAAwC;AAC3E,SAAO,oBAACC,wBAAA,EAA+B,GAAG,MAAA,CAAO;AACnD;AACA,qBAAqB,cAAc;"}
@@ -5,7 +5,7 @@ import { cva } from "class-variance-authority";
5
5
  import { cn } from "../../utils/cn.js";
6
6
  import { FormConfigContext } from "./context.js";
7
7
  import { labelVariants } from "./variants.js";
8
- import { Input } from "../../primitives/input.js";
8
+ import { TextBoxPrimitive } from "../../primitives/textbox.js";
9
9
  import { Label } from "../../primitives/label.js";
10
10
  import { X } from "lucide-react";
11
11
  const textBoxVariants = cva(
@@ -82,6 +82,14 @@ function TextBoxInner({
82
82
  let fieldType = "string";
83
83
  if (inputType === "number") {
84
84
  fieldType = "number";
85
+ } else if (inputType === "date") {
86
+ fieldType = "date";
87
+ } else if (inputType === "email" && rules.email === void 0) {
88
+ rules.email = true;
89
+ } else if (inputType === "url" && rules.url === void 0) {
90
+ rules.url = true;
91
+ } else if (inputType === "tel" && rules.pattern === void 0) {
92
+ rules.pattern = { value: /^\+?[\d\s\-().]{7,}$/, message: "Invalid phone number" };
85
93
  }
86
94
  registerFieldValidation({
87
95
  name,
@@ -136,7 +144,7 @@ function TextBoxInner({
136
144
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
137
145
  prefix && /* @__PURE__ */ jsx("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
138
146
  /* @__PURE__ */ jsx(
139
- Input,
147
+ TextBoxPrimitive,
140
148
  {
141
149
  ...props,
142
150
  ...field,
@@ -1 +1 @@
1
- {"version":3,"file":"TextBox.js","sources":["../../../src/components/Form/TextBox.tsx"],"sourcesContent":["import { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { labelVariants } from \"./variants\";\nimport { Input } from \"../../primitives/input\";\nimport { Label } from \"../../primitives/label\";\nimport { X } from \"lucide-react\";\n\nconst textBoxVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-8 text-xs px-2\",\n md: \"h-10 text-sm px-3\",\n lg: \"h-12 text-base px-4\",\n },\n variant: {\n default: \"border-input focus-visible:ring-ring\",\n error: \"border-destructive focus-visible:ring-destructive\",\n success: \"border-green-500 focus-visible:ring-green-500\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n }\n);\n\n/**\n * Validation rule with optional custom message\n */\ntype ValidationRule<T> = T | { value: T; message: string };\n\nexport interface TextBoxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"name\" | \"prefix\" | \"pattern\" | \"required\" | \"minLength\" | \"maxLength\">,\n VariantProps<typeof textBoxVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the input */\n label?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** Whether the input should take full width */\n fullWidth?: boolean;\n /** Prefix element */\n prefix?: ReactNode;\n /** Suffix element */\n suffix?: ReactNode;\n /** Allow clear button */\n allowClear?: boolean;\n /** Callback when clear is clicked */\n onClear?: () => void;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n \n // Validation props\n /** Field is required */\n required?: boolean | string;\n /** Minimum length for strings */\n minLength?: ValidationRule<number>;\n /** Maximum length for strings */\n maxLength?: ValidationRule<number>;\n /** Minimum value for numbers */\n minValue?: ValidationRule<number>;\n /** Maximum value for numbers */\n maxValue?: ValidationRule<number>;\n /** Regex pattern for validation */\n pattern?: ValidationRule<RegExp>;\n /** Email validation */\n email?: boolean | string;\n /** URL validation */\n url?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * TextBox component with form integration and automatic validation registration\n * \n * This is a wrapper around the shadcn/ui Input primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * - Prefix/suffix elements\n * - Clear button functionality\n * \n * @example\n * ```tsx\n * // Inside a Form component - validation is automatically registered\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\n * <TextBox name=\"website\" label=\"Website\" url />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nfunction TextBoxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n fullWidth = true,\n className,\n disabled,\n prefix,\n suffix,\n allowClear,\n onClear,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n ...props\n }: TextBoxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<HTMLInputElement>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n\n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Destructure stable function references so the effect doesn't depend on the\n // context object identity (which changes every render due to inline construction).\n const registerFieldValidation = formConfigContext?.registerFieldValidation;\n const unregisterFieldValidation = formConfigContext?.unregisterFieldValidation;\n\n // Register validation rules with the form\n useEffect(() => {\n if (registerFieldValidation) {\n const rules: FieldValidationRules = {};\n\n if (required !== undefined) rules.required = required;\n if (minLength !== undefined) rules.minLength = minLength;\n if (maxLength !== undefined) rules.maxLength = maxLength;\n if (minValue !== undefined) rules.min = minValue;\n if (maxValue !== undefined) rules.max = maxValue;\n if (pattern !== undefined) rules.pattern = pattern;\n if (email !== undefined) rules.email = email;\n if (url !== undefined) rules.url = url;\n if (validate !== undefined) rules.validate = validate;\n\n // Determine field type based on input type\n const inputType = props.type ?? \"text\";\n let fieldType: \"string\" | \"number\" = \"string\";\n if (inputType === \"number\") {\n fieldType = \"number\";\n }\n\n registerFieldValidation({\n name: name as string,\n type: fieldType,\n rules,\n });\n\n return () => {\n unregisterFieldValidation?.(name as string);\n };\n }\n }, [\n registerFieldValidation,\n unregisterFieldValidation,\n name,\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n props.type,\n ]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n const handleClear = () => {\n field.onChange(\"\");\n onClear?.();\n };\n\n return (\n <div className={cn(\"space-y-1.5\", fullWidth && \"w-full\")}>\n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required })}\n >\n {label}\n {formConfig.colon && \":\"}\n </Label>\n )}\n \n <div className=\"relative\">\n {prefix && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {prefix}\n </div>\n )}\n \n <Input\n {...props}\n {...field}\n ref={(node) => {\n // Handle both refs\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n field.ref(node);\n }}\n id={inputId}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n textBoxVariants({ size: effectiveSize, variant: effectiveVariant }),\n prefix && \"pl-10\",\n (suffix || allowClear) && \"pr-10\",\n className\n )}\n />\n \n {(suffix || (allowClear && field.value)) && (\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1\">\n {allowClear && field.value && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n tabIndex={-1}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n {suffix && (\n <span className=\"text-muted-foreground\">{suffix}</span>\n )}\n </div>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const TextBox = forwardRef(TextBoxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: TextBoxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<HTMLInputElement> }\n) => React.ReactElement;\n\n(TextBox as React.FC).displayName = \"TextBox\";\n"],"names":["useRHFFormContext"],"mappings":";;;;;;;;;;AAWA,MAAM,kBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AA6EA,SAAS,aAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI;AAAA,EACJ,SAAS;AAAA;AAAA,EAET;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,cAAc,MAAA;AACpB,QAAM,UAAU,cAAc;AAG9B,QAAM,oBAAoB,WAAW,iBAAiB;AACtD,QAAM,aAAyB,qBAAqB,CAAA;AAGpD,QAAM,aAAaA,eAAA;AACnB,QAAM,UAAU,mBAAmB,YAAY;AAI/C,QA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,CAEpD;AAAA,IAAA,GAEJ;AAAA,IAEC,aAAa,YACZ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QACV,MAAK;AAAA,QAEJ,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJ,cAAc,CAAC,YACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QAET,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;AAGO,MAAM,UAAU,WAAW,YAAY;AAO7C,QAAqB,cAAc;"}
1
+ {"version":3,"file":"TextBox.js","sources":["../../../src/components/Form/TextBox.tsx"],"sourcesContent":["import { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { labelVariants } from \"./variants\";\nimport { TextBoxPrimitive } from \"../../primitives/textbox\";\nimport { Label } from \"../../primitives/label\";\nimport { X } from \"lucide-react\";\n\nconst textBoxVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-8 text-xs px-2\",\n md: \"h-10 text-sm px-3\",\n lg: \"h-12 text-base px-4\",\n },\n variant: {\n default: \"border-input focus-visible:ring-ring\",\n error: \"border-destructive focus-visible:ring-destructive\",\n success: \"border-green-500 focus-visible:ring-green-500\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n }\n);\n\n/**\n * Validation rule with optional custom message\n */\ntype ValidationRule<T> = T | { value: T; message: string };\n\nexport interface TextBoxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"name\" | \"prefix\" | \"pattern\" | \"required\" | \"minLength\" | \"maxLength\">,\n VariantProps<typeof textBoxVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the input */\n label?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** Whether the input should take full width */\n fullWidth?: boolean;\n /** Prefix element */\n prefix?: ReactNode;\n /** Suffix element */\n suffix?: ReactNode;\n /** Allow clear button */\n allowClear?: boolean;\n /** Callback when clear is clicked */\n onClear?: () => void;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n \n // Validation props\n /** Field is required */\n required?: boolean | string;\n /** Minimum length for strings */\n minLength?: ValidationRule<number>;\n /** Maximum length for strings */\n maxLength?: ValidationRule<number>;\n /** Minimum value for numbers */\n minValue?: ValidationRule<number>;\n /** Maximum value for numbers */\n maxValue?: ValidationRule<number>;\n /** Regex pattern for validation */\n pattern?: ValidationRule<RegExp>;\n /** Email validation */\n email?: boolean | string;\n /** URL validation */\n url?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * TextBox component with form integration and automatic validation registration\n * \n * This is a wrapper around the shadcn/ui Input primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * - Prefix/suffix elements\n * - Clear button functionality\n * \n * @example\n * ```tsx\n * // Inside a Form component - validation is automatically registered\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\n * <TextBox name=\"website\" label=\"Website\" url />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nfunction TextBoxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n fullWidth = true,\n className,\n disabled,\n prefix,\n suffix,\n allowClear,\n onClear,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n ...props\n }: TextBoxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<HTMLInputElement>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n\n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Destructure stable function references so the effect doesn't depend on the\n // context object identity (which changes every render due to inline construction).\n const registerFieldValidation = formConfigContext?.registerFieldValidation;\n const unregisterFieldValidation = formConfigContext?.unregisterFieldValidation;\n\n // Register validation rules with the form\n useEffect(() => {\n if (registerFieldValidation) {\n const rules: FieldValidationRules = {};\n\n if (required !== undefined) rules.required = required;\n if (minLength !== undefined) rules.minLength = minLength;\n if (maxLength !== undefined) rules.maxLength = maxLength;\n if (minValue !== undefined) rules.min = minValue;\n if (maxValue !== undefined) rules.max = maxValue;\n if (pattern !== undefined) rules.pattern = pattern;\n if (email !== undefined) rules.email = email;\n if (url !== undefined) rules.url = url;\n if (validate !== undefined) rules.validate = validate;\n\n // Determine field type and auto-infer rules from input type\n const inputType = props.type ?? \"text\";\n let fieldType: \"string\" | \"number\" | \"date\" = \"string\";\n\n if (inputType === \"number\") {\n fieldType = \"number\";\n } else if (inputType === \"date\") {\n fieldType = \"date\";\n } else if (inputType === \"email\" && rules.email === undefined) {\n rules.email = true;\n } else if (inputType === \"url\" && rules.url === undefined) {\n rules.url = true;\n } else if (inputType === \"tel\" && rules.pattern === undefined) {\n rules.pattern = { value: /^\\+?[\\d\\s\\-().]{7,}$/, message: \"Invalid phone number\" };\n }\n\n registerFieldValidation({\n name: name as string,\n type: fieldType,\n rules,\n });\n\n return () => {\n unregisterFieldValidation?.(name as string);\n };\n }\n }, [\n registerFieldValidation,\n unregisterFieldValidation,\n name,\n required,\n minLength,\n maxLength,\n minValue,\n maxValue,\n pattern,\n email,\n url,\n validate,\n props.type,\n ]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n const handleClear = () => {\n field.onChange(\"\");\n onClear?.();\n };\n\n return (\n <div className={cn(\"space-y-1.5\", fullWidth && \"w-full\")}>\n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required })}\n >\n {label}\n {formConfig.colon && \":\"}\n </Label>\n )}\n \n <div className=\"relative\">\n {prefix && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {prefix}\n </div>\n )}\n \n <TextBoxPrimitive\n {...props}\n {...field}\n ref={(node) => {\n // Handle both refs\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n field.ref(node);\n }}\n id={inputId}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n textBoxVariants({ size: effectiveSize, variant: effectiveVariant }),\n prefix && \"pl-10\",\n (suffix || allowClear) && \"pr-10\",\n className\n )}\n />\n\n {(suffix || (allowClear && field.value)) && (\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1\">\n {allowClear && field.value && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n tabIndex={-1}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n {suffix && (\n <span className=\"text-muted-foreground\">{suffix}</span>\n )}\n </div>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const TextBox = forwardRef(TextBoxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: TextBoxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<HTMLInputElement> }\n) => React.ReactElement;\n\n(TextBox as React.FC).displayName = \"TextBox\";\n"],"names":["useRHFFormContext"],"mappings":";;;;;;;;;;AAWA,MAAM,kBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AA6EA,SAAS,aAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI;AAAA,EACJ,SAAS;AAAA;AAAA,EAET;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA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e,SAAS,kBAAkB;AAAA,YAClE,UAAU;AAAA,aACT,UAAU,eAAe;AAAA,YAC1B;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,OAGA,UAAW,cAAc,MAAM,UAC/B,qBAAC,OAAA,EAAI,WAAU,qEACZ,UAAA;AAAA,QAAA,cAAc,MAAM,SACnB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAU;AAAA,YACV,UAAU;AAAA,YAEV,UAAA,oBAAC,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAG1B,UACC,oBAAC,QAAA,EAAK,WAAU,yBAAyB,UAAA,OAAA,CAAO;AAAA,MAAA,EAAA,CAEpD;AAAA,IAAA,GAEJ;AAAA,IAEC,aAAa,YACZ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QACV,MAAK;AAAA,QAEJ,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJ,cAAc,CAAC,YACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,GAAG,OAAO;AAAA,QACd,WAAU;AAAA,QAET,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;AAGO,MAAM,UAAU,WAAW,YAAY;AAO7C,QAAqB,cAAc;"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Separator as Separator$1 } from "../../primitives/separator.js";
4
+ const Separator = forwardRef((props, ref) => /* @__PURE__ */ jsx(Separator$1, { ref, ...props }));
5
+ Separator.displayName = "Separator";
6
+ export {
7
+ Separator
8
+ };
9
+ //# sourceMappingURL=Separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.js","sources":["../../../src/components/Separator/Separator.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\"\nimport { Separator as SeparatorPrimitive } from \"../../primitives/separator\"\n\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive>\n>((props, ref) => <SeparatorPrimitive ref={ref} {...props} />)\nSeparator.displayName = \"Separator\"\n"],"names":["SeparatorPrimitive"],"mappings":";;;AAIO,MAAM,YAAY,WAGvB,CAAC,OAAO,4BAASA,aAAA,EAAmB,KAAW,GAAG,OAAO,CAAE;AAC7D,UAAU,cAAc;"}
package/dist/index.js CHANGED
@@ -1,20 +1,21 @@
1
1
  import { useToggle } from "./hooks/useToggle.js";
2
2
  import { useDebounce } from "./hooks/useDebounce.js";
3
3
  import { cn } from "./utils/cn.js";
4
- import { Avatar, AvatarFallback, AvatarImage } from "./primitives/avatar.js";
5
- import { Badge, badgeVariants } from "./primitives/badge.js";
4
+ import { Avatar, AvatarFallback, AvatarImage } from "./components/Avatar/Avatar.js";
5
+ import { Badge } from "./components/Badge/Badge.js";
6
6
  import { Button } from "./components/Button/Button.js";
7
- import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./primitives/card.js";
7
+ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/Card/Card.js";
8
8
  import { Checkbox } from "./components/Form/Checkbox.js";
9
- import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
9
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.js";
10
10
  import { Form } from "./components/Form/Form.js";
11
11
  import { FormConfigContext, buildZodSchemaFromRules, defaultFormConfig, useFieldValidationRegistry } from "./components/Form/context.js";
12
12
  import { RadioGroup, RadioItem } from "./components/Form/Radio.js";
13
13
  import { Select } from "./components/Form/Select.js";
14
- import { Separator } from "./primitives/separator.js";
14
+ import { Separator } from "./components/Separator/Separator.js";
15
15
  import { Switch } from "./components/Form/Switch.js";
16
16
  import { TextArea } from "./components/Form/TextArea.js";
17
17
  import { TextBox } from "./components/Form/TextBox.js";
18
+ import { badgeVariants } from "./primitives/badge.js";
18
19
  import { buttonVariants } from "./primitives/button.js";
19
20
  import { useFieldError, useForm, useFormConfig, useFormField } from "./components/Form/hooks.js";
20
21
  export {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { cn } from "../utils/cn.js";
4
- const Input = React.forwardRef(
4
+ const TextBoxPrimitive = React.forwardRef(
5
5
  ({ className, type, ...props }, ref) => {
6
6
  return /* @__PURE__ */ jsx(
7
7
  "input",
@@ -17,8 +17,8 @@ const Input = React.forwardRef(
17
17
  );
18
18
  }
19
19
  );
20
- Input.displayName = "Input";
20
+ TextBoxPrimitive.displayName = "TextBoxPrimitive";
21
21
  export {
22
- Input
22
+ TextBoxPrimitive
23
23
  };
24
- //# sourceMappingURL=input.js.map
24
+ //# sourceMappingURL=textbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textbox.js","sources":["../../src/primitives/textbox.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nconst TextBoxPrimitive = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nTextBoxPrimitive.displayName = \"TextBoxPrimitive\"\n\nexport { TextBoxPrimitive }\n"],"names":[],"mappings":";;;AAIA,MAAM,mBAAmB,MAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,MAAM,GAAG,MAAA,GAAS,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,iBAAiB,cAAc;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skybin-tech/nebula-ui",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "author": "Anwar <anwar@skybin.io>",
6
6
  "description": "Reusable React component library with form validation using shadcn/ui patterns, react-hook-form, and Zod",
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.cjs","sources":["../../../src/primitives/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,QAAQA,iBAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAA,GAAS,QAAQ;AACtC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,MAAM,cAAc;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.js","sources":["../../src/primitives/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"names":[],"mappings":";;;AAIA,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAA,GAAS,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,MAAM,cAAc;"}