ui-lab-registry 0.1.0

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 (153) hide show
  1. package/README.md +145 -0
  2. package/dist/categories.d.ts +5 -0
  3. package/dist/categories.d.ts.map +1 -0
  4. package/dist/categories.js +81 -0
  5. package/dist/categories.js.map +1 -0
  6. package/dist/components/badge.d.ts +15 -0
  7. package/dist/components/badge.d.ts.map +1 -0
  8. package/dist/components/badge.js +31 -0
  9. package/dist/components/badge.js.map +1 -0
  10. package/dist/components/button-group.d.ts +27 -0
  11. package/dist/components/button-group.d.ts.map +1 -0
  12. package/dist/components/button-group.js +99 -0
  13. package/dist/components/button-group.js.map +1 -0
  14. package/dist/components/button.d.ts +13 -0
  15. package/dist/components/button.d.ts.map +1 -0
  16. package/dist/components/button.js +26 -0
  17. package/dist/components/button.js.map +1 -0
  18. package/dist/components/card.d.ts +19 -0
  19. package/dist/components/card.d.ts.map +1 -0
  20. package/dist/components/card.js +20 -0
  21. package/dist/components/card.js.map +1 -0
  22. package/dist/components/checkbox.d.ts +21 -0
  23. package/dist/components/checkbox.d.ts.map +1 -0
  24. package/dist/components/checkbox.js +69 -0
  25. package/dist/components/checkbox.js.map +1 -0
  26. package/dist/components/command-palette.d.ts +32 -0
  27. package/dist/components/command-palette.d.ts.map +1 -0
  28. package/dist/components/command-palette.js +256 -0
  29. package/dist/components/command-palette.js.map +1 -0
  30. package/dist/components/confirmation.d.ts +25 -0
  31. package/dist/components/confirmation.d.ts.map +1 -0
  32. package/dist/components/confirmation.js +120 -0
  33. package/dist/components/confirmation.js.map +1 -0
  34. package/dist/components/context-menu.d.ts +28 -0
  35. package/dist/components/context-menu.d.ts.map +1 -0
  36. package/dist/components/context-menu.js +36 -0
  37. package/dist/components/context-menu.js.map +1 -0
  38. package/dist/components/divider.d.ts +19 -0
  39. package/dist/components/divider.d.ts.map +1 -0
  40. package/dist/components/divider.js +240 -0
  41. package/dist/components/divider.js.map +1 -0
  42. package/dist/components/form-wrapper.d.ts +48 -0
  43. package/dist/components/form-wrapper.d.ts.map +1 -0
  44. package/dist/components/form-wrapper.js +122 -0
  45. package/dist/components/form-wrapper.js.map +1 -0
  46. package/dist/components/index.d.ts +24 -0
  47. package/dist/components/index.d.ts.map +1 -0
  48. package/dist/components/index.js +24 -0
  49. package/dist/components/index.js.map +1 -0
  50. package/dist/components/input.d.ts +17 -0
  51. package/dist/components/input.d.ts.map +1 -0
  52. package/dist/components/input.js +38 -0
  53. package/dist/components/input.js.map +1 -0
  54. package/dist/components/label.d.ts +17 -0
  55. package/dist/components/label.d.ts.map +1 -0
  56. package/dist/components/label.js +31 -0
  57. package/dist/components/label.js.map +1 -0
  58. package/dist/components/logo.d.ts +2 -0
  59. package/dist/components/logo.d.ts.map +1 -0
  60. package/dist/components/logo.js +6 -0
  61. package/dist/components/logo.js.map +1 -0
  62. package/dist/components/modal.d.ts +21 -0
  63. package/dist/components/modal.d.ts.map +1 -0
  64. package/dist/components/modal.js +67 -0
  65. package/dist/components/modal.js.map +1 -0
  66. package/dist/components/popover.d.ts +18 -0
  67. package/dist/components/popover.d.ts.map +1 -0
  68. package/dist/components/popover.js +243 -0
  69. package/dist/components/popover.js.map +1 -0
  70. package/dist/components/progress.d.ts +19 -0
  71. package/dist/components/progress.d.ts.map +1 -0
  72. package/dist/components/progress.js +38 -0
  73. package/dist/components/progress.js.map +1 -0
  74. package/dist/components/radio.d.ts +17 -0
  75. package/dist/components/radio.d.ts.map +1 -0
  76. package/dist/components/radio.js +62 -0
  77. package/dist/components/radio.js.map +1 -0
  78. package/dist/components/select.d.ts +13 -0
  79. package/dist/components/select.d.ts.map +1 -0
  80. package/dist/components/select.js +26 -0
  81. package/dist/components/select.js.map +1 -0
  82. package/dist/components/slider.d.ts +9 -0
  83. package/dist/components/slider.d.ts.map +1 -0
  84. package/dist/components/slider.js +32 -0
  85. package/dist/components/slider.js.map +1 -0
  86. package/dist/components/switch.d.ts +24 -0
  87. package/dist/components/switch.d.ts.map +1 -0
  88. package/dist/components/switch.js +92 -0
  89. package/dist/components/switch.js.map +1 -0
  90. package/dist/components/tabs.d.ts +20 -0
  91. package/dist/components/tabs.d.ts.map +1 -0
  92. package/dist/components/tabs.js +85 -0
  93. package/dist/components/tabs.js.map +1 -0
  94. package/dist/components/textarea.d.ts +17 -0
  95. package/dist/components/textarea.d.ts.map +1 -0
  96. package/dist/components/textarea.js +62 -0
  97. package/dist/components/textarea.js.map +1 -0
  98. package/dist/components/toast/index.d.ts +5 -0
  99. package/dist/components/toast/index.d.ts.map +1 -0
  100. package/dist/components/toast/index.js +4 -0
  101. package/dist/components/toast/index.js.map +1 -0
  102. package/dist/components/toast/store.d.ts +55 -0
  103. package/dist/components/toast/store.d.ts.map +1 -0
  104. package/dist/components/toast/store.js +76 -0
  105. package/dist/components/toast/store.js.map +1 -0
  106. package/dist/components/toast/toast.d.ts +10 -0
  107. package/dist/components/toast/toast.d.ts.map +1 -0
  108. package/dist/components/toast/toast.js +148 -0
  109. package/dist/components/toast/toast.js.map +1 -0
  110. package/dist/components/toast/toaster.d.ts +2 -0
  111. package/dist/components/toast/toaster.d.ts.map +1 -0
  112. package/dist/components/toast/toaster.js +391 -0
  113. package/dist/components/toast/toaster.js.map +1 -0
  114. package/dist/components/toast/use-toast.d.ts +9 -0
  115. package/dist/components/toast/use-toast.d.ts.map +1 -0
  116. package/dist/components/toast/use-toast.js +17 -0
  117. package/dist/components/toast/use-toast.js.map +1 -0
  118. package/dist/components/tooltip.d.ts +17 -0
  119. package/dist/components/tooltip.d.ts.map +1 -0
  120. package/dist/components/tooltip.js +227 -0
  121. package/dist/components/tooltip.js.map +1 -0
  122. package/dist/helpers.d.ts +9 -0
  123. package/dist/helpers.d.ts.map +1 -0
  124. package/dist/helpers.js +36 -0
  125. package/dist/helpers.js.map +1 -0
  126. package/dist/index.d.ts +6 -0
  127. package/dist/index.d.ts.map +1 -0
  128. package/dist/index.js +9 -0
  129. package/dist/index.js.map +1 -0
  130. package/dist/lib/utils.d.ts +3 -0
  131. package/dist/lib/utils.d.ts.map +1 -0
  132. package/dist/lib/utils.js +5 -0
  133. package/dist/lib/utils.js.map +1 -0
  134. package/dist/registry.d.ts +10 -0
  135. package/dist/registry.d.ts.map +1 -0
  136. package/dist/registry.js +418 -0
  137. package/dist/registry.js.map +1 -0
  138. package/dist/starters/presets.d.ts +4 -0
  139. package/dist/starters/presets.d.ts.map +1 -0
  140. package/dist/starters/presets.js +49 -0
  141. package/dist/starters/presets.js.map +1 -0
  142. package/dist/types.d.ts +35 -0
  143. package/dist/types.d.ts.map +1 -0
  144. package/dist/types.js +2 -0
  145. package/dist/types.js.map +1 -0
  146. package/package.json +66 -0
  147. package/src/categories.ts +84 -0
  148. package/src/helpers.ts +44 -0
  149. package/src/index.ts +29 -0
  150. package/src/lib/utils.ts +5 -0
  151. package/src/registry.ts +443 -0
  152. package/src/starters/presets.ts +51 -0
  153. package/src/types.ts +48 -0
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ export interface ModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ title?: React.ReactNode;
6
+ children: React.ReactNode;
7
+ footer?: React.ReactNode;
8
+ closeButton?: boolean;
9
+ size?: "sm" | "md" | "lg" | "xl";
10
+ onBackdropClick?: boolean;
11
+ className?: string;
12
+ contentClassName?: string;
13
+ overlayClassName?: string;
14
+ }
15
+ /**
16
+ * Modal component that displays content in a centered dialog with a backdrop overlay.
17
+ * Supports blocking interactions outside the modal and customizable sizing.
18
+ */
19
+ declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
20
+ export { Modal };
21
+ //# sourceMappingURL=modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/components/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AASD;;;GAGG;AACH,QAAA,MAAM,KAAK,mFAkIV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { useState, useEffect, useRef } from "react";
4
+ import { createPortal } from "react-dom";
5
+ import { cn } from "../lib/utils";
6
+ import { HiX } from "react-icons/hi";
7
+ const sizeClasses = {
8
+ sm: "max-w-sm",
9
+ md: "max-w-md",
10
+ lg: "max-w-lg",
11
+ xl: "max-w-2xl",
12
+ };
13
+ /**
14
+ * Modal component that displays content in a centered dialog with a backdrop overlay.
15
+ * Supports blocking interactions outside the modal and customizable sizing.
16
+ */
17
+ const Modal = React.forwardRef(({ isOpen, onClose, title, children, footer, closeButton = true, size = "md", onBackdropClick = true, className, contentClassName, overlayClassName, }, ref) => {
18
+ const [mounted, setMounted] = useState(false);
19
+ const modalRef = useRef(null);
20
+ // Use combined refs
21
+ React.useImperativeHandle(ref, () => modalRef.current);
22
+ /**
23
+ * Handle mount to prevent hydration issues
24
+ */
25
+ useEffect(() => {
26
+ setMounted(true);
27
+ }, []);
28
+ /**
29
+ * Handle escape key to close modal
30
+ */
31
+ useEffect(() => {
32
+ if (!isOpen)
33
+ return;
34
+ const handleKeyDown = (event) => {
35
+ if (event.key === "Escape") {
36
+ onClose();
37
+ }
38
+ };
39
+ document.addEventListener("keydown", handleKeyDown);
40
+ return () => {
41
+ document.removeEventListener("keydown", handleKeyDown);
42
+ };
43
+ }, [isOpen, onClose]);
44
+ /**
45
+ * Prevent body scroll when modal is open
46
+ */
47
+ useEffect(() => {
48
+ if (isOpen) {
49
+ document.body.style.overflow = "hidden";
50
+ return () => {
51
+ document.body.style.overflow = "unset";
52
+ };
53
+ }
54
+ }, [isOpen]);
55
+ if (!mounted || !isOpen) {
56
+ return null;
57
+ }
58
+ const handleBackdropClick = () => {
59
+ if (onBackdropClick) {
60
+ onClose();
61
+ }
62
+ };
63
+ return createPortal(_jsxs("div", { className: cn("fixed inset-0 z-50 flex items-center justify-center", overlayClassName), onClick: handleBackdropClick, children: [_jsx("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm" }), _jsxs("div", { ref: modalRef, role: "dialog", "aria-modal": "true", className: cn("relative w-full mx-4 bg-background-900 rounded-lg border border-background-700 shadow-xl", sizeClasses[size], className), onClick: (e) => e.stopPropagation(), children: [(title || closeButton) && (_jsxs("div", { className: "flex items-center justify-between border-b border-background-700 p-4", children: [title && (_jsx("h4", { className: "font-semibold", children: title })), !title && closeButton && _jsx("div", { className: "flex-1" }), closeButton && (_jsx("button", { onClick: onClose, className: "ml-auto text-foreground-500 hover:text-foreground-200 transition-colors p-1", "aria-label": "Close modal", children: _jsx(HiX, { className: "w-5 h-5" }) }))] })), _jsx("div", { className: cn("px-4 py-4", contentClassName), children: children }), footer && (_jsx("div", { className: "border-t border-background-700 p-2", children: footer }))] })] }), document.body);
64
+ });
65
+ Modal.displayName = "Modal";
66
+ export { Modal };
67
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/components/modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,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GACH,CACN,EACA,CAAC,KAAK,IAAI,WAAW,IAAI,cAAK,SAAS,EAAC,QAAQ,GAAG,EACnD,WAAW,IAAI,CACd,iBACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,6EAA6E,gBAC5E,aAAa,YAExB,KAAC,GAAG,IAAC,SAAS,EAAC,SAAS,GAAG,GACpB,CACV,IACG,CACP,EAGD,cAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC,YAC9C,QAAQ,GACL,EAGL,MAAM,IAAI,CACT,cAAK,SAAS,EAAC,oCAAoC,YAChD,MAAM,GACH,CACP,IACG,IACF,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ type PopoverPosition = "top" | "right" | "bottom" | "left";
3
+ export interface PopoverProps {
4
+ children: React.ReactNode;
5
+ content: React.ReactNode;
6
+ position?: PopoverPosition;
7
+ className?: string;
8
+ contentClassName?: string;
9
+ isOpen?: boolean;
10
+ onOpenChange?: (isOpen: boolean) => void;
11
+ }
12
+ /**
13
+ * Popover component that displays floating content triggered by click.
14
+ * Supports positioning in four directions with click-outside-to-close behavior.
15
+ */
16
+ declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
17
+ export { Popover };
18
+ //# sourceMappingURL=popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAW3D,KAAK,eAAe,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AA+KD;;;GAGG;AACH,QAAA,MAAM,OAAO,qFAqLZ,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,243 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React, { useState, useRef, useEffect } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { cn } from "../lib/utils";
5
+ // Layout and spacing constants
6
+ const ARROW_SIZE = 12;
7
+ const ARROW_MASK_THICKNESS = 2;
8
+ const POPOVER_GAP = 8;
9
+ const ARROW_POSITIONING_SIZE = 6;
10
+ const PopoverArrow = ({ position }) => {
11
+ const [borderWidth, setBorderWidth] = React.useState(1);
12
+ React.useEffect(() => {
13
+ const root = document.documentElement;
14
+ const borderWidthStr = getComputedStyle(root).getPropertyValue("--border-width-base").trim();
15
+ const width = parseFloat(borderWidthStr) || 1;
16
+ setBorderWidth(width);
17
+ }, []);
18
+ /**
19
+ * Calculate SVG polygon points for the arrow triangle.
20
+ * Creates a triangle pointing in the specified direction.
21
+ */
22
+ const getArrowPoints = () => {
23
+ const halfSize = ARROW_SIZE / 2;
24
+ switch (position) {
25
+ case "top":
26
+ return `${halfSize},${ARROW_SIZE} 0,0 ${ARROW_SIZE},0`;
27
+ case "bottom":
28
+ return `${halfSize},0 0,${ARROW_SIZE} ${ARROW_SIZE},${ARROW_SIZE}`;
29
+ case "left":
30
+ return `${ARROW_SIZE},${halfSize} 0,0 0,${ARROW_SIZE}`;
31
+ case "right":
32
+ return `0,${halfSize} ${ARROW_SIZE},0 ${ARROW_SIZE},${ARROW_SIZE}`;
33
+ }
34
+ };
35
+ /**
36
+ * Calculate border lines for the arrow.
37
+ * Excludes the edge that connects to the popover to avoid double borders.
38
+ */
39
+ const getBorderLines = () => {
40
+ const halfSize = ARROW_SIZE / 2;
41
+ switch (position) {
42
+ case "top":
43
+ return [
44
+ { x1: halfSize, y1: ARROW_SIZE, x2: 0, y2: 0 },
45
+ { x1: halfSize, y1: ARROW_SIZE, x2: ARROW_SIZE, y2: 0 },
46
+ ];
47
+ case "bottom":
48
+ return [
49
+ { x1: halfSize, y1: 0, x2: 0, y2: ARROW_SIZE },
50
+ { x1: halfSize, y1: 0, x2: ARROW_SIZE, y2: ARROW_SIZE },
51
+ ];
52
+ case "left":
53
+ return [
54
+ { x1: ARROW_SIZE, y1: halfSize, x2: 0, y2: 0 },
55
+ { x1: ARROW_SIZE, y1: halfSize, x2: 0, y2: ARROW_SIZE },
56
+ ];
57
+ case "right":
58
+ return [
59
+ { x1: 0, y1: halfSize, x2: ARROW_SIZE, y2: 0 },
60
+ { x1: 0, y1: halfSize, x2: ARROW_SIZE, y2: ARROW_SIZE },
61
+ ];
62
+ }
63
+ };
64
+ /**
65
+ * Calculate positioning styles for the arrow relative to the popover.
66
+ * Accounts for border width and positions the arrow at the popover edge.
67
+ */
68
+ const getArrowStyles = () => {
69
+ const borderOffset = borderWidth / 2;
70
+ switch (position) {
71
+ case "top":
72
+ return {
73
+ top: `calc(100% + ${borderOffset}px)`,
74
+ left: "50%",
75
+ transform: `translateX(-50%) translateY(-${borderOffset}px)`,
76
+ };
77
+ case "bottom":
78
+ return {
79
+ bottom: `calc(100% + ${borderOffset}px)`,
80
+ left: "50%",
81
+ transform: `translateX(-50%) translateY(${borderOffset}px)`,
82
+ };
83
+ case "left":
84
+ return {
85
+ left: `calc(100% + ${borderOffset}px)`,
86
+ top: "50%",
87
+ transform: `translateY(-50%) translateX(-${borderOffset}px)`,
88
+ };
89
+ case "right":
90
+ return {
91
+ right: `calc(100% + ${borderOffset}px)`,
92
+ top: "50%",
93
+ transform: `translateY(-50%) translateX(${borderOffset}px)`,
94
+ };
95
+ }
96
+ };
97
+ /**
98
+ * Get the connecting edge mask based on arrow position.
99
+ * This hides the popover border at the arrow connection point.
100
+ */
101
+ const getMaskRect = () => {
102
+ switch (position) {
103
+ case "top":
104
+ return (_jsx("rect", { x: "0", y: ARROW_SIZE - ARROW_MASK_THICKNESS, width: ARROW_SIZE, height: ARROW_MASK_THICKNESS, fill: "black" }));
105
+ case "bottom":
106
+ return _jsx("rect", { x: "0", y: "0", width: ARROW_SIZE, height: ARROW_MASK_THICKNESS, fill: "black" });
107
+ case "left":
108
+ return (_jsx("rect", { x: ARROW_SIZE - ARROW_MASK_THICKNESS, y: "0", width: ARROW_MASK_THICKNESS, height: ARROW_SIZE, fill: "black" }));
109
+ case "right":
110
+ return _jsx("rect", { x: "0", y: "0", width: ARROW_MASK_THICKNESS, height: ARROW_SIZE, fill: "black" });
111
+ }
112
+ };
113
+ return (_jsxs("svg", { width: ARROW_SIZE, height: ARROW_SIZE, viewBox: `0 0 ${ARROW_SIZE} ${ARROW_SIZE}`, className: "absolute pointer-events-none", style: getArrowStyles(), children: [_jsx("defs", { children: _jsxs("mask", { id: `popover-arrow-mask-${position}`, children: [_jsx("rect", { width: ARROW_SIZE, height: ARROW_SIZE, fill: "white" }), getMaskRect()] }) }), _jsx("polygon", { points: getArrowPoints(), fill: "var(--color-background-900)", mask: `url(#popover-arrow-mask-${position})` }), getBorderLines().map((line, idx) => (_jsx("line", { x1: line.x1, y1: line.y1, x2: line.x2, y2: line.y2, stroke: "var(--color-background-700)", strokeWidth: borderWidth, strokeLinecap: "round" }, idx)))] }));
114
+ };
115
+ /**
116
+ * Popover component that displays floating content triggered by click.
117
+ * Supports positioning in four directions with click-outside-to-close behavior.
118
+ */
119
+ const Popover = React.forwardRef(({ children, content, position = "bottom", className, contentClassName, isOpen: controlledIsOpen, onOpenChange, }, ref) => {
120
+ const [isOpen, setIsOpen] = useState(controlledIsOpen ?? false);
121
+ const [isPositioned, setIsPositioned] = useState(false);
122
+ const [popoverPosition, setPopoverPosition] = useState({
123
+ top: 0,
124
+ left: 0,
125
+ });
126
+ const triggerRef = useRef(null);
127
+ // Handle controlled/uncontrolled component
128
+ const open = controlledIsOpen !== undefined ? controlledIsOpen : isOpen;
129
+ const setOpen = (newOpen) => {
130
+ if (controlledIsOpen === undefined) {
131
+ setIsOpen(newOpen);
132
+ }
133
+ onOpenChange?.(newOpen);
134
+ };
135
+ /**
136
+ * Calculate popover position based on trigger element and position preference.
137
+ * Positions the popover with appropriate spacing and arrow alignment.
138
+ * Uses a separate effect to allow immediate rendering while still applying positioning.
139
+ */
140
+ useEffect(() => {
141
+ if (!open || !triggerRef.current)
142
+ return;
143
+ const triggerRect = triggerRef.current.getBoundingClientRect();
144
+ let top = 0;
145
+ let left = 0;
146
+ switch (position) {
147
+ case "top":
148
+ top = triggerRect.top - POPOVER_GAP - ARROW_POSITIONING_SIZE;
149
+ left = triggerRect.left + triggerRect.width / 2;
150
+ break;
151
+ case "bottom":
152
+ top = triggerRect.bottom + POPOVER_GAP + ARROW_POSITIONING_SIZE;
153
+ left = triggerRect.left + triggerRect.width / 2;
154
+ break;
155
+ case "left":
156
+ top = triggerRect.top + triggerRect.height / 2;
157
+ left = triggerRect.left - POPOVER_GAP - ARROW_POSITIONING_SIZE;
158
+ break;
159
+ case "right":
160
+ top = triggerRect.top + triggerRect.height / 2;
161
+ left = triggerRect.right + POPOVER_GAP + ARROW_POSITIONING_SIZE;
162
+ break;
163
+ }
164
+ setPopoverPosition({ top, left });
165
+ }, [open, position]);
166
+ /**
167
+ * Mark as positioned after position calculation to prevent layout shift.
168
+ * Uses a separate effect to ensure positioning is calculated first.
169
+ */
170
+ useEffect(() => {
171
+ if (!open) {
172
+ setIsPositioned(false);
173
+ return;
174
+ }
175
+ setIsPositioned(true);
176
+ }, [open]);
177
+ /**
178
+ * Handle trigger click to toggle popover visibility.
179
+ */
180
+ const handleTriggerClick = (e) => {
181
+ e.stopPropagation();
182
+ setOpen(!open);
183
+ };
184
+ /**
185
+ * Handle click outside popover to close it.
186
+ * Keep track of popover content DOM node to prevent closing on internal clicks.
187
+ */
188
+ const popoverContentRef = useRef(null);
189
+ useEffect(() => {
190
+ if (!open)
191
+ return;
192
+ const handleClickOutside = (e) => {
193
+ const target = e.target;
194
+ if (triggerRef.current &&
195
+ !triggerRef.current.contains(target) &&
196
+ popoverContentRef.current &&
197
+ !popoverContentRef.current.contains(target)) {
198
+ setOpen(false);
199
+ }
200
+ };
201
+ document.addEventListener("click", handleClickOutside);
202
+ return () => {
203
+ document.removeEventListener("click", handleClickOutside);
204
+ };
205
+ }, [open]);
206
+ /**
207
+ * Handle Escape key to close popover.
208
+ */
209
+ useEffect(() => {
210
+ if (!open)
211
+ return;
212
+ const handleKeyDown = (event) => {
213
+ if (event.key === "Escape") {
214
+ setOpen(false);
215
+ }
216
+ };
217
+ document.addEventListener("keydown", handleKeyDown);
218
+ return () => {
219
+ document.removeEventListener("keydown", handleKeyDown);
220
+ };
221
+ }, [open]);
222
+ /**
223
+ * CSS classes for positioning the popover container based on direction.
224
+ * Applies negative transforms to properly center the popover relative to trigger.
225
+ */
226
+ const positionClasses = {
227
+ top: "-translate-x-1/2 -translate-y-full",
228
+ bottom: "-translate-x-1/2 translate-y-0",
229
+ left: "-translate-y-1/2 -translate-x-full",
230
+ right: "-translate-y-1/2 translate-x-0",
231
+ };
232
+ return (_jsxs(_Fragment, { children: [_jsx("div", { ref: triggerRef, onClick: handleTriggerClick, className: cn("inline-block", className), children: children }), open &&
233
+ createPortal(_jsx("div", { role: "dialog", className: cn("fixed pointer-events-none z-50 transition-opacity", positionClasses[position], {
234
+ "opacity-0": !isPositioned,
235
+ "opacity-100": isPositioned,
236
+ }), style: {
237
+ top: `${popoverPosition.top}px`,
238
+ left: `${popoverPosition.left}px`,
239
+ }, children: _jsxs("div", { ref: popoverContentRef, onClick: (e) => e.stopPropagation(), className: cn("relative pointer-events-auto bg-background-900 text-foreground-50 text-sm p-3 rounded-lg shadow-lg border border-background-700", contentClassName), children: [content, _jsx(PopoverArrow, { position: position })] }) }), document.body)] }));
240
+ });
241
+ Popover.displayName = "Popover";
242
+ export { Popover };
243
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,+BAA+B;AAC/B,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,sBAAsB,GAAG,CAAC,CAAC;AA0BjC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7F,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9C,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP;;;OAGG;IACH,MAAM,cAAc,GAAG,GAAW,EAAE;QAClC,MAAM,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAC;QAEhC,QAAQ,QAAQ,EAAE,CAAC;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";
3
+ declare const progressVariants: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare const progressFillVariants: (props?: ({
7
+ variant?: "default" | "success" | "warning" | "error" | null | undefined;
8
+ animated?: boolean | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof progressVariants>, VariantProps<typeof progressFillVariants> {
11
+ value?: number;
12
+ max?: number;
13
+ indeterminate?: boolean;
14
+ label?: string;
15
+ showValue?: boolean;
16
+ }
17
+ declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
18
+ export { Progress, progressVariants, progressFillVariants };
19
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EASpB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;8EAiBzB,CAAC;AAEF,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAC5D,YAAY,CAAC,OAAO,gBAAgB,CAAC,EACrC,YAAY,CAAC,OAAO,oBAAoB,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,QAAQ,sFAsDb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../lib/utils";
6
+ const progressVariants = cva("relative w-full overflow-hidden rounded-full", {
7
+ variants: {
8
+ size: {
9
+ sm: "h-1",
10
+ md: "h-2",
11
+ lg: "h-3",
12
+ },
13
+ },
14
+ defaultVariants: { size: "md" },
15
+ });
16
+ const progressFillVariants = cva("h-full transition-all duration-300 ease-out rounded-full", {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-accent-500",
20
+ success: "bg-success-500",
21
+ warning: "bg-warning-500",
22
+ error: "bg-danger-500",
23
+ },
24
+ animated: {
25
+ true: "animate-pulse",
26
+ false: "",
27
+ },
28
+ },
29
+ defaultVariants: { variant: "default", animated: false },
30
+ });
31
+ const Progress = React.forwardRef(({ className, size = "md", variant = "default", animated = false, value = 0, max = 100, indeterminate = false, label, showValue = false, ...props }, ref) => {
32
+ const clampedValue = Math.min(Math.max(value, 0), max);
33
+ const percentage = (clampedValue / max) * 100;
34
+ return (_jsxs("div", { className: cn("w-full", showValue || label ? "space-y-1" : ""), children: [(label || showValue) && (_jsxs("div", { className: "flex items-center justify-between text-sm text-foreground-400", children: [label && _jsx("span", { children: label }), showValue && !indeterminate && (_jsxs("span", { className: "tabular-nums", children: [Math.round(percentage), "%"] }))] })), _jsx("div", { ref: ref, role: "progressbar", "aria-valuenow": indeterminate ? undefined : clampedValue, "aria-valuemin": 0, "aria-valuemax": max, "aria-label": label, className: cn(progressVariants({ size }), "bg-background-700", className), ...props, children: _jsx("div", { className: cn(progressFillVariants({ variant, animated: animated || indeterminate }), indeterminate && "w-1/3 animate-[progress-indeterminate_1.5s_ease-in-out_infinite]"), style: indeterminate ? undefined : { width: `${percentage}%` } }) })] }));
35
+ });
36
+ Progress.displayName = "Progress";
37
+ export { Progress, progressVariants, progressFillVariants };
38
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,gBAAgB,GAAG,GAAG,CAAC,8CAA8C,EAAE;IAC3E,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,KAAK;SACV;KACF;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,GAAG,CAC9B,0DAA0D,EAC1D;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,eAAe;YACxB,OAAO,EAAE,gBAAgB;YACzB,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;SACvB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;SACV;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;CACzD,CACF,CAAC;AAaF,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,SAAS,EACT,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,SAAS,EACnB,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,CAAC,EACT,GAAG,GAAG,GAAG,EACT,aAAa,GAAG,KAAK,EACrB,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,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Variants: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ checked?: boolean | null | undefined;
6
+ disabled?: boolean | null | undefined;
7
+ error?: boolean | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "checked" | "disabled">, VariantProps<typeof radioVariants> {
10
+ label?: React.ReactNode;
11
+ description?: React.ReactNode;
12
+ helperText?: React.ReactNode;
13
+ helperTextError?: boolean;
14
+ }
15
+ declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
16
+ export { Radio, radioVariants };
17
+ //# sourceMappingURL=radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/components/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;;;;8EA6BlB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,EACnG,YAAY,CAAC,OAAO,aAAa,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,KAAK,qFAyHV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { useState, useId } from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../lib/utils";
6
+ const radioVariants = cva("inline-flex items-center justify-center rounded-full border-2 transition-all cursor-pointer flex-shrink-0", {
7
+ variants: {
8
+ size: {
9
+ sm: "w-4 h-4",
10
+ md: "w-5 h-5",
11
+ lg: "w-6 h-6",
12
+ },
13
+ checked: {
14
+ true: "bg-accent-500 border-accent-500",
15
+ false: "bg-background-800 border-background-700",
16
+ },
17
+ disabled: {
18
+ true: "opacity-60 cursor-not-allowed",
19
+ false: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/50",
20
+ },
21
+ error: {
22
+ true: "border-danger-600 bg-danger-600/10",
23
+ false: "",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ size: "md",
28
+ checked: false,
29
+ disabled: false,
30
+ error: false,
31
+ },
32
+ });
33
+ const Radio = React.forwardRef(({ className, size = "md", disabled = false, error = false, label, description, helperText, helperTextError = false, checked: checkedProp, defaultChecked, onChange, id, ...props }, ref) => {
34
+ const [internalChecked, setInternalChecked] = useState(checkedProp === true);
35
+ const generatedId = useId();
36
+ const isControlled = checkedProp !== undefined;
37
+ const checked = isControlled ? (checkedProp ?? false) : internalChecked;
38
+ const handleChange = (e) => {
39
+ if (!isControlled) {
40
+ setInternalChecked(e.target.checked);
41
+ }
42
+ onChange?.(e);
43
+ };
44
+ const radioId = id || `radio-${generatedId}`;
45
+ return (_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("input", { ref: ref, type: "radio", id: radioId, checked: checked, onChange: handleChange, disabled: disabled ?? false, className: "hidden", "aria-label": typeof label === "string" ? label : undefined, suppressHydrationWarning: true, ...props }), _jsx("div", { className: cn(radioVariants({
46
+ size,
47
+ checked,
48
+ disabled,
49
+ error,
50
+ className,
51
+ })), onClick: () => {
52
+ if (!disabled) {
53
+ const input = document.getElementById(radioId);
54
+ if (input) {
55
+ input.click();
56
+ }
57
+ }
58
+ }, role: "presentation", children: checked && (_jsx("div", { className: cn("bg-accent-50 rounded-full", size === "sm" && "w-2 h-2", size === "md" && "w-2.5 h-2.5", size === "lg" && "w-3 h-3") })) }), (label || description) && (_jsxs("div", { className: "flex flex-col gap-1", children: [label && (_jsx("label", { htmlFor: radioId, className: cn("text-foreground-300 transition-colors cursor-pointer select-none pt-1", disabled && "opacity-60 cursor-not-allowed text-foreground-500", size === "sm" && "text-xs", size === "md" && "text-sm", size === "lg" && "text-base"), suppressHydrationWarning: true, children: label })), description && (_jsx("p", { className: cn("text-xs transition-colors", disabled && "opacity-60 text-foreground-500", error ? "text-danger-600" : "text-foreground-500"), children: description }))] }))] }), helperText && (_jsx("p", { className: cn("text-xs mt-2 ml-8 transition-colors", helperTextError ? "text-danger-600" : "text-foreground-500"), children: helperText }))] }));
59
+ });
60
+ Radio.displayName = "Radio";
61
+ export { Radio, radioVariants };
62
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/components/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,aAAa,GAAG,GAAG,CACvB,2GAA2G,EAC3G;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;SACd;QACD,OAAO,EAAE;YACP,IAAI,EAAE,iCAAiC;YACvC,KAAK,EAAE,yCAAyC;SACjD;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,kFAAkF;SAC1F;QACD,KAAK,EAAE;YACL,IAAI,EAAE,oCAAoC;YAC1C,KAAK,EAAE,EAAE;SACV;KACF;IACD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WAAW,GACV,CACL,IACG,CACP,IACG,EACL,UAAU,IAAI,CACb,YACE,SAAS,EAAE,EAAE,CACX,qCAAqC,EACrC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,CAC5D,YAEA,UAAU,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
13
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAIzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AAEzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,oKAkBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAc1B,CAAA;AAIF,QAAA,MAAM,aAAa,8JA6BjB,CAAA;AAGF,QAAA,MAAM,UAAU,2JAoBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import * as SelectPrimitive from "@radix-ui/react-select";
5
+ import { cn } from "../lib/utils";
6
+ import { FaCheck, FaChevronDown } from "react-icons/fa6";
7
+ const Select = SelectPrimitive.Root;
8
+ const SelectGroup = SelectPrimitive.Group;
9
+ const SelectValue = SelectPrimitive.Value;
10
+ const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-9 w-full items-center justify-between rounded-lg border border-background-700 bg-background-800/50 px-3 py-2 text-sm text-foreground-50 hover:border-background-600 focus:outline-none focus:ring-2 focus:ring-accent-500 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), suppressHydrationWarning: true, ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(FaChevronDown, { className: "w-2.5 h-2.5" }) })] })));
11
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
12
+ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(FaChevronDown, { className: "w-2.5 h-2.5" }) })));
13
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
14
+ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(FaChevronDown, { className: "w-2.5 h-2.5" }) })));
15
+ SelectScrollDownButton.displayName =
16
+ SelectPrimitive.ScrollDownButton.displayName;
17
+ const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn("relative z-50 overflow-hidden rounded-lg border border-background-700 bg-background-900 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" &&
18
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1 w-fit", position === "popper" &&
19
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
20
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
21
+ const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-background-700/50 focus:bg-background-700/50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(FaCheck, { className: "w-3 h-3 text-accent-500" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
22
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
23
+ const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-background-700", className), ...props })));
24
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
25
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
26
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAA;AAEnC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AAEzC,MAAM,WAAW,GAAG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,KAAK,CAAC,UAAU,CAGtC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC,KACzD,KAAK,GACT,CACH,CAAC,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAEnE,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import * as SliderPrimitive from '@radix-ui/react-slider';
3
+ declare const Root: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
4
+ disabled?: boolean;
5
+ size?: "sm" | "md" | "lg";
6
+ } & React.RefAttributes<HTMLSpanElement>>;
7
+ declare const Thumb: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderThumbProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
8
+ export { Root, Thumb };
9
+ //# sourceMappingURL=slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAO1D,QAAA,MAAM,IAAI;eAEmE,OAAO;WAAS,IAAI,GAAG,IAAI,GAAG,IAAI;yCAgC7G,CAAC;AAGH,QAAA,MAAM,KAAK,8JAmBT,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC"}