@justanarthur/modo-ui 0.0.0-stage → 0.2.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 (171) 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 +31 -0
  10. package/dist/components/badge/index.d.ts +59 -0
  11. package/dist/components/badge/index.js +16 -0
  12. package/dist/components/button/index.d.ts +59 -0
  13. package/dist/components/button/index.js +14 -0
  14. package/dist/components/card/index.d.ts +141 -0
  15. package/dist/components/card/index.js +42 -0
  16. package/dist/components/inputs/checkbox-group/index.d.ts +50 -0
  17. package/dist/components/inputs/checkbox-group/index.js +21 -0
  18. package/dist/components/inputs/color-picker/index.d.ts +137 -0
  19. package/dist/components/inputs/color-picker/index.js +35 -0
  20. package/dist/components/inputs/combobox/index.d.ts +161 -0
  21. package/dist/components/inputs/combobox/index.js +38 -0
  22. package/dist/components/inputs/date-time/calendar/index.d.ts +45 -0
  23. package/dist/components/inputs/date-time/calendar/index.js +18 -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 +32 -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 +31 -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 +31 -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 +30 -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 +31 -0
  34. package/dist/components/inputs/input/index.d.ts +84 -0
  35. package/dist/components/inputs/input/index.js +19 -0
  36. package/dist/components/inputs/input-copy/index.d.ts +44 -0
  37. package/dist/components/inputs/input-copy/index.js +16 -0
  38. package/dist/components/inputs/input-message/index.d.ts +125 -0
  39. package/dist/components/inputs/input-message/index.js +25 -0
  40. package/dist/components/inputs/radio-group/index.d.ts +58 -0
  41. package/dist/components/inputs/radio-group/index.js +20 -0
  42. package/dist/components/inputs/search/index.d.ts +83 -0
  43. package/dist/components/inputs/search/index.js +25 -0
  44. package/dist/components/inputs/select/index.d.ts +105 -0
  45. package/dist/components/inputs/select/index.js +34 -0
  46. package/dist/components/inputs/slider/index.d.ts +108 -0
  47. package/dist/components/inputs/slider/index.js +14 -0
  48. package/dist/components/inputs/switch/index.d.ts +43 -0
  49. package/dist/components/inputs/switch/index.js +14 -0
  50. package/dist/components/navigation/accordion/index.d.ts +117 -0
  51. package/dist/components/navigation/accordion/index.js +28 -0
  52. package/dist/components/navigation/sidebar/index.d.ts +388 -0
  53. package/dist/components/navigation/sidebar/index.js +99 -0
  54. package/dist/components/navigation/tabs/index.d.ts +70 -0
  55. package/dist/components/navigation/tabs/index.js +23 -0
  56. package/dist/components/navigation/tabs-subtle/index.d.ts +73 -0
  57. package/dist/components/navigation/tabs-subtle/index.js +21 -0
  58. package/dist/components/overlays/alert-dialog/index.d.ts +67 -0
  59. package/dist/components/overlays/alert-dialog/index.js +22 -0
  60. package/dist/components/overlays/command/index.d.ts +121 -0
  61. package/dist/components/overlays/command/index.js +36 -0
  62. package/dist/components/overlays/context-menu/index.d.ts +97 -0
  63. package/dist/components/overlays/context-menu/index.js +29 -0
  64. package/dist/components/overlays/dialog/index.d.ts +130 -0
  65. package/dist/components/overlays/dialog/index.js +37 -0
  66. package/dist/components/overlays/dropdown/index.d.ts +222 -0
  67. package/dist/components/overlays/dropdown/index.js +44 -0
  68. package/dist/components/overlays/popover/index.d.ts +87 -0
  69. package/dist/components/overlays/popover/index.js +26 -0
  70. package/dist/components/overlays/preview-card/index.d.ts +75 -0
  71. package/dist/components/overlays/preview-card/index.js +19 -0
  72. package/dist/components/overlays/sheet/index.d.ts +67 -0
  73. package/dist/components/overlays/sheet/index.js +24 -0
  74. package/dist/components/overlays/toast/index.d.ts +107 -0
  75. package/dist/components/overlays/toast/index.js +21 -0
  76. package/dist/components/overlays/tooltip/index.d.ts +75 -0
  77. package/dist/components/overlays/tooltip/index.js +17 -0
  78. package/dist/components/table/index.d.ts +44 -0
  79. package/dist/components/table/index.js +26 -0
  80. package/dist/components/thinking-indicator/index.d.ts +32 -0
  81. package/dist/components/thinking-indicator/index.js +13 -0
  82. package/dist/index.d.ts +3926 -0
  83. package/dist/index.js +511 -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 +11 -0
  88. package/dist/primitives/craft/index.d.ts +31 -0
  89. package/dist/primitives/craft/index.js +11 -0
  90. package/dist/primitives/fluid-hover/index.d.ts +233 -0
  91. package/dist/primitives/fluid-hover/index.js +25 -0
  92. package/dist/primitives/morph/index.d.ts +127 -0
  93. package/dist/primitives/morph/index.js +19 -0
  94. package/dist/primitives/motion/index.d.ts +115 -0
  95. package/dist/primitives/motion/index.js +19 -0
  96. package/dist/primitives/scroll-area/index.d.ts +41 -0
  97. package/dist/primitives/scroll-area/index.js +12 -0
  98. package/dist/primitives/sizes/index.d.ts +128 -0
  99. package/dist/primitives/sizes/index.js +21 -0
  100. package/dist/primitives/surface/index.d.ts +69 -0
  101. package/dist/primitives/surface/index.js +17 -0
  102. package/dist/shared/components-0ke6xada.js +123 -0
  103. package/dist/shared/components-0q0sqfh4.js +146 -0
  104. package/dist/shared/components-0sn7ypjw.js +61 -0
  105. package/dist/shared/components-1j9791sn.js +345 -0
  106. package/dist/shared/components-1rfwbyyc.js +361 -0
  107. package/dist/shared/components-1v7rxytx.js +30 -0
  108. package/dist/shared/components-1xekx2hx.js +215 -0
  109. package/dist/shared/components-39jq9va1.js +86 -0
  110. package/dist/shared/components-3gae8nta.js +719 -0
  111. package/dist/shared/components-3k8xpnpq.js +1759 -0
  112. package/dist/shared/components-3ky44908.js +9 -0
  113. package/dist/shared/components-3mkepka5.js +111 -0
  114. package/dist/shared/components-3wk0w46f.js +667 -0
  115. package/dist/shared/components-4cnjmgex.js +124 -0
  116. package/dist/shared/components-59efxjd9.js +298 -0
  117. package/dist/shared/components-5xc2j8jz.js +159 -0
  118. package/dist/shared/components-62ybc7t2.js +496 -0
  119. package/dist/shared/components-66mv71kx.js +262 -0
  120. package/dist/shared/components-7ans7ce5.js +120 -0
  121. package/dist/shared/components-7btqt08d.js +270 -0
  122. package/dist/shared/components-7r3etddy.js +171 -0
  123. package/dist/shared/components-7x9kawxv.js +152 -0
  124. package/dist/shared/components-8fpr3s4p.js +292 -0
  125. package/dist/shared/components-9jvzzvt1.js +198 -0
  126. package/dist/shared/components-apdwtweq.js +484 -0
  127. package/dist/shared/components-asr5pg50.js +191 -0
  128. package/dist/shared/components-b2wyq2cq.js +232 -0
  129. package/dist/shared/components-c6s6b43g.js +15 -0
  130. package/dist/shared/components-ca2c898n.js +1828 -0
  131. package/dist/shared/components-cbxjn9p8.js +141 -0
  132. package/dist/shared/components-chacnk61.js +216 -0
  133. package/dist/shared/components-cv16mryv.js +62 -0
  134. package/dist/shared/components-ez65vtbq.js +110 -0
  135. package/dist/shared/components-ezxhrmer.js +17 -0
  136. package/dist/shared/components-gc5vtq2f.js +149 -0
  137. package/dist/shared/components-gf5s6ap9.js +42 -0
  138. package/dist/shared/components-gvr9w41t.js +193 -0
  139. package/dist/shared/components-h2dpcwgc.js +137 -0
  140. package/dist/shared/components-hawvy2qz.js +105 -0
  141. package/dist/shared/components-hqeq3w9q.js +375 -0
  142. package/dist/shared/components-jjw69c4c.js +28 -0
  143. package/dist/shared/components-jwst3vtj.js +346 -0
  144. package/dist/shared/components-kvr7f9hy.js +45 -0
  145. package/dist/shared/components-men63rwj.js +9 -0
  146. package/dist/shared/components-mhd39z7x.js +22 -0
  147. package/dist/shared/components-n7mjr357.js +26 -0
  148. package/dist/shared/components-ng72k97e.js +128 -0
  149. package/dist/shared/components-nh8tma1n.js +986 -0
  150. package/dist/shared/components-njzgqdwy.js +445 -0
  151. package/dist/shared/components-ny774h8p.js +293 -0
  152. package/dist/shared/components-q4daerx0.js +58 -0
  153. package/dist/shared/components-q5xj5c16.js +79 -0
  154. package/dist/shared/components-rr7a6ja9.js +160 -0
  155. package/dist/shared/components-s2bz1xpk.js +63 -0
  156. package/dist/shared/components-tqvarbfv.js +288 -0
  157. package/dist/shared/components-v6xp325t.js +304 -0
  158. package/dist/shared/components-v7wtz8hk.js +144 -0
  159. package/dist/shared/components-vc7vq5nz.js +32 -0
  160. package/dist/shared/components-vfbhxf5r.js +58 -0
  161. package/dist/shared/components-vynjtrk6.js +19 -0
  162. package/dist/shared/components-wvp1m52g.js +1200 -0
  163. package/dist/shared/components-yh3kwdhr.js +981 -0
  164. package/dist/shared/components-ytb2tefr.js +291 -0
  165. package/dist/shared/components-zfnmn5d4.js +220 -0
  166. package/dist/shared/components-zrkzcayz.js +141 -0
  167. package/dist/shared/components-zx6b6yby.js +42 -0
  168. package/dist/styles.css +1949 -0
  169. package/dist/tailwind.css +219 -0
  170. package/dist/tokens.css +345 -0
  171. package/package.json +103 -4
@@ -0,0 +1,42 @@
1
+ import {
2
+ DialogTrigger2,
3
+ DialogClose2,
4
+ DialogContent2,
5
+ DialogHeader2,
6
+ DialogFooter2,
7
+ DialogTitle2,
8
+ DialogDescription2,
9
+ DialogState2
10
+ } from "./components-zfnmn5d4.js";
11
+
12
+ // components/overlays/alert-dialog/index.tsx
13
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
14
+ import { forwardRef } from "react";
15
+ import { jsx } from "react/jsx-runtime";
16
+ var AlertDialogContent2 = forwardRef(({ showCloseButton = false, ...props }, ref) => /* @__PURE__ */ jsx(DialogContent2, {
17
+ ref,
18
+ showCloseButton,
19
+ ...props
20
+ }));
21
+ AlertDialogContent2.displayName = "AlertDialogContent";
22
+ function AlertDialog2({ children, open, defaultOpen, onOpenChange }) {
23
+ return /* @__PURE__ */ jsx(DialogState2, {
24
+ open,
25
+ defaultOpen,
26
+ onOpenChange,
27
+ children: (root) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, {
28
+ ...root,
29
+ children
30
+ })
31
+ });
32
+ }
33
+ AlertDialog2.Trigger = DialogTrigger2;
34
+ AlertDialog2.Content = AlertDialogContent2;
35
+ AlertDialog2.Header = DialogHeader2;
36
+ AlertDialog2.Footer = DialogFooter2;
37
+ AlertDialog2.Title = DialogTitle2;
38
+ AlertDialog2.Description = DialogDescription2;
39
+ AlertDialog2.Close = DialogClose2;
40
+ var alert_dialog_default = AlertDialog2;
41
+
42
+ export { AlertDialogContent2, AlertDialog2, alert_dialog_default };
@@ -0,0 +1,193 @@
1
+ import {
2
+ fieldVariants,
3
+ fieldIconClasses
4
+ } from "./components-mhd39z7x.js";
5
+ import {
6
+ useShape
7
+ } from "./components-cv16mryv.js";
8
+ import {
9
+ useSize2
10
+ } from "./components-0sn7ypjw.js";
11
+ import {
12
+ useControllableState
13
+ } from "./components-n7mjr357.js";
14
+ import {
15
+ useFluidHover2,
16
+ useRegisterFluidHoverItem2
17
+ } from "./components-59efxjd9.js";
18
+ import {
19
+ cn2
20
+ } from "./components-ezxhrmer.js";
21
+ import {
22
+ SizeProvider2
23
+ } from "./components-jjw69c4c.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 Input2 = 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 = useSize2(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: cn2(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: cn2("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
+ Input2.displayName = "Input";
98
+ var Label2 = forwardRef(({ children, invalid, size, className, ...props }, ref) => {
99
+ const sizeClasses = useSize2(size);
100
+ const compact = sizeClasses.variant === "compact";
101
+ return /* @__PURE__ */ jsxs("label", {
102
+ ref,
103
+ className: cn2("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: cn2("col-start-1 row-start-1", invalid ? "text-destructive" : "text-muted-foreground", "weight-normal"),
113
+ children
114
+ })
115
+ ]
116
+ });
117
+ });
118
+ Label2.displayName = "Label";
119
+ var InputGroup2 = forwardRef(({ children, size, className, ...props }, ref) => {
120
+ const containerRef = useRef(null);
121
+ const { activeIndex, handlers, registerItem } = useFluidHover2(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: cn2("relative flex flex-col gap-3 w-72 max-w-full", className),
137
+ ...props,
138
+ children
139
+ })
140
+ });
141
+ return size ? /* @__PURE__ */ jsx(SizeProvider2, {
142
+ size,
143
+ children: group
144
+ }) : group;
145
+ });
146
+ InputGroup2.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 = useSize2();
151
+ const compact = sizeClasses.variant === "compact";
152
+ useRegisterFluidHoverItem2(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: cn2("flex flex-col gap-1 cursor-text", disabled && "pointer-events-none", className),
165
+ children: [
166
+ /* @__PURE__ */ jsx(Field.Label, {
167
+ render: /* @__PURE__ */ jsx(Label2, {
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(Input2, {
176
+ invalid: !!error,
177
+ disabled,
178
+ ...props
179
+ })
180
+ }),
181
+ error && /* @__PURE__ */ jsx(Field.Error, {
182
+ match: true,
183
+ className: cn2("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(InputGroup2, { Field: InputField });
191
+ var input_default = Input2;
192
+
193
+ export { Input2, Label2, InputGroup2, input_default };
@@ -0,0 +1,137 @@
1
+ import {
2
+ cn2
3
+ } from "./components-ezxhrmer.js";
4
+ import {
5
+ FluidHoverHighlight2
6
+ } from "./components-kvr7f9hy.js";
7
+ import {
8
+ useShape
9
+ } from "./components-cv16mryv.js";
10
+ import {
11
+ useFluidHover2,
12
+ useRegisterFluidHoverItem2
13
+ } from "./components-59efxjd9.js";
14
+
15
+ // primitives/fluid-hover/index.tsx
16
+ import {
17
+ Children,
18
+ cloneElement,
19
+ createContext,
20
+ forwardRef,
21
+ isValidElement,
22
+ useContext,
23
+ useMemo,
24
+ useRef
25
+ } from "react";
26
+ import { jsx, jsxs } from "react/jsx-runtime";
27
+ var FluidHoverContext = createContext(null);
28
+ function isItemDisabled(element) {
29
+ return element.hasAttribute("data-disabled");
30
+ }
31
+ var itemBaseClass = "relative z-10 flex shrink-0 cursor-pointer items-center text-left text-body text-foreground outline-none focus-visible:ring-1 focus-visible:ring-focus-ring";
32
+ var itemAxisClass = {
33
+ y: "h-9 w-full px-3",
34
+ x: "h-9 justify-center whitespace-nowrap px-3",
35
+ xy: "min-h-20 w-full flex-col items-start justify-center gap-0.5 p-3"
36
+ };
37
+ var containerAxisClass = {
38
+ y: "flex flex-col gap-1",
39
+ x: "flex flex-row gap-1",
40
+ xy: "grid gap-1"
41
+ };
42
+ var FluidHoverItem2 = forwardRef(({ index, disabled = false, className, children, ...props }, ref) => {
43
+ const list = useContext(FluidHoverContext);
44
+ const shape = useShape();
45
+ const innerRef = useRef(null);
46
+ useRegisterFluidHoverItem2(list?.registerItem, index, innerRef);
47
+ const axis = list?.axis ?? "y";
48
+ return /* @__PURE__ */ jsx("button", {
49
+ ref: (node) => {
50
+ innerRef.current = node;
51
+ if (typeof ref === "function")
52
+ ref(node);
53
+ else if (ref)
54
+ ref.current = node;
55
+ },
56
+ type: "button",
57
+ "data-slot": "fluid-hover-item",
58
+ "data-disabled": disabled || undefined,
59
+ disabled,
60
+ ...props,
61
+ className: cn2(itemBaseClass, itemAxisClass[axis], shape.item, disabled && "cursor-default text-muted-foreground opacity-55", className),
62
+ children
63
+ });
64
+ });
65
+ FluidHoverItem2.displayName = "FluidHoverItem";
66
+ var FluidHover2 = forwardRef(({
67
+ axis,
68
+ columns,
69
+ items,
70
+ renderItem,
71
+ disabledIndices,
72
+ gapClick = true,
73
+ highlightClassName,
74
+ className,
75
+ children,
76
+ style,
77
+ ...props
78
+ }, ref) => {
79
+ const containerRef = useRef(null);
80
+ const shape = useShape();
81
+ const resolvedAxis = axis ?? ((columns ?? 1) > 1 ? "xy" : "y");
82
+ const resolvedColumns = resolvedAxis === "xy" ? Math.max(1, columns ?? 2) : 1;
83
+ const hover = useFluidHover2(containerRef, {
84
+ axis: resolvedAxis,
85
+ isItemDisabled,
86
+ gapClick
87
+ });
88
+ const { handlers, registerItem } = hover;
89
+ const contextValue = useMemo(() => ({ registerItem, axis: resolvedAxis }), [registerItem, resolvedAxis]);
90
+ const disabled = new Set(disabledIndices);
91
+ const rows = items ? items.map((item, i) => /* @__PURE__ */ jsx(FluidHoverItem2, {
92
+ index: i,
93
+ disabled: disabled.has(i),
94
+ children: renderItem ? renderItem(item, i) : item
95
+ }, `${i}-${item}`)) : Children.toArray(children).map((child, i) => {
96
+ if (!isValidElement(child) || child.type !== FluidHoverItem2)
97
+ return child;
98
+ const row = child;
99
+ return cloneElement(row, {
100
+ index: row.props.index ?? i,
101
+ disabled: row.props.disabled ?? disabled.has(i)
102
+ });
103
+ });
104
+ return /* @__PURE__ */ jsx(FluidHoverContext.Provider, {
105
+ value: contextValue,
106
+ children: /* @__PURE__ */ jsxs("div", {
107
+ ref: (node) => {
108
+ containerRef.current = node;
109
+ if (typeof ref === "function")
110
+ ref(node);
111
+ else if (ref)
112
+ ref.current = node;
113
+ },
114
+ ...props,
115
+ ...handlers,
116
+ "data-slot": "fluid-hover",
117
+ "data-axis": resolvedAxis,
118
+ className: cn2("relative", containerAxisClass[resolvedAxis], className),
119
+ style: resolvedAxis === "xy" ? {
120
+ gridTemplateColumns: `repeat(${resolvedColumns}, minmax(0, 1fr))`,
121
+ ...style
122
+ } : style,
123
+ children: [
124
+ /* @__PURE__ */ jsx(FluidHoverHighlight2, {
125
+ hover,
126
+ className: cn2("z-0", shape.bg, highlightClassName)
127
+ }),
128
+ rows
129
+ ]
130
+ })
131
+ });
132
+ });
133
+ FluidHover2.displayName = "FluidHover";
134
+ Object.assign(FluidHover2, { Item: FluidHoverItem2 });
135
+ var fluid_hover_default = FluidHover2;
136
+
137
+ export { FluidHoverItem2, FluidHover2, fluid_hover_default };
@@ -0,0 +1,105 @@
1
+ import {
2
+ useShape
3
+ } from "./components-cv16mryv.js";
4
+ import {
5
+ cn2
6
+ } from "./components-ezxhrmer.js";
7
+
8
+ // primitives/scroll-area/index.tsx
9
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
10
+ import {
11
+ createContext,
12
+ forwardRef,
13
+ useContext
14
+ } from "react";
15
+
16
+ // lib/use-touch-primary.tsx
17
+ import { useEffect, useState } from "react";
18
+ function useTouchPrimary() {
19
+ const [isTouchPrimary, setIsTouchPrimary] = useState(false);
20
+ useEffect(() => {
21
+ if (typeof window === "undefined")
22
+ return;
23
+ const controller = new AbortController;
24
+ const { signal } = controller;
25
+ const handleTouch = () => {
26
+ const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
27
+ const prefersTouch = window.matchMedia("(pointer: coarse)").matches;
28
+ setIsTouchPrimary(hasTouch && prefersTouch);
29
+ };
30
+ const mq = window.matchMedia("(pointer: coarse)");
31
+ mq.addEventListener("change", handleTouch, { signal });
32
+ window.addEventListener("pointerdown", handleTouch, { signal });
33
+ handleTouch();
34
+ return () => controller.abort();
35
+ }, []);
36
+ return isTouchPrimary;
37
+ }
38
+
39
+ // primitives/scroll-area/index.tsx
40
+ import { jsx, jsxs } from "react/jsx-runtime";
41
+ var ScrollAreaContext = createContext(false);
42
+ var ScrollArea2 = forwardRef(({ className, children, viewportClassName, orientation = "vertical", ...props }, ref) => {
43
+ const isTouch = useTouchPrimary();
44
+ return /* @__PURE__ */ jsx(ScrollAreaContext.Provider, {
45
+ value: isTouch,
46
+ children: isTouch ? /* @__PURE__ */ jsx("div", {
47
+ ref,
48
+ role: "group",
49
+ "data-slot": "scroll-area",
50
+ "aria-roledescription": "scroll area",
51
+ className: cn2("relative overflow-hidden", className),
52
+ ...props,
53
+ children: /* @__PURE__ */ jsx("div", {
54
+ "data-slot": "scroll-area-viewport",
55
+ className: cn2("size-full rounded-[inherit]", orientation === "vertical" && "overflow-y-auto", orientation === "horizontal" && "overflow-x-auto", orientation === "both" && "overflow-auto", viewportClassName),
56
+ tabIndex: 0,
57
+ children
58
+ })
59
+ }) : /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
60
+ ref,
61
+ "data-slot": "scroll-area",
62
+ className: cn2("relative overflow-hidden", className),
63
+ ...props,
64
+ children: [
65
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
66
+ "data-slot": "scroll-area-viewport",
67
+ className: cn2("size-full rounded-[inherit]", viewportClassName),
68
+ children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Content, {
69
+ children
70
+ })
71
+ }),
72
+ orientation !== "horizontal" && /* @__PURE__ */ jsx(ScrollBar2, {
73
+ orientation: "vertical"
74
+ }),
75
+ orientation !== "vertical" && /* @__PURE__ */ jsx(ScrollBar2, {
76
+ orientation: "horizontal"
77
+ }),
78
+ orientation === "both" && /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
79
+ ]
80
+ })
81
+ });
82
+ });
83
+ ScrollArea2.displayName = "ScrollArea";
84
+ var ScrollBar2 = forwardRef(({ className, orientation = "vertical", ...props }, ref) => {
85
+ const isTouch = useContext(ScrollAreaContext);
86
+ const shape = useShape();
87
+ if (isTouch)
88
+ return null;
89
+ return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, {
90
+ ref,
91
+ orientation,
92
+ "data-slot": "scroll-area-scrollbar",
93
+ className: cn2("group/scrollbar absolute z-20 flex touch-none select-none", "opacity-0 transition-opacity duration-moderate-exit ease-out delay-moderate", "data-[hovering]:duration-moderate data-[scrolling]:duration-moderate", "data-[hovering]:opacity-100 data-[scrolling]:opacity-100", "data-[hovering]:delay-0 data-[scrolling]:delay-0", orientation === "vertical" && "top-0 right-0 h-full w-2.5", orientation === "horizontal" && "bottom-0 left-0 h-2.5 w-full flex-col", className),
94
+ ...props,
95
+ children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Thumb, {
96
+ "data-slot": "scroll-area-thumb",
97
+ className: cn2("relative bg-overlay/8 transition-[background-color,width,height] duration-moderate ease-in-out", "group-hover/scrollbar:bg-overlay/12 active:!bg-overlay/16", shape.bg, orientation === "vertical" && "mx-auto my-1 w-1 -translate-x-0.5 h-[var(--scroll-area-thumb-height)] group-hover/scrollbar:w-1.5", orientation === "horizontal" && "my-auto mx-1 h-1 -translate-y-0.5 w-[var(--scroll-area-thumb-width)] group-hover/scrollbar:h-1.5")
98
+ })
99
+ });
100
+ });
101
+ ScrollBar2.displayName = "ScrollBar";
102
+ Object.assign(ScrollArea2, { Bar: ScrollBar2 });
103
+ var scroll_area_default = ScrollArea2;
104
+
105
+ export { ScrollArea2, ScrollBar2, scroll_area_default };