@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,19 @@
1
+ // lib/popup.ts
2
+ var popupScrollAreaClass = "min-h-0 flex-1 max-h-[inherit]";
3
+ var popupViewportClass = "!h-auto max-h-[inherit] [&>div[style]]:!block [&>div[style]]:!min-w-0 [--scroll-fade-size:32px]";
4
+ var POPUP_NAV_KEYS = [
5
+ "ArrowDown",
6
+ "ArrowUp",
7
+ "ArrowLeft",
8
+ "ArrowRight",
9
+ "Home",
10
+ "End",
11
+ "PageUp",
12
+ "PageDown",
13
+ "Tab"
14
+ ];
15
+ function isDisabledRow(el) {
16
+ return el.getAttribute("aria-disabled") === "true" || el.hasAttribute("data-disabled");
17
+ }
18
+
19
+ export { popupScrollAreaClass, popupViewportClass, POPUP_NAV_KEYS, isDisabledRow };
@@ -0,0 +1,146 @@
1
+ import {
2
+ GOO_MATRIX
3
+ } from "./components-7nww01w4.js";
4
+ import {
5
+ useReduceMotion
6
+ } from "./components-nnnd2xef.js";
7
+ import {
8
+ spring
9
+ } from "./components-vc1k7yv2.js";
10
+ import {
11
+ cn
12
+ } from "./components-0f0as45n.js";
13
+
14
+ // lib/morph-part.tsx
15
+ import { motion } from "motion/react";
16
+ import { createContext, useContext } from "react";
17
+ import { jsx } from "react/jsx-runtime";
18
+ var MorphPartScope = createContext(null);
19
+ var MorphPartInOverlay = createContext(false);
20
+ var { exit: _exit, ...enter } = spring.slow;
21
+ function MorphPart({ id, className, children }) {
22
+ const scope = useContext(MorphPartScope);
23
+ const inOverlay = useContext(MorphPartInOverlay);
24
+ const reduced = useReduceMotion();
25
+ const layoutId = scope && !reduced && (scope.open || !inOverlay) ? `${scope.id}-${id}` : undefined;
26
+ return /* @__PURE__ */ jsx(motion.div, {
27
+ layoutId,
28
+ transition: enter,
29
+ className,
30
+ children
31
+ });
32
+ }
33
+
34
+ // lib/morph-layers.tsx
35
+ import { jsx as jsx2, jsxs, Fragment } from "react/jsx-runtime";
36
+ function GooFilter({ id, blur, blurRef, outlineRef }) {
37
+ return /* @__PURE__ */ jsx2("svg", {
38
+ "aria-hidden": true,
39
+ className: "absolute size-0",
40
+ children: /* @__PURE__ */ jsxs("filter", {
41
+ id,
42
+ x: "-50%",
43
+ y: "-50%",
44
+ width: "200%",
45
+ height: "200%",
46
+ colorInterpolationFilters: "sRGB",
47
+ children: [
48
+ /* @__PURE__ */ jsx2("feGaussianBlur", {
49
+ ref: blurRef,
50
+ in: "SourceGraphic",
51
+ stdDeviation: blur,
52
+ result: "blur"
53
+ }),
54
+ /* @__PURE__ */ jsx2("feColorMatrix", {
55
+ in: "blur",
56
+ mode: "matrix",
57
+ values: GOO_MATRIX,
58
+ result: "goo"
59
+ }),
60
+ /* @__PURE__ */ jsx2("feComposite", {
61
+ in: "SourceGraphic",
62
+ in2: "goo",
63
+ operator: "atop",
64
+ result: "body"
65
+ }),
66
+ outlineRef && /* @__PURE__ */ jsxs(Fragment, {
67
+ children: [
68
+ /* @__PURE__ */ jsx2("feMorphology", {
69
+ in: "goo",
70
+ operator: "dilate",
71
+ radius: 1,
72
+ result: "grown"
73
+ }),
74
+ /* @__PURE__ */ jsx2("feFlood", {
75
+ ref: outlineRef,
76
+ className: "[flood-color:var(--shadow-color)]"
77
+ }),
78
+ /* @__PURE__ */ jsx2("feComposite", {
79
+ in2: "grown",
80
+ operator: "in",
81
+ result: "outline"
82
+ }),
83
+ /* @__PURE__ */ jsxs("feMerge", {
84
+ children: [
85
+ /* @__PURE__ */ jsx2("feMergeNode", {
86
+ in: "outline"
87
+ }),
88
+ /* @__PURE__ */ jsx2("feMergeNode", {
89
+ in: "body"
90
+ })
91
+ ]
92
+ })
93
+ ]
94
+ })
95
+ ]
96
+ })
97
+ });
98
+ }
99
+ function MorphSurface({ morph, bg, shadow, radius, className, children }) {
100
+ const { refs, gooId, effect } = morph;
101
+ return /* @__PURE__ */ jsxs(Fragment, {
102
+ children: [
103
+ effect === "goo" && /* @__PURE__ */ jsx2(GooFilter, {
104
+ id: gooId,
105
+ blurRef: refs.blur,
106
+ outlineRef: refs.outline
107
+ }),
108
+ (effect === "goo" || effect === "morph") && /* @__PURE__ */ jsxs("div", {
109
+ ref: refs.shapes,
110
+ "aria-hidden": true,
111
+ className: "pointer-events-none absolute hidden",
112
+ style: effect === "goo" ? { filter: `url(#${gooId})` } : undefined,
113
+ children: [
114
+ effect === "goo" && /* @__PURE__ */ jsx2("div", {
115
+ ref: refs.copy,
116
+ className: cn("absolute", bg)
117
+ }),
118
+ /* @__PURE__ */ jsx2("div", {
119
+ ref: refs.shape,
120
+ className: cn("absolute", bg)
121
+ })
122
+ ]
123
+ }),
124
+ /* @__PURE__ */ jsx2("div", {
125
+ ref: refs.bg,
126
+ "aria-hidden": true,
127
+ className: cn("pointer-events-none absolute inset-0", bg, radius)
128
+ }),
129
+ shadow && /* @__PURE__ */ jsx2("div", {
130
+ ref: refs.shadow,
131
+ "aria-hidden": true,
132
+ className: cn("pointer-events-none absolute inset-0", shadow, radius)
133
+ }),
134
+ /* @__PURE__ */ jsx2("div", {
135
+ ref: refs.content,
136
+ className: cn("relative", className),
137
+ children: /* @__PURE__ */ jsx2(MorphPartInOverlay.Provider, {
138
+ value: true,
139
+ children
140
+ })
141
+ })
142
+ ]
143
+ });
144
+ }
145
+
146
+ export { MorphPartScope, MorphPart, GooFilter, MorphSurface };
@@ -0,0 +1,216 @@
1
+ import {
2
+ GOO_BLUR_RATIO,
3
+ GOO_MATRIX
4
+ } from "./components-7nww01w4.js";
5
+ import {
6
+ useReduceMotion
7
+ } from "./components-nnnd2xef.js";
8
+ import {
9
+ spring
10
+ } from "./components-vc1k7yv2.js";
11
+ import {
12
+ cn
13
+ } from "./components-0f0as45n.js";
14
+
15
+ // lib/goo-indicator.tsx
16
+ import { animate, motion, useMotionValue } from "motion/react";
17
+ import { useId, useLayoutEffect, useRef, useState } from "react";
18
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
19
+ var COVERAGE = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0";
20
+ var NECK = 0.5;
21
+ function union(a, b) {
22
+ if (!a)
23
+ return b;
24
+ const left = Math.min(a.left, b.left);
25
+ const top = Math.min(a.top, b.top);
26
+ return {
27
+ left,
28
+ top,
29
+ width: Math.max(a.left + a.width, b.left + b.width) - left,
30
+ height: Math.max(a.top + a.height, b.top + b.height) - top
31
+ };
32
+ }
33
+ function pad(rect, by) {
34
+ return { left: rect.left - by, top: rect.top - by, width: rect.width + by * 2, height: rect.height + by * 2 };
35
+ }
36
+ function center(rect) {
37
+ return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
38
+ }
39
+ function travels(from, to) {
40
+ const a = center(from);
41
+ const b = center(to);
42
+ return Math.abs(b.x - a.x) > Math.min(from.width, to.width) / 2 || Math.abs(b.y - a.y) > Math.min(from.height, to.height) / 2;
43
+ }
44
+ function retract(from, to) {
45
+ const axis = (start, size, toStart, toSize) => {
46
+ const delta = toStart + toSize / 2 - (start + size / 2);
47
+ if (Math.abs(delta) < 1)
48
+ return [start + size * (1 - NECK) / 2, size * NECK];
49
+ return [delta > 0 ? toStart : toStart + toSize, 0];
50
+ };
51
+ const [left, width] = axis(from.left, from.width, to.left, to.width);
52
+ const [top, height] = axis(from.top, from.height, to.top, to.height);
53
+ return { left, top, width, height };
54
+ }
55
+ function toTarget(rect) {
56
+ return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
57
+ }
58
+ function blurOf(el, rect) {
59
+ const r = Number.parseFloat(getComputedStyle(el).borderTopLeftRadius) || 0;
60
+ return Math.min(r, rect.width / 2, rect.height / 2) * GOO_BLUR_RATIO;
61
+ }
62
+ function GooLayer({ active, blur, box, fill, children }) {
63
+ const id = `goo-${useId().replace(/:/g, "")}`;
64
+ const flood = useRef(null);
65
+ const probe = useRef(null);
66
+ const layer = box ? pad(box, blur * 3) : { left: 0, top: 0, width: 0, height: 0 };
67
+ useLayoutEffect(() => {
68
+ if (!active || !probe.current)
69
+ return;
70
+ flood.current?.setAttribute("flood-color", getComputedStyle(probe.current).backgroundColor);
71
+ }, [active]);
72
+ return /* @__PURE__ */ jsxs(Fragment, {
73
+ children: [
74
+ /* @__PURE__ */ jsx("svg", {
75
+ "aria-hidden": true,
76
+ className: "absolute size-0",
77
+ children: /* @__PURE__ */ jsxs("filter", {
78
+ id,
79
+ x: "-50%",
80
+ y: "-50%",
81
+ width: "200%",
82
+ height: "200%",
83
+ colorInterpolationFilters: "sRGB",
84
+ children: [
85
+ /* @__PURE__ */ jsx("feColorMatrix", {
86
+ in: "SourceGraphic",
87
+ values: COVERAGE,
88
+ result: "coverage"
89
+ }),
90
+ /* @__PURE__ */ jsx("feGaussianBlur", {
91
+ in: "coverage",
92
+ stdDeviation: blur,
93
+ result: "blur"
94
+ }),
95
+ /* @__PURE__ */ jsx("feColorMatrix", {
96
+ in: "blur",
97
+ values: GOO_MATRIX,
98
+ result: "goo"
99
+ }),
100
+ /* @__PURE__ */ jsx("feFlood", {
101
+ ref: flood
102
+ }),
103
+ /* @__PURE__ */ jsx("feComposite", {
104
+ in2: "goo",
105
+ operator: "in"
106
+ })
107
+ ]
108
+ })
109
+ }),
110
+ /* @__PURE__ */ jsx("div", {
111
+ "aria-hidden": true,
112
+ className: "pointer-events-none absolute",
113
+ style: { ...layer, filter: active ? `url(#${id})` : undefined },
114
+ children: /* @__PURE__ */ jsx("div", {
115
+ ref: probe,
116
+ className: cn(fill, "absolute"),
117
+ style: { left: -layer.left, top: -layer.top },
118
+ children
119
+ })
120
+ })
121
+ ]
122
+ });
123
+ }
124
+ function GooIndicator({
125
+ rect,
126
+ from,
127
+ className,
128
+ shadow,
129
+ transition = spring.moderate,
130
+ opacity = 1
131
+ }) {
132
+ const reduced = useReduceMotion();
133
+ const start = from ?? rect;
134
+ const x = useMotionValue(start.left);
135
+ const y = useMotionValue(start.top);
136
+ const width = useMotionValue(start.width);
137
+ const height = useMotionValue(start.height);
138
+ const lead = useRef(null);
139
+ const [trails, setTrails] = useState([]);
140
+ const [blur, setBlur] = useState(0);
141
+ const ids = useRef(0);
142
+ const travel = transition === false || reduced ? false : transition;
143
+ const travelRef = useRef(travel);
144
+ travelRef.current = travel;
145
+ const read = () => ({ left: x.get(), top: y.get(), width: width.get(), height: height.get() });
146
+ useLayoutEffect(() => {
147
+ const move = travelRef.current;
148
+ const current = read();
149
+ if (!move) {
150
+ x.jump(rect.left);
151
+ y.jump(rect.top);
152
+ width.jump(rect.width);
153
+ height.jump(rect.height);
154
+ return;
155
+ }
156
+ const goo = lead.current && travels(current, rect) ? blurOf(lead.current, current) : 0;
157
+ if (goo >= 1) {
158
+ setBlur(goo);
159
+ setTrails((list) => [...list, { id: ++ids.current, from: current, to: retract(current, rect) }]);
160
+ }
161
+ animate(x, rect.left, move);
162
+ animate(y, rect.top, move);
163
+ animate(width, rect.width, move);
164
+ animate(height, rect.height, move);
165
+ }, [rect.left, rect.top, rect.width, rect.height]);
166
+ const melting = trails.length > 0;
167
+ const linger = travel ? { ...travel, delay: (travel.duration ?? 0) / 3 } : undefined;
168
+ const shape = cn("pointer-events-none absolute top-0 left-0", className);
169
+ const box = trails.reduce((all, trail) => union(all, trail.from), union(read(), rect));
170
+ const drop = (trail) => setTrails((list) => list.filter((t) => t.id !== trail.id));
171
+ return /* @__PURE__ */ jsxs(motion.div, {
172
+ "aria-hidden": true,
173
+ className: "pointer-events-none absolute top-0 left-0",
174
+ initial: false,
175
+ animate: { opacity },
176
+ transition: { duration: spring.fast.duration },
177
+ children: [
178
+ shadow && /* @__PURE__ */ jsxs(Fragment, {
179
+ children: [
180
+ trails.map((trail) => /* @__PURE__ */ jsx(motion.div, {
181
+ className: cn(shape, shadow),
182
+ initial: { ...toTarget(trail.from), opacity: 1 },
183
+ animate: { ...toTarget(trail.to), opacity: 0 },
184
+ transition: linger
185
+ }, trail.id)),
186
+ /* @__PURE__ */ jsx(motion.div, {
187
+ className: cn(shape, shadow, !melting && "invisible"),
188
+ style: { x, y, width, height }
189
+ })
190
+ ]
191
+ }),
192
+ /* @__PURE__ */ jsxs(GooLayer, {
193
+ active: melting,
194
+ blur,
195
+ box,
196
+ fill: className ?? "",
197
+ children: [
198
+ trails.map((trail) => /* @__PURE__ */ jsx(motion.div, {
199
+ className: shape,
200
+ initial: toTarget(trail.from),
201
+ animate: toTarget(trail.to),
202
+ transition: linger,
203
+ onAnimationComplete: () => drop(trail)
204
+ }, trail.id)),
205
+ /* @__PURE__ */ jsx(motion.div, {
206
+ ref: lead,
207
+ className: cn(shape, !melting && shadow),
208
+ style: { x, y, width, height }
209
+ })
210
+ ]
211
+ })
212
+ ]
213
+ });
214
+ }
215
+
216
+ export { union, GooLayer, GooIndicator };
@@ -0,0 +1,9 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined")
5
+ return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+
9
+ export { __require };
@@ -0,0 +1,141 @@
1
+ // lib/icon-context.tsx
2
+ import {
3
+ ArrowDown,
4
+ ArrowLeft,
5
+ ArrowRight,
6
+ ArrowUp,
7
+ Bell,
8
+ Brain,
9
+ Calendar,
10
+ Check,
11
+ ChevronDown,
12
+ ChevronRight,
13
+ ChevronsUpDown,
14
+ Circle,
15
+ Clock,
16
+ Copy,
17
+ CornerDownLeft,
18
+ CornerDownRight,
19
+ Dot,
20
+ Ellipsis,
21
+ EllipsisVertical,
22
+ Folder,
23
+ Globe,
24
+ Heart,
25
+ Home,
26
+ ImageIcon,
27
+ Inbox,
28
+ Lightbulb,
29
+ Link,
30
+ Loader,
31
+ Lock,
32
+ Mail,
33
+ Menu,
34
+ MessageCircle,
35
+ Monitor,
36
+ Moon,
37
+ Paintbrush,
38
+ Palette,
39
+ PanelLeft,
40
+ PanelLeftDashed,
41
+ PanelRight,
42
+ PanelRightDashed,
43
+ Pause,
44
+ Pencil,
45
+ Pipette,
46
+ Play,
47
+ Plus,
48
+ RectangleHorizontal,
49
+ Rocket,
50
+ RotateCcw,
51
+ Scaling,
52
+ Search,
53
+ Settings,
54
+ Shield,
55
+ SkipForward,
56
+ SlidersHorizontal,
57
+ SquareLibrary,
58
+ Star,
59
+ Sun,
60
+ User,
61
+ Users,
62
+ X
63
+ } from "lucide-react";
64
+ import { createContext, useContext, useMemo } from "react";
65
+ import { jsx } from "react/jsx-runtime";
66
+ var defaultIcons = {
67
+ "chevron-right": ChevronRight,
68
+ "chevron-down": ChevronDown,
69
+ pipette: Pipette,
70
+ x: X,
71
+ copy: Copy,
72
+ menu: Menu,
73
+ dot: Dot,
74
+ monitor: Monitor,
75
+ sun: Sun,
76
+ moon: Moon,
77
+ "rectangle-horizontal": RectangleHorizontal,
78
+ circle: Circle,
79
+ "square-library": SquareLibrary,
80
+ clock: Clock,
81
+ star: Star,
82
+ settings: Settings,
83
+ plus: Plus,
84
+ "arrow-left": ArrowLeft,
85
+ "arrow-right": ArrowRight,
86
+ "arrow-up": ArrowUp,
87
+ "arrow-down": ArrowDown,
88
+ search: Search,
89
+ loader: Loader,
90
+ users: Users,
91
+ lock: Lock,
92
+ mail: Mail,
93
+ bell: Bell,
94
+ shield: Shield,
95
+ palette: Palette,
96
+ lightbulb: Lightbulb,
97
+ rocket: Rocket,
98
+ heart: Heart,
99
+ paintbrush: Paintbrush,
100
+ brain: Brain,
101
+ globe: Globe,
102
+ user: User,
103
+ image: ImageIcon,
104
+ link: Link,
105
+ check: Check,
106
+ "rotate-ccw": RotateCcw,
107
+ play: Play,
108
+ pause: Pause,
109
+ home: Home,
110
+ "message-circle": MessageCircle,
111
+ inbox: Inbox,
112
+ pencil: Pencil,
113
+ scaling: Scaling,
114
+ "skip-forward": SkipForward,
115
+ "corner-down-right": CornerDownRight,
116
+ "corner-down-left": CornerDownLeft,
117
+ "panel-left": PanelLeft,
118
+ "panel-left-dashed": PanelLeftDashed,
119
+ "panel-right": PanelRight,
120
+ "panel-right-dashed": PanelRightDashed,
121
+ "chevrons-up-down": ChevronsUpDown,
122
+ "more-horizontal": Ellipsis,
123
+ "more-vertical": EllipsisVertical,
124
+ calendar: Calendar,
125
+ folder: Folder,
126
+ "sliders-horizontal": SlidersHorizontal
127
+ };
128
+ var IconContext = createContext(null);
129
+ function useIcon(name) {
130
+ const icons = useContext(IconContext);
131
+ return (icons ?? defaultIcons)[name];
132
+ }
133
+ function IconProvider({ children, icons }) {
134
+ const value = useMemo(() => ({ ...defaultIcons, ...icons }), [icons]);
135
+ return /* @__PURE__ */ jsx(IconContext.Provider, {
136
+ value,
137
+ children
138
+ });
139
+ }
140
+
141
+ export { useIcon, IconProvider };