@justanarthur/modo-ui 0.0.0-stage → 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 (172) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.beui +21 -0
  3. package/LICENSE.fluid-functionalism +21 -0
  4. package/LICENSE.motion-primitives +21 -0
  5. package/LICENSE.sileo +21 -0
  6. package/README.md +608 -2
  7. package/dist/base.css +994 -0
  8. package/dist/blocks/sidebar-app/index.d.ts +34 -0
  9. package/dist/blocks/sidebar-app/index.js +34 -0
  10. package/dist/components/badge/index.d.ts +59 -0
  11. package/dist/components/badge/index.js +18 -0
  12. package/dist/components/button/index.d.ts +59 -0
  13. package/dist/components/button/index.js +16 -0
  14. package/dist/components/card/index.d.ts +141 -0
  15. package/dist/components/card/index.js +44 -0
  16. package/dist/components/inputs/checkbox-group/index.d.ts +50 -0
  17. package/dist/components/inputs/checkbox-group/index.js +23 -0
  18. package/dist/components/inputs/color-picker/index.d.ts +137 -0
  19. package/dist/components/inputs/color-picker/index.js +37 -0
  20. package/dist/components/inputs/combobox/index.d.ts +161 -0
  21. package/dist/components/inputs/combobox/index.js +41 -0
  22. package/dist/components/inputs/date-time/calendar/index.d.ts +45 -0
  23. package/dist/components/inputs/date-time/calendar/index.js +20 -0
  24. package/dist/components/inputs/date-time/date-picker/index.d.ts +82 -0
  25. package/dist/components/inputs/date-time/date-picker/index.js +34 -0
  26. package/dist/components/inputs/date-time/date-range-picker/index.d.ts +64 -0
  27. package/dist/components/inputs/date-time/date-range-picker/index.js +33 -0
  28. package/dist/components/inputs/date-time/duration-picker/index.d.ts +57 -0
  29. package/dist/components/inputs/date-time/duration-picker/index.js +33 -0
  30. package/dist/components/inputs/date-time/month-picker/index.d.ts +57 -0
  31. package/dist/components/inputs/date-time/month-picker/index.js +32 -0
  32. package/dist/components/inputs/date-time/time-picker/index.d.ts +59 -0
  33. package/dist/components/inputs/date-time/time-picker/index.js +33 -0
  34. package/dist/components/inputs/input/index.d.ts +84 -0
  35. package/dist/components/inputs/input/index.js +20 -0
  36. package/dist/components/inputs/input-copy/index.d.ts +44 -0
  37. package/dist/components/inputs/input-copy/index.js +18 -0
  38. package/dist/components/inputs/input-message/index.d.ts +125 -0
  39. package/dist/components/inputs/input-message/index.js +27 -0
  40. package/dist/components/inputs/radio-group/index.d.ts +58 -0
  41. package/dist/components/inputs/radio-group/index.js +22 -0
  42. package/dist/components/inputs/search/index.d.ts +83 -0
  43. package/dist/components/inputs/search/index.js +28 -0
  44. package/dist/components/inputs/select/index.d.ts +105 -0
  45. package/dist/components/inputs/select/index.js +37 -0
  46. package/dist/components/inputs/slider/index.d.ts +108 -0
  47. package/dist/components/inputs/slider/index.js +16 -0
  48. package/dist/components/inputs/switch/index.d.ts +43 -0
  49. package/dist/components/inputs/switch/index.js +16 -0
  50. package/dist/components/navigation/accordion/index.d.ts +117 -0
  51. package/dist/components/navigation/accordion/index.js +30 -0
  52. package/dist/components/navigation/sidebar/index.d.ts +388 -0
  53. package/dist/components/navigation/sidebar/index.js +101 -0
  54. package/dist/components/navigation/tabs/index.d.ts +70 -0
  55. package/dist/components/navigation/tabs/index.js +25 -0
  56. package/dist/components/navigation/tabs-subtle/index.d.ts +73 -0
  57. package/dist/components/navigation/tabs-subtle/index.js +23 -0
  58. package/dist/components/overlays/alert-dialog/index.d.ts +67 -0
  59. package/dist/components/overlays/alert-dialog/index.js +24 -0
  60. package/dist/components/overlays/command/index.d.ts +121 -0
  61. package/dist/components/overlays/command/index.js +39 -0
  62. package/dist/components/overlays/context-menu/index.d.ts +97 -0
  63. package/dist/components/overlays/context-menu/index.js +32 -0
  64. package/dist/components/overlays/dialog/index.d.ts +130 -0
  65. package/dist/components/overlays/dialog/index.js +39 -0
  66. package/dist/components/overlays/dropdown/index.d.ts +222 -0
  67. package/dist/components/overlays/dropdown/index.js +47 -0
  68. package/dist/components/overlays/popover/index.d.ts +87 -0
  69. package/dist/components/overlays/popover/index.js +28 -0
  70. package/dist/components/overlays/preview-card/index.d.ts +75 -0
  71. package/dist/components/overlays/preview-card/index.js +21 -0
  72. package/dist/components/overlays/sheet/index.d.ts +67 -0
  73. package/dist/components/overlays/sheet/index.js +26 -0
  74. package/dist/components/overlays/toast/index.d.ts +107 -0
  75. package/dist/components/overlays/toast/index.js +23 -0
  76. package/dist/components/overlays/tooltip/index.d.ts +75 -0
  77. package/dist/components/overlays/tooltip/index.js +19 -0
  78. package/dist/components/table/index.d.ts +44 -0
  79. package/dist/components/table/index.js +28 -0
  80. package/dist/components/thinking-indicator/index.d.ts +32 -0
  81. package/dist/components/thinking-indicator/index.js +15 -0
  82. package/dist/index.d.ts +3926 -0
  83. package/dist/index.js +513 -0
  84. package/dist/preset.d.ts +104 -0
  85. package/dist/preset.js +124 -0
  86. package/dist/primitives/code/index.d.ts +23 -0
  87. package/dist/primitives/code/index.js +12 -0
  88. package/dist/primitives/craft/index.d.ts +31 -0
  89. package/dist/primitives/craft/index.js +13 -0
  90. package/dist/primitives/fluid-hover/index.d.ts +233 -0
  91. package/dist/primitives/fluid-hover/index.js +27 -0
  92. package/dist/primitives/morph/index.d.ts +127 -0
  93. package/dist/primitives/morph/index.js +21 -0
  94. package/dist/primitives/motion/index.d.ts +115 -0
  95. package/dist/primitives/motion/index.js +20 -0
  96. package/dist/primitives/scroll-area/index.d.ts +41 -0
  97. package/dist/primitives/scroll-area/index.js +13 -0
  98. package/dist/primitives/sizes/index.d.ts +128 -0
  99. package/dist/primitives/sizes/index.js +22 -0
  100. package/dist/primitives/surface/index.d.ts +69 -0
  101. package/dist/primitives/surface/index.js +18 -0
  102. package/dist/shared/components-0f0as45n.js +17 -0
  103. package/dist/shared/components-40j34hdb.js +986 -0
  104. package/dist/shared/components-4hh0gm0v.js +292 -0
  105. package/dist/shared/components-4xxddc44.js +15 -0
  106. package/dist/shared/components-4xxtggzp.js +110 -0
  107. package/dist/shared/components-54nf2x99.js +293 -0
  108. package/dist/shared/components-5pkcfprd.js +232 -0
  109. package/dist/shared/components-5vxtcp88.js +9 -0
  110. package/dist/shared/components-5zry9te1.js +152 -0
  111. package/dist/shared/components-61ckf42z.js +220 -0
  112. package/dist/shared/components-6hzwfmfd.js +58 -0
  113. package/dist/shared/components-6phwsry6.js +361 -0
  114. package/dist/shared/components-6t6nr33r.js +86 -0
  115. package/dist/shared/components-6y1th6k4.js +111 -0
  116. package/dist/shared/components-74c20v2f.js +32 -0
  117. package/dist/shared/components-7cqq1sqy.js +193 -0
  118. package/dist/shared/components-7gv95yfy.js +496 -0
  119. package/dist/shared/components-7nww01w4.js +375 -0
  120. package/dist/shared/components-7zp99w5d.js +62 -0
  121. package/dist/shared/components-8hk9ve3r.js +1200 -0
  122. package/dist/shared/components-8hzbsfbd.js +123 -0
  123. package/dist/shared/components-9p8s8n5q.js +171 -0
  124. package/dist/shared/components-aaq3yk4f.js +304 -0
  125. package/dist/shared/components-bf2d9k02.js +484 -0
  126. package/dist/shared/components-bkvb6nem.js +63 -0
  127. package/dist/shared/components-brnzrp2t.js +262 -0
  128. package/dist/shared/components-csxz9f52.js +42 -0
  129. package/dist/shared/components-de8xsm9y.js +22 -0
  130. package/dist/shared/components-dg0w8g5p.js +26 -0
  131. package/dist/shared/components-dphg9gjr.js +42 -0
  132. package/dist/shared/components-e46kf6cp.js +298 -0
  133. package/dist/shared/components-ed7cmssr.js +105 -0
  134. package/dist/shared/components-ess3ch6w.js +137 -0
  135. package/dist/shared/components-gjfrycb5.js +984 -0
  136. package/dist/shared/components-gndm6am4.js +128 -0
  137. package/dist/shared/components-hjkrv00c.js +191 -0
  138. package/dist/shared/components-hzfp4tjb.js +270 -0
  139. package/dist/shared/components-j65qt1mq.js +719 -0
  140. package/dist/shared/components-jw16snbn.js +19 -0
  141. package/dist/shared/components-jxgznftn.js +146 -0
  142. package/dist/shared/components-kf2ehztc.js +216 -0
  143. package/dist/shared/components-kpbcms10.js +9 -0
  144. package/dist/shared/components-m5br529r.js +141 -0
  145. package/dist/shared/components-nn6xezy2.js +1828 -0
  146. package/dist/shared/components-nnnd2xef.js +9 -0
  147. package/dist/shared/components-p2vmyfe1.js +345 -0
  148. package/dist/shared/components-peg09pzs.js +79 -0
  149. package/dist/shared/components-r22vtgqc.js +45 -0
  150. package/dist/shared/components-r2gke5p6.js +1759 -0
  151. package/dist/shared/components-r43mqnd6.js +160 -0
  152. package/dist/shared/components-r4jt6hgd.js +58 -0
  153. package/dist/shared/components-rc63qsy6.js +159 -0
  154. package/dist/shared/components-s3yfvfkr.js +149 -0
  155. package/dist/shared/components-s5pkbjx1.js +445 -0
  156. package/dist/shared/components-tad5h7ta.js +346 -0
  157. package/dist/shared/components-taxmgbnh.js +120 -0
  158. package/dist/shared/components-tm88ghva.js +215 -0
  159. package/dist/shared/components-v7es8aan.js +144 -0
  160. package/dist/shared/components-vb033rns.js +28 -0
  161. package/dist/shared/components-vc1k7yv2.js +30 -0
  162. package/dist/shared/components-vktws5r6.js +667 -0
  163. package/dist/shared/components-x2xyckd5.js +198 -0
  164. package/dist/shared/components-x3rz4cyn.js +61 -0
  165. package/dist/shared/components-xszag63d.js +141 -0
  166. package/dist/shared/components-y3cqdrgy.js +291 -0
  167. package/dist/shared/components-zvb11ker.js +288 -0
  168. package/dist/shared/components-zx2hr57f.js +124 -0
  169. package/dist/styles.css +1949 -0
  170. package/dist/tailwind.css +219 -0
  171. package/dist/tokens.css +345 -0
  172. package/package.json +102 -3
@@ -0,0 +1,86 @@
1
+ import {
2
+ button_default
3
+ } from "./components-5pkcfprd.js";
4
+ import {
5
+ SURFACE_BG,
6
+ SURFACE_SHADOW,
7
+ SurfaceProvider,
8
+ useSurface
9
+ } from "./components-csxz9f52.js";
10
+ import {
11
+ MorphPart,
12
+ MorphSurface
13
+ } from "./components-jxgznftn.js";
14
+ import {
15
+ useShape
16
+ } from "./components-7zp99w5d.js";
17
+ import {
18
+ useControllableState
19
+ } from "./components-dg0w8g5p.js";
20
+ import {
21
+ opensInPlace,
22
+ useMorph,
23
+ useMorphOrigin
24
+ } from "./components-7nww01w4.js";
25
+ import {
26
+ cn
27
+ } from "./components-0f0as45n.js";
28
+
29
+ // primitives/morph/index.tsx
30
+ import { useState } from "react";
31
+ import { jsx, jsxs } from "react/jsx-runtime";
32
+ function Morph({
33
+ from = "trigger",
34
+ effect = "goo",
35
+ tier = "slow",
36
+ hideSource = false,
37
+ open,
38
+ defaultOpen = false,
39
+ onOpenChange,
40
+ label = "Open",
41
+ className,
42
+ children
43
+ }) {
44
+ const [shown, setShown] = useControllableState(open, defaultOpen, onOpenChange);
45
+ const [mounted, setMounted] = useState(shown);
46
+ if (shown && !mounted)
47
+ setMounted(true);
48
+ const { origin, capture } = useMorphOrigin();
49
+ const morph = useMorph(shown, origin, { from, effect, tier, hideSource }, () => setMounted(false));
50
+ const shape = useShape();
51
+ const level = Math.min(useSurface() + 2, 8);
52
+ const inPlace = opensInPlace({ effect, hideSource });
53
+ return /* @__PURE__ */ jsxs("div", {
54
+ className: cn("relative inline-flex flex-col items-center", className),
55
+ children: [
56
+ /* @__PURE__ */ jsx(button_default, {
57
+ variant: "secondary",
58
+ "aria-expanded": shown,
59
+ onClick: (event) => {
60
+ if (!shown)
61
+ capture({ trigger: event.currentTarget, event: event.nativeEvent });
62
+ setShown(!shown);
63
+ },
64
+ children: shown ? "Close" : label
65
+ }),
66
+ mounted && /* @__PURE__ */ jsx("div", {
67
+ ref: morph.popupRef,
68
+ className: inPlace ? "absolute top-0 left-0 z-10" : "absolute top-full left-1/2 z-10 mt-3 -translate-x-1/2",
69
+ onClick: inPlace ? () => setShown(false) : undefined,
70
+ children: /* @__PURE__ */ jsx(SurfaceProvider, {
71
+ value: level,
72
+ children: /* @__PURE__ */ jsx(MorphSurface, {
73
+ morph,
74
+ bg: SURFACE_BG[level],
75
+ shadow: SURFACE_SHADOW[level],
76
+ radius: shape.container,
77
+ className: "w-56 p-4",
78
+ children
79
+ })
80
+ })
81
+ })
82
+ ]
83
+ });
84
+ }
85
+ Morph.Part = MorphPart;
86
+ export { Morph };
@@ -0,0 +1,111 @@
1
+ import {
2
+ SURFACE_BG,
3
+ SURFACE_SHADOW,
4
+ SurfaceProvider,
5
+ useSurface
6
+ } from "./components-csxz9f52.js";
7
+ import {
8
+ MorphSurface
9
+ } from "./components-jxgznftn.js";
10
+ import {
11
+ useShape
12
+ } from "./components-7zp99w5d.js";
13
+ import {
14
+ useControllableState
15
+ } from "./components-dg0w8g5p.js";
16
+ import {
17
+ inPlaceOffset,
18
+ opensInPlace,
19
+ useMorph,
20
+ useMorphOrigin
21
+ } from "./components-7nww01w4.js";
22
+ import {
23
+ cn
24
+ } from "./components-0f0as45n.js";
25
+
26
+ // components/overlays/preview-card/index.tsx
27
+ import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
28
+ import {
29
+ createContext,
30
+ forwardRef,
31
+ useContext,
32
+ useImperativeHandle,
33
+ useMemo
34
+ } from "react";
35
+ import { jsx } from "react/jsx-runtime";
36
+ var PreviewCardContext = createContext({ open: false, origin: { current: {} } });
37
+ var PreviewCardTrigger = forwardRef(({ render, className, ...props }, ref) => /* @__PURE__ */ jsx(PreviewCardPrimitive.Trigger, {
38
+ ref,
39
+ render,
40
+ className: cn(!render && "weight-medium text-foreground underline decoration-border underline-offset-4 transition-colors duration-fast hover:decoration-foreground", className),
41
+ ...props
42
+ }));
43
+ PreviewCardTrigger.displayName = "PreviewCardTrigger";
44
+ var PreviewCardContent = forwardRef(({
45
+ side = "bottom",
46
+ align,
47
+ sideOffset = 12,
48
+ from,
49
+ effect,
50
+ hideSource,
51
+ tier,
52
+ container,
53
+ className,
54
+ children,
55
+ ...props
56
+ }, ref) => {
57
+ const { open, origin } = useContext(PreviewCardContext);
58
+ const morph = useMorph(open, origin, { from, effect, hideSource, tier });
59
+ const inPlace = opensInPlace({ effect, hideSource });
60
+ useImperativeHandle(ref, () => morph.popup, [morph.popup]);
61
+ const shape = useShape();
62
+ const level = Math.min(useSurface() + 2, 8);
63
+ return /* @__PURE__ */ jsx(PreviewCardPrimitive.Portal, {
64
+ container: container ?? undefined,
65
+ children: /* @__PURE__ */ jsx(PreviewCardPrimitive.Positioner, {
66
+ side,
67
+ align: align ?? (inPlace ? "start" : "center"),
68
+ sideOffset: inPlace ? inPlaceOffset : sideOffset,
69
+ className: "z-50 outline-none",
70
+ children: /* @__PURE__ */ jsx(PreviewCardPrimitive.Popup, {
71
+ ref: morph.popupRef,
72
+ className: "relative outline-none",
73
+ ...props,
74
+ children: /* @__PURE__ */ jsx(SurfaceProvider, {
75
+ value: level,
76
+ children: /* @__PURE__ */ jsx(MorphSurface, {
77
+ morph,
78
+ bg: SURFACE_BG[level],
79
+ shadow: SURFACE_SHADOW[3],
80
+ radius: shape.container,
81
+ className: cn("flex w-max max-w-[min(92vw,20rem)] flex-col gap-3 p-4", className),
82
+ children
83
+ })
84
+ })
85
+ })
86
+ })
87
+ });
88
+ });
89
+ PreviewCardContent.displayName = "PreviewCardContent";
90
+ function PreviewCard({ open, defaultOpen = false, onOpenChange, children }) {
91
+ const [current, setCurrent] = useControllableState(open, defaultOpen, onOpenChange);
92
+ const { origin, capture } = useMorphOrigin();
93
+ const ctx = useMemo(() => ({ open: current, origin }), [current, origin]);
94
+ return /* @__PURE__ */ jsx(PreviewCardContext.Provider, {
95
+ value: ctx,
96
+ children: /* @__PURE__ */ jsx(PreviewCardPrimitive.Root, {
97
+ open: current,
98
+ onOpenChange: (next, details) => {
99
+ if (next)
100
+ capture(details);
101
+ setCurrent(next);
102
+ },
103
+ children
104
+ })
105
+ });
106
+ }
107
+ PreviewCard.Trigger = PreviewCardTrigger;
108
+ PreviewCard.Content = PreviewCardContent;
109
+ var preview_card_default = PreviewCard;
110
+
111
+ export { PreviewCardTrigger, PreviewCardContent, PreviewCard, preview_card_default };
@@ -0,0 +1,32 @@
1
+ import {
2
+ SurfaceProvider,
3
+ surfaceClasses,
4
+ useSurface
5
+ } from "./components-csxz9f52.js";
6
+ import {
7
+ cn
8
+ } from "./components-0f0as45n.js";
9
+
10
+ // primitives/surface/index.tsx
11
+ import {
12
+ forwardRef
13
+ } from "react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var Elevated = forwardRef(({ offset, shadowLevel, className, children, ...props }, ref) => {
16
+ const substrate = useSurface();
17
+ const level = Math.min(substrate + offset, 8);
18
+ return /* @__PURE__ */ jsx(SurfaceProvider, {
19
+ value: level,
20
+ children: /* @__PURE__ */ jsx("div", {
21
+ ref,
22
+ className: cn(surfaceClasses(level, shadowLevel ?? level), className),
23
+ ...props,
24
+ children
25
+ })
26
+ });
27
+ });
28
+ Elevated.displayName = "Elevated";
29
+ Object.assign(Elevated, { Provider: SurfaceProvider });
30
+ var surface_default = Elevated;
31
+
32
+ export { Elevated, surface_default };
@@ -0,0 +1,193 @@
1
+ import {
2
+ fieldIconClasses,
3
+ fieldVariants
4
+ } from "./components-de8xsm9y.js";
5
+ import {
6
+ SizeProvider
7
+ } from "./components-vb033rns.js";
8
+ import {
9
+ useFluidHover,
10
+ useRegisterFluidHoverItem
11
+ } from "./components-e46kf6cp.js";
12
+ import {
13
+ useShape
14
+ } from "./components-7zp99w5d.js";
15
+ import {
16
+ useControllableState
17
+ } from "./components-dg0w8g5p.js";
18
+ import {
19
+ useSize
20
+ } from "./components-x3rz4cyn.js";
21
+ import {
22
+ cn
23
+ } from "./components-0f0as45n.js";
24
+
25
+ // components/inputs/input/index.tsx
26
+ import { Field } from "@base-ui/react/field";
27
+ import {
28
+ createContext,
29
+ forwardRef,
30
+ useContext,
31
+ useMemo,
32
+ useRef
33
+ } from "react";
34
+ import { jsx, jsxs } from "react/jsx-runtime";
35
+ var InputGroupContext = createContext(null);
36
+ function useInputGroup() {
37
+ const ctx = useContext(InputGroupContext);
38
+ if (!ctx)
39
+ throw new Error("useInputGroup must be used within an InputGroup");
40
+ return ctx;
41
+ }
42
+ var FieldStateContext = createContext(null);
43
+ var Input = forwardRef(({
44
+ icon: Icon,
45
+ value: valueProp,
46
+ defaultValue = "",
47
+ onChange: onChangeProp,
48
+ invalid,
49
+ disabled,
50
+ size,
51
+ className,
52
+ ...props
53
+ }, ref) => {
54
+ const [value, onChange] = useControllableState(valueProp, defaultValue, onChangeProp);
55
+ const inputRef = useRef(null);
56
+ const field = useContext(FieldStateContext);
57
+ const shape = useShape();
58
+ const sizeClasses = useSize(size);
59
+ const compact = sizeClasses.variant === "compact";
60
+ return /* @__PURE__ */ jsxs("div", {
61
+ onMouseDown: (e) => {
62
+ if (e.target === inputRef.current)
63
+ return;
64
+ e.preventDefault();
65
+ inputRef.current?.focus();
66
+ },
67
+ "data-active": field?.active || undefined,
68
+ "data-invalid": invalid || undefined,
69
+ "data-disabled": disabled || undefined,
70
+ className: cn(fieldVariants(), "flex items-center", sizeClasses.gap, shape.input, compact ? "px-2" : "px-2.5", sizeClasses.control, className),
71
+ children: [
72
+ Icon && /* @__PURE__ */ jsx(Icon, {
73
+ size: sizeClasses.icon,
74
+ strokeWidth: 1.5,
75
+ className: fieldIconClasses
76
+ }),
77
+ /* @__PURE__ */ jsx(Field.Control, {
78
+ ref: (node) => {
79
+ const input = node;
80
+ inputRef.current = input;
81
+ if (typeof ref === "function")
82
+ ref(input);
83
+ else if (ref)
84
+ ref.current = input;
85
+ },
86
+ type: "text",
87
+ value,
88
+ onChange: (e) => onChange(e.target.value),
89
+ disabled,
90
+ "aria-invalid": invalid || undefined,
91
+ className: cn("w-full rounded-none bg-transparent text-foreground placeholder:text-muted-foreground outline-none font-[inherit]", sizeClasses.text, "weight-normal"),
92
+ ...props
93
+ })
94
+ ]
95
+ });
96
+ });
97
+ Input.displayName = "Input";
98
+ var Label = forwardRef(({ children, invalid, size, className, ...props }, ref) => {
99
+ const sizeClasses = useSize(size);
100
+ const compact = sizeClasses.variant === "compact";
101
+ return /* @__PURE__ */ jsxs("label", {
102
+ ref,
103
+ className: cn("inline-grid", sizeClasses.text, "data-[disabled]:opacity-50", compact ? "pl-2" : "pl-2.5", className),
104
+ ...props,
105
+ children: [
106
+ /* @__PURE__ */ jsx("span", {
107
+ className: "col-start-1 row-start-1 invisible weight-semibold",
108
+ "aria-hidden": "true",
109
+ children
110
+ }),
111
+ /* @__PURE__ */ jsx("span", {
112
+ className: cn("col-start-1 row-start-1", invalid ? "text-destructive" : "text-muted-foreground", "weight-normal"),
113
+ children
114
+ })
115
+ ]
116
+ });
117
+ });
118
+ Label.displayName = "Label";
119
+ var InputGroup = forwardRef(({ children, size, className, ...props }, ref) => {
120
+ const containerRef = useRef(null);
121
+ const { activeIndex, handlers, registerItem } = useFluidHover(containerRef);
122
+ const contextValue = useMemo(() => ({ registerItem, activeIndex }), [registerItem, activeIndex]);
123
+ const group = /* @__PURE__ */ jsx(InputGroupContext.Provider, {
124
+ value: contextValue,
125
+ children: /* @__PURE__ */ jsx("div", {
126
+ ref: (node) => {
127
+ containerRef.current = node;
128
+ if (typeof ref === "function")
129
+ ref(node);
130
+ else if (ref)
131
+ ref.current = node;
132
+ },
133
+ onMouseEnter: handlers.onMouseEnter,
134
+ onMouseMove: handlers.onMouseMove,
135
+ onMouseLeave: handlers.onMouseLeave,
136
+ className: cn("relative flex flex-col gap-3 w-72 max-w-full", className),
137
+ ...props,
138
+ children
139
+ })
140
+ });
141
+ return size ? /* @__PURE__ */ jsx(SizeProvider, {
142
+ size,
143
+ children: group
144
+ }) : group;
145
+ });
146
+ InputGroup.displayName = "InputGroup";
147
+ var InputField = forwardRef(({ label, labelHidden, index, error, disabled, className, ...props }, ref) => {
148
+ const internalRef = useRef(null);
149
+ const { registerItem, activeIndex } = useInputGroup();
150
+ const sizeClasses = useSize();
151
+ const compact = sizeClasses.variant === "compact";
152
+ useRegisterFluidHoverItem(registerItem, index, internalRef);
153
+ const fieldState = useMemo(() => ({ active: activeIndex === index }), [activeIndex, index]);
154
+ return /* @__PURE__ */ jsxs(Field.Root, {
155
+ ref: (node) => {
156
+ internalRef.current = node;
157
+ if (typeof ref === "function")
158
+ ref(node);
159
+ else if (ref)
160
+ ref.current = node;
161
+ },
162
+ invalid: !!error,
163
+ disabled,
164
+ className: cn("flex flex-col gap-1 cursor-text", disabled && "pointer-events-none", className),
165
+ children: [
166
+ /* @__PURE__ */ jsx(Field.Label, {
167
+ render: /* @__PURE__ */ jsx(Label, {
168
+ invalid: !!error,
169
+ className: labelHidden ? "sr-only" : undefined,
170
+ children: label
171
+ })
172
+ }),
173
+ /* @__PURE__ */ jsx(FieldStateContext.Provider, {
174
+ value: fieldState,
175
+ children: /* @__PURE__ */ jsx(Input, {
176
+ invalid: !!error,
177
+ disabled,
178
+ ...props
179
+ })
180
+ }),
181
+ error && /* @__PURE__ */ jsx(Field.Error, {
182
+ match: true,
183
+ className: cn("text-destructive", compact ? "text-caption-compact pl-2" : "text-caption pl-2.5", "weight-medium"),
184
+ children: error
185
+ })
186
+ ]
187
+ });
188
+ });
189
+ InputField.displayName = "InputField";
190
+ Object.assign(InputGroup, { Field: InputField });
191
+ var input_default = Input;
192
+
193
+ export { Input, Label, InputGroup, input_default };