laif-ds 0.1.5 → 0.1.7

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 (135) hide show
  1. package/dist/_virtual/_cloneBuffer.js +5 -0
  2. package/dist/_virtual/dayjs.min.js +8 -0
  3. package/dist/_virtual/dayjs.min2.js +5 -0
  4. package/dist/_virtual/debounce.js +8 -0
  5. package/dist/_virtual/index5.js +5 -2
  6. package/dist/_virtual/index6.js +5 -0
  7. package/dist/_virtual/index7.js +5 -0
  8. package/dist/_virtual/localizedFormat.js +8 -0
  9. package/dist/_virtual/localizedFormat2.js +5 -0
  10. package/dist/_virtual/omit.js +8 -0
  11. package/dist/components/ui/data-table.js +122 -0
  12. package/dist/components/ui/gantt/assets/icons/MinusSquareOutlined.js +36 -0
  13. package/dist/components/ui/gantt/assets/icons/PlusSquareOutlined.js +45 -0
  14. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +115 -0
  15. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +158 -0
  16. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +36 -0
  17. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +26 -0
  18. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRowContext.js +14 -0
  19. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +75 -0
  20. package/dist/components/ui/gantt/components/Chart/Chart.js +66 -0
  21. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +88 -0
  22. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -0
  23. package/dist/components/ui/gantt/components/Controls/Controls.js +82 -0
  24. package/dist/components/ui/gantt/components/Gantt/Gantt.js +58 -0
  25. package/dist/components/ui/gantt/components/Gantt/GanttContext.js +35 -0
  26. package/dist/components/ui/gantt/constants/DimensionsSettings.js +89 -0
  27. package/dist/components/ui/gantt/constants/DragStepOptions.js +43 -0
  28. package/dist/components/ui/gantt/constants/GanttConsts.js +17 -0
  29. package/dist/components/ui/gantt/constants/colors.json.js +106 -0
  30. package/dist/components/ui/gantt/enums/DataRepeatTimes.js +5 -0
  31. package/dist/components/ui/gantt/enums/DragStepSizes.js +5 -0
  32. package/dist/components/ui/gantt/enums/DragTypes.js +5 -0
  33. package/dist/components/ui/gantt/enums/GanttDimensions.js +5 -0
  34. package/dist/components/ui/gantt/enums/GanttUnitOfTimes.js +5 -0
  35. package/dist/components/ui/gantt/hooks/useForwardRef.js +11 -0
  36. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +30 -0
  37. package/dist/components/ui/gantt/utils/getInitialScrollOffset.js +11 -0
  38. package/dist/components/ui/gantt/utils/getScaleDates.js +14 -0
  39. package/dist/components/ui/gantt/utils/getScaleItems.js +33 -0
  40. package/dist/components/ui/gantt/utils/getWholeWidth.js +7 -0
  41. package/dist/components/ui/gantt/utils/transformData.js +36 -0
  42. package/dist/components/ui/toaster.js +26 -0
  43. package/dist/dist/_virtual/jsx-runtime.js +6 -0
  44. package/dist/dist/_virtual/jsx-runtime2.js +5 -0
  45. package/dist/dist/_virtual/react-jsx-runtime.development.js +5 -0
  46. package/dist/dist/_virtual/react-jsx-runtime.production.js +5 -0
  47. package/dist/dist/components/ui/checkbox.js +32 -0
  48. package/dist/dist/components/ui/scroll-area.js +61 -0
  49. package/dist/dist/components/ui/table.js +87 -0
  50. package/dist/dist/lib/utils.js +9 -0
  51. package/dist/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
  52. package/dist/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
  53. package/dist/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +136 -0
  54. package/dist/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
  55. package/dist/dist/node_modules/@radix-ui/react-context/dist/index.js +56 -0
  56. package/dist/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  57. package/dist/dist/node_modules/@radix-ui/react-presence/dist/index.js +72 -0
  58. package/dist/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
  59. package/dist/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +534 -0
  60. package/dist/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  61. package/dist/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
  62. package/dist/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +33 -0
  63. package/dist/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  64. package/dist/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +9 -0
  65. package/dist/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
  66. package/dist/dist/node_modules/clsx/dist/clsx.js +18 -0
  67. package/dist/dist/node_modules/lucide-react/dist/esm/Icon.js +41 -0
  68. package/dist/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +28 -0
  69. package/dist/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
  70. package/dist/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
  71. package/dist/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +20 -0
  72. package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +248 -0
  73. package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
  74. package/dist/dist/node_modules/react/jsx-runtime.js +11 -0
  75. package/dist/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2732 -0
  76. package/dist/index.d.ts +191 -1
  77. package/dist/index.js +303 -295
  78. package/dist/laif-ds.css +1 -0
  79. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
  80. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
  81. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
  82. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
  83. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +57 -0
  84. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2150 -0
  85. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +27 -0
  86. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +184 -0
  87. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +103 -0
  88. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1896 -0
  89. package/dist/node_modules/classnames/index.js +43 -0
  90. package/dist/node_modules/dayjs/dayjs.min.js +283 -0
  91. package/dist/node_modules/dayjs/plugin/localizedFormat.js +30 -0
  92. package/dist/node_modules/lodash/_arrayEach.js +15 -0
  93. package/dist/node_modules/lodash/_assignValue.js +17 -0
  94. package/dist/node_modules/lodash/_baseAssign.js +16 -0
  95. package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
  96. package/dist/node_modules/lodash/_baseAssignValue.js +20 -0
  97. package/dist/node_modules/lodash/_baseClone.js +71 -0
  98. package/dist/node_modules/lodash/_baseCreate.js +24 -0
  99. package/dist/node_modules/lodash/_baseIsMap.js +16 -0
  100. package/dist/node_modules/lodash/_baseIsSet.js +16 -0
  101. package/dist/node_modules/lodash/_baseKeysIn.js +22 -0
  102. package/dist/node_modules/lodash/_baseUnset.js +18 -0
  103. package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
  104. package/dist/node_modules/lodash/_cloneBuffer.js +20 -0
  105. package/dist/node_modules/lodash/_cloneDataView.js +16 -0
  106. package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
  107. package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
  108. package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
  109. package/dist/node_modules/lodash/_copyArray.js +16 -0
  110. package/dist/node_modules/lodash/_copyObject.js +22 -0
  111. package/dist/node_modules/lodash/_copySymbols.js +16 -0
  112. package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
  113. package/dist/node_modules/lodash/_customOmitClone.js +15 -0
  114. package/dist/node_modules/lodash/_flatRest.js +17 -0
  115. package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
  116. package/dist/node_modules/lodash/_getPrototype.js +12 -0
  117. package/dist/node_modules/lodash/_getSymbolsIn.js +19 -0
  118. package/dist/node_modules/lodash/_initCloneArray.js +15 -0
  119. package/dist/node_modules/lodash/_initCloneByTag.js +49 -0
  120. package/dist/node_modules/lodash/_initCloneObject.js +17 -0
  121. package/dist/node_modules/lodash/_nativeKeysIn.js +17 -0
  122. package/dist/node_modules/lodash/_parent.js +16 -0
  123. package/dist/node_modules/lodash/flatten.js +16 -0
  124. package/dist/node_modules/lodash/isMap.js +14 -0
  125. package/dist/node_modules/lodash/isPlainObject.js +23 -0
  126. package/dist/node_modules/lodash/isSet.js +14 -0
  127. package/dist/node_modules/lodash/keysIn.js +17 -0
  128. package/dist/node_modules/lodash/last.js +14 -0
  129. package/dist/node_modules/lodash/omit.js +30 -0
  130. package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
  131. package/dist/node_modules/react-window/dist/index.esm.js +375 -0
  132. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  133. package/dist/styles.css +1 -1
  134. package/package.json +16 -7
  135. package/dist/components/ui/sonner.js +0 -23
@@ -0,0 +1,534 @@
1
+ "use client";
2
+ import * as i from "react";
3
+ import { Primitive as _ } from "../../react-primitive/dist/index.js";
4
+ import { Presence as W } from "../../react-presence/dist/index.js";
5
+ import { createContextScope as te } from "../../react-context/dist/index.js";
6
+ import { useComposedRefs as x } from "../../react-compose-refs/dist/index.js";
7
+ import { useCallbackRef as E } from "../../react-use-callback-ref/dist/index.js";
8
+ import { useDirection as ne } from "../../react-direction/dist/index.js";
9
+ import { useLayoutEffect as le } from "../../react-use-layout-effect/dist/index.js";
10
+ import { clamp as ie } from "../../number/dist/index.js";
11
+ import { composeEventHandlers as C } from "../../primitive/dist/index.js";
12
+ import { j as h } from "../../../../_virtual/jsx-runtime.js";
13
+ function ae(e, t) {
14
+ return i.useReducer((r, l) => t[r][l] ?? r, e);
15
+ }
16
+ var O = "ScrollArea", [F, Le] = te(O), [se, b] = F(O), B = i.forwardRef(
17
+ (e, t) => {
18
+ const {
19
+ __scopeScrollArea: r,
20
+ type: l = "hover",
21
+ dir: o,
22
+ scrollHideDelay: n = 600,
23
+ ...a
24
+ } = e, [s, c] = i.useState(null), [f, d] = i.useState(null), [p, u] = i.useState(null), [w, m] = i.useState(null), [X, M] = i.useState(null), [y, A] = i.useState(0), [I, L] = i.useState(0), [D, R] = i.useState(!1), [j, z] = i.useState(!1), v = x(t, (P) => c(P)), S = ne(o);
25
+ return /* @__PURE__ */ h.jsx(
26
+ se,
27
+ {
28
+ scope: r,
29
+ type: l,
30
+ dir: S,
31
+ scrollHideDelay: n,
32
+ scrollArea: s,
33
+ viewport: f,
34
+ onViewportChange: d,
35
+ content: p,
36
+ onContentChange: u,
37
+ scrollbarX: w,
38
+ onScrollbarXChange: m,
39
+ scrollbarXEnabled: D,
40
+ onScrollbarXEnabledChange: R,
41
+ scrollbarY: X,
42
+ onScrollbarYChange: M,
43
+ scrollbarYEnabled: j,
44
+ onScrollbarYEnabledChange: z,
45
+ onCornerWidthChange: A,
46
+ onCornerHeightChange: L,
47
+ children: /* @__PURE__ */ h.jsx(
48
+ _.div,
49
+ {
50
+ dir: S,
51
+ ...a,
52
+ ref: v,
53
+ style: {
54
+ position: "relative",
55
+ // Pass corner sizes as CSS vars to reduce re-renders of context consumers
56
+ "--radix-scroll-area-corner-width": y + "px",
57
+ "--radix-scroll-area-corner-height": I + "px",
58
+ ...e.style
59
+ }
60
+ }
61
+ )
62
+ }
63
+ );
64
+ }
65
+ );
66
+ B.displayName = O;
67
+ var q = "ScrollAreaViewport", G = i.forwardRef(
68
+ (e, t) => {
69
+ const { __scopeScrollArea: r, children: l, nonce: o, ...n } = e, a = b(q, r), s = i.useRef(null), c = x(t, s, a.onViewportChange);
70
+ return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
71
+ /* @__PURE__ */ h.jsx(
72
+ "style",
73
+ {
74
+ dangerouslySetInnerHTML: {
75
+ __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
76
+ },
77
+ nonce: o
78
+ }
79
+ ),
80
+ /* @__PURE__ */ h.jsx(
81
+ _.div,
82
+ {
83
+ "data-radix-scroll-area-viewport": "",
84
+ ...n,
85
+ ref: c,
86
+ style: {
87
+ /**
88
+ * We don't support `visible` because the intention is to have at least one scrollbar
89
+ * if this component is used and `visible` will behave like `auto` in that case
90
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
91
+ *
92
+ * We don't handle `auto` because the intention is for the native implementation
93
+ * to be hidden if using this component. We just want to ensure the node is scrollable
94
+ * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
95
+ * the browser from having to work out whether to render native scrollbars or not,
96
+ * we tell it to with the intention of hiding them in CSS.
97
+ */
98
+ overflowX: a.scrollbarXEnabled ? "scroll" : "hidden",
99
+ overflowY: a.scrollbarYEnabled ? "scroll" : "hidden",
100
+ ...e.style
101
+ },
102
+ children: /* @__PURE__ */ h.jsx("div", { ref: a.onContentChange, style: { minWidth: "100%", display: "table" }, children: l })
103
+ }
104
+ )
105
+ ] });
106
+ }
107
+ );
108
+ G.displayName = q;
109
+ var g = "ScrollAreaScrollbar", ce = i.forwardRef(
110
+ (e, t) => {
111
+ const { forceMount: r, ...l } = e, o = b(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: a } = o, s = e.orientation === "horizontal";
112
+ return i.useEffect(() => (s ? n(!0) : a(!0), () => {
113
+ s ? n(!1) : a(!1);
114
+ }), [s, n, a]), o.type === "hover" ? /* @__PURE__ */ h.jsx(de, { ...l, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ h.jsx(ue, { ...l, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ h.jsx(J, { ...l, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ h.jsx(U, { ...l, ref: t }) : null;
115
+ }
116
+ );
117
+ ce.displayName = g;
118
+ var de = i.forwardRef((e, t) => {
119
+ const { forceMount: r, ...l } = e, o = b(g, e.__scopeScrollArea), [n, a] = i.useState(!1);
120
+ return i.useEffect(() => {
121
+ const s = o.scrollArea;
122
+ let c = 0;
123
+ if (s) {
124
+ const f = () => {
125
+ window.clearTimeout(c), a(!0);
126
+ }, d = () => {
127
+ c = window.setTimeout(() => a(!1), o.scrollHideDelay);
128
+ };
129
+ return s.addEventListener("pointerenter", f), s.addEventListener("pointerleave", d), () => {
130
+ window.clearTimeout(c), s.removeEventListener("pointerenter", f), s.removeEventListener("pointerleave", d);
131
+ };
132
+ }
133
+ }, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ h.jsx(W, { present: r || n, children: /* @__PURE__ */ h.jsx(
134
+ J,
135
+ {
136
+ "data-state": n ? "visible" : "hidden",
137
+ ...l,
138
+ ref: t
139
+ }
140
+ ) });
141
+ }), ue = i.forwardRef((e, t) => {
142
+ const { forceMount: r, ...l } = e, o = b(g, e.__scopeScrollArea), n = e.orientation === "horizontal", a = Y(() => c("SCROLL_END"), 100), [s, c] = ae("hidden", {
143
+ hidden: {
144
+ SCROLL: "scrolling"
145
+ },
146
+ scrolling: {
147
+ SCROLL_END: "idle",
148
+ POINTER_ENTER: "interacting"
149
+ },
150
+ interacting: {
151
+ SCROLL: "interacting",
152
+ POINTER_LEAVE: "idle"
153
+ },
154
+ idle: {
155
+ HIDE: "hidden",
156
+ SCROLL: "scrolling",
157
+ POINTER_ENTER: "interacting"
158
+ }
159
+ });
160
+ return i.useEffect(() => {
161
+ if (s === "idle") {
162
+ const f = window.setTimeout(() => c("HIDE"), o.scrollHideDelay);
163
+ return () => window.clearTimeout(f);
164
+ }
165
+ }, [s, o.scrollHideDelay, c]), i.useEffect(() => {
166
+ const f = o.viewport, d = n ? "scrollLeft" : "scrollTop";
167
+ if (f) {
168
+ let p = f[d];
169
+ const u = () => {
170
+ const w = f[d];
171
+ p !== w && (c("SCROLL"), a()), p = w;
172
+ };
173
+ return f.addEventListener("scroll", u), () => f.removeEventListener("scroll", u);
174
+ }
175
+ }, [o.viewport, n, c, a]), /* @__PURE__ */ h.jsx(W, { present: r || s !== "hidden", children: /* @__PURE__ */ h.jsx(
176
+ U,
177
+ {
178
+ "data-state": s === "hidden" ? "hidden" : "visible",
179
+ ...l,
180
+ ref: t,
181
+ onPointerEnter: C(e.onPointerEnter, () => c("POINTER_ENTER")),
182
+ onPointerLeave: C(e.onPointerLeave, () => c("POINTER_LEAVE"))
183
+ }
184
+ ) });
185
+ }), J = i.forwardRef((e, t) => {
186
+ const r = b(g, e.__scopeScrollArea), { forceMount: l, ...o } = e, [n, a] = i.useState(!1), s = e.orientation === "horizontal", c = Y(() => {
187
+ if (r.viewport) {
188
+ const f = r.viewport.offsetWidth < r.viewport.scrollWidth, d = r.viewport.offsetHeight < r.viewport.scrollHeight;
189
+ a(s ? f : d);
190
+ }
191
+ }, 10);
192
+ return T(r.viewport, c), T(r.content, c), /* @__PURE__ */ h.jsx(W, { present: l || n, children: /* @__PURE__ */ h.jsx(
193
+ U,
194
+ {
195
+ "data-state": n ? "visible" : "hidden",
196
+ ...o,
197
+ ref: t
198
+ }
199
+ ) });
200
+ }), U = i.forwardRef((e, t) => {
201
+ const { orientation: r = "vertical", ...l } = e, o = b(g, e.__scopeScrollArea), n = i.useRef(null), a = i.useRef(0), [s, c] = i.useState({
202
+ content: 0,
203
+ viewport: 0,
204
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
205
+ }), f = ee(s.viewport, s.content), d = {
206
+ ...l,
207
+ sizes: s,
208
+ onSizesChange: c,
209
+ hasThumb: f > 0 && f < 1,
210
+ onThumbChange: (u) => n.current = u,
211
+ onThumbPointerUp: () => a.current = 0,
212
+ onThumbPointerDown: (u) => a.current = u
213
+ };
214
+ function p(u, w) {
215
+ return me(u, a.current, s, w);
216
+ }
217
+ return r === "horizontal" ? /* @__PURE__ */ h.jsx(
218
+ fe,
219
+ {
220
+ ...d,
221
+ ref: t,
222
+ onThumbPositionChange: () => {
223
+ if (o.viewport && n.current) {
224
+ const u = o.viewport.scrollLeft, w = V(u, s, o.dir);
225
+ n.current.style.transform = `translate3d(${w}px, 0, 0)`;
226
+ }
227
+ },
228
+ onWheelScroll: (u) => {
229
+ o.viewport && (o.viewport.scrollLeft = u);
230
+ },
231
+ onDragScroll: (u) => {
232
+ o.viewport && (o.viewport.scrollLeft = p(u, o.dir));
233
+ }
234
+ }
235
+ ) : r === "vertical" ? /* @__PURE__ */ h.jsx(
236
+ pe,
237
+ {
238
+ ...d,
239
+ ref: t,
240
+ onThumbPositionChange: () => {
241
+ if (o.viewport && n.current) {
242
+ const u = o.viewport.scrollTop, w = V(u, s);
243
+ n.current.style.transform = `translate3d(0, ${w}px, 0)`;
244
+ }
245
+ },
246
+ onWheelScroll: (u) => {
247
+ o.viewport && (o.viewport.scrollTop = u);
248
+ },
249
+ onDragScroll: (u) => {
250
+ o.viewport && (o.viewport.scrollTop = p(u));
251
+ }
252
+ }
253
+ ) : null;
254
+ }), fe = i.forwardRef((e, t) => {
255
+ const { sizes: r, onSizesChange: l, ...o } = e, n = b(g, e.__scopeScrollArea), [a, s] = i.useState(), c = i.useRef(null), f = x(t, c, n.onScrollbarXChange);
256
+ return i.useEffect(() => {
257
+ c.current && s(getComputedStyle(c.current));
258
+ }, [c]), /* @__PURE__ */ h.jsx(
259
+ Q,
260
+ {
261
+ "data-orientation": "horizontal",
262
+ ...o,
263
+ ref: f,
264
+ sizes: r,
265
+ style: {
266
+ bottom: 0,
267
+ left: n.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
268
+ right: n.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
269
+ "--radix-scroll-area-thumb-width": N(r) + "px",
270
+ ...e.style
271
+ },
272
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
273
+ onDragScroll: (d) => e.onDragScroll(d.x),
274
+ onWheelScroll: (d, p) => {
275
+ if (n.viewport) {
276
+ const u = n.viewport.scrollLeft + d.deltaX;
277
+ e.onWheelScroll(u), oe(u, p) && d.preventDefault();
278
+ }
279
+ },
280
+ onResize: () => {
281
+ c.current && n.viewport && a && l({
282
+ content: n.viewport.scrollWidth,
283
+ viewport: n.viewport.offsetWidth,
284
+ scrollbar: {
285
+ size: c.current.clientWidth,
286
+ paddingStart: H(a.paddingLeft),
287
+ paddingEnd: H(a.paddingRight)
288
+ }
289
+ });
290
+ }
291
+ }
292
+ );
293
+ }), pe = i.forwardRef((e, t) => {
294
+ const { sizes: r, onSizesChange: l, ...o } = e, n = b(g, e.__scopeScrollArea), [a, s] = i.useState(), c = i.useRef(null), f = x(t, c, n.onScrollbarYChange);
295
+ return i.useEffect(() => {
296
+ c.current && s(getComputedStyle(c.current));
297
+ }, [c]), /* @__PURE__ */ h.jsx(
298
+ Q,
299
+ {
300
+ "data-orientation": "vertical",
301
+ ...o,
302
+ ref: f,
303
+ sizes: r,
304
+ style: {
305
+ top: 0,
306
+ right: n.dir === "ltr" ? 0 : void 0,
307
+ left: n.dir === "rtl" ? 0 : void 0,
308
+ bottom: "var(--radix-scroll-area-corner-height)",
309
+ "--radix-scroll-area-thumb-height": N(r) + "px",
310
+ ...e.style
311
+ },
312
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
313
+ onDragScroll: (d) => e.onDragScroll(d.y),
314
+ onWheelScroll: (d, p) => {
315
+ if (n.viewport) {
316
+ const u = n.viewport.scrollTop + d.deltaY;
317
+ e.onWheelScroll(u), oe(u, p) && d.preventDefault();
318
+ }
319
+ },
320
+ onResize: () => {
321
+ c.current && n.viewport && a && l({
322
+ content: n.viewport.scrollHeight,
323
+ viewport: n.viewport.offsetHeight,
324
+ scrollbar: {
325
+ size: c.current.clientHeight,
326
+ paddingStart: H(a.paddingTop),
327
+ paddingEnd: H(a.paddingBottom)
328
+ }
329
+ });
330
+ }
331
+ }
332
+ );
333
+ }), [he, K] = F(g), Q = i.forwardRef((e, t) => {
334
+ const {
335
+ __scopeScrollArea: r,
336
+ sizes: l,
337
+ hasThumb: o,
338
+ onThumbChange: n,
339
+ onThumbPointerUp: a,
340
+ onThumbPointerDown: s,
341
+ onThumbPositionChange: c,
342
+ onDragScroll: f,
343
+ onWheelScroll: d,
344
+ onResize: p,
345
+ ...u
346
+ } = e, w = b(g, r), [m, X] = i.useState(null), M = x(t, (v) => X(v)), y = i.useRef(null), A = i.useRef(""), I = w.viewport, L = l.content - l.viewport, D = E(d), R = E(c), j = Y(p, 10);
347
+ function z(v) {
348
+ if (y.current) {
349
+ const S = v.clientX - y.current.left, P = v.clientY - y.current.top;
350
+ f({ x: S, y: P });
351
+ }
352
+ }
353
+ return i.useEffect(() => {
354
+ const v = (S) => {
355
+ const P = S.target;
356
+ m != null && m.contains(P) && D(S, L);
357
+ };
358
+ return document.addEventListener("wheel", v, { passive: !1 }), () => document.removeEventListener("wheel", v, { passive: !1 });
359
+ }, [I, m, L, D]), i.useEffect(R, [l, R]), T(m, j), T(w.content, j), /* @__PURE__ */ h.jsx(
360
+ he,
361
+ {
362
+ scope: r,
363
+ scrollbar: m,
364
+ hasThumb: o,
365
+ onThumbChange: E(n),
366
+ onThumbPointerUp: E(a),
367
+ onThumbPositionChange: R,
368
+ onThumbPointerDown: E(s),
369
+ children: /* @__PURE__ */ h.jsx(
370
+ _.div,
371
+ {
372
+ ...u,
373
+ ref: M,
374
+ style: { position: "absolute", ...u.style },
375
+ onPointerDown: C(e.onPointerDown, (v) => {
376
+ v.button === 0 && (v.target.setPointerCapture(v.pointerId), y.current = m.getBoundingClientRect(), A.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", w.viewport && (w.viewport.style.scrollBehavior = "auto"), z(v));
377
+ }),
378
+ onPointerMove: C(e.onPointerMove, z),
379
+ onPointerUp: C(e.onPointerUp, (v) => {
380
+ const S = v.target;
381
+ S.hasPointerCapture(v.pointerId) && S.releasePointerCapture(v.pointerId), document.body.style.webkitUserSelect = A.current, w.viewport && (w.viewport.style.scrollBehavior = ""), y.current = null;
382
+ })
383
+ }
384
+ )
385
+ }
386
+ );
387
+ }), $ = "ScrollAreaThumb", we = i.forwardRef(
388
+ (e, t) => {
389
+ const { forceMount: r, ...l } = e, o = K($, e.__scopeScrollArea);
390
+ return /* @__PURE__ */ h.jsx(W, { present: r || o.hasThumb, children: /* @__PURE__ */ h.jsx(ve, { ref: t, ...l }) });
391
+ }
392
+ ), ve = i.forwardRef(
393
+ (e, t) => {
394
+ const { __scopeScrollArea: r, style: l, ...o } = e, n = b($, r), a = K($, r), { onThumbPositionChange: s } = a, c = x(
395
+ t,
396
+ (p) => a.onThumbChange(p)
397
+ ), f = i.useRef(void 0), d = Y(() => {
398
+ f.current && (f.current(), f.current = void 0);
399
+ }, 100);
400
+ return i.useEffect(() => {
401
+ const p = n.viewport;
402
+ if (p) {
403
+ const u = () => {
404
+ if (d(), !f.current) {
405
+ const w = Se(p, s);
406
+ f.current = w, s();
407
+ }
408
+ };
409
+ return s(), p.addEventListener("scroll", u), () => p.removeEventListener("scroll", u);
410
+ }
411
+ }, [n.viewport, d, s]), /* @__PURE__ */ h.jsx(
412
+ _.div,
413
+ {
414
+ "data-state": a.hasThumb ? "visible" : "hidden",
415
+ ...o,
416
+ ref: c,
417
+ style: {
418
+ width: "var(--radix-scroll-area-thumb-width)",
419
+ height: "var(--radix-scroll-area-thumb-height)",
420
+ ...l
421
+ },
422
+ onPointerDownCapture: C(e.onPointerDownCapture, (p) => {
423
+ const u = p.target.getBoundingClientRect(), w = p.clientX - u.left, m = p.clientY - u.top;
424
+ a.onThumbPointerDown({ x: w, y: m });
425
+ }),
426
+ onPointerUp: C(e.onPointerUp, a.onThumbPointerUp)
427
+ }
428
+ );
429
+ }
430
+ );
431
+ we.displayName = $;
432
+ var k = "ScrollAreaCorner", Z = i.forwardRef(
433
+ (e, t) => {
434
+ const r = b(k, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
435
+ return r.type !== "scroll" && l ? /* @__PURE__ */ h.jsx(be, { ...e, ref: t }) : null;
436
+ }
437
+ );
438
+ Z.displayName = k;
439
+ var be = i.forwardRef((e, t) => {
440
+ const { __scopeScrollArea: r, ...l } = e, o = b(k, r), [n, a] = i.useState(0), [s, c] = i.useState(0), f = !!(n && s);
441
+ return T(o.scrollbarX, () => {
442
+ var d;
443
+ const p = ((d = o.scrollbarX) == null ? void 0 : d.offsetHeight) || 0;
444
+ o.onCornerHeightChange(p), c(p);
445
+ }), T(o.scrollbarY, () => {
446
+ var d;
447
+ const p = ((d = o.scrollbarY) == null ? void 0 : d.offsetWidth) || 0;
448
+ o.onCornerWidthChange(p), a(p);
449
+ }), f ? /* @__PURE__ */ h.jsx(
450
+ _.div,
451
+ {
452
+ ...l,
453
+ ref: t,
454
+ style: {
455
+ width: n,
456
+ height: s,
457
+ position: "absolute",
458
+ right: o.dir === "ltr" ? 0 : void 0,
459
+ left: o.dir === "rtl" ? 0 : void 0,
460
+ bottom: 0,
461
+ ...e.style
462
+ }
463
+ }
464
+ ) : null;
465
+ });
466
+ function H(e) {
467
+ return e ? parseInt(e, 10) : 0;
468
+ }
469
+ function ee(e, t) {
470
+ const r = e / t;
471
+ return isNaN(r) ? 0 : r;
472
+ }
473
+ function N(e) {
474
+ const t = ee(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, l = (e.scrollbar.size - r) * t;
475
+ return Math.max(l, 18);
476
+ }
477
+ function me(e, t, r, l = "ltr") {
478
+ const o = N(r), n = o / 2, a = t || n, s = o - a, c = r.scrollbar.paddingStart + a, f = r.scrollbar.size - r.scrollbar.paddingEnd - s, d = r.content - r.viewport, p = l === "ltr" ? [0, d] : [d * -1, 0];
479
+ return re([c, f], p)(e);
480
+ }
481
+ function V(e, t, r = "ltr") {
482
+ const l = N(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, n = t.scrollbar.size - o, a = t.content - t.viewport, s = n - l, c = r === "ltr" ? [0, a] : [a * -1, 0], f = ie(e, c);
483
+ return re([0, a], [0, s])(f);
484
+ }
485
+ function re(e, t) {
486
+ return (r) => {
487
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
488
+ const l = (t[1] - t[0]) / (e[1] - e[0]);
489
+ return t[0] + l * (r - e[0]);
490
+ };
491
+ }
492
+ function oe(e, t) {
493
+ return e > 0 && e < t;
494
+ }
495
+ var Se = (e, t = () => {
496
+ }) => {
497
+ let r = { left: e.scrollLeft, top: e.scrollTop }, l = 0;
498
+ return function o() {
499
+ const n = { left: e.scrollLeft, top: e.scrollTop }, a = r.left !== n.left, s = r.top !== n.top;
500
+ (a || s) && t(), r = n, l = window.requestAnimationFrame(o);
501
+ }(), () => window.cancelAnimationFrame(l);
502
+ };
503
+ function Y(e, t) {
504
+ const r = E(e), l = i.useRef(0);
505
+ return i.useEffect(() => () => window.clearTimeout(l.current), []), i.useCallback(() => {
506
+ window.clearTimeout(l.current), l.current = window.setTimeout(r, t);
507
+ }, [r, t]);
508
+ }
509
+ function T(e, t) {
510
+ const r = E(t);
511
+ le(() => {
512
+ let l = 0;
513
+ if (e) {
514
+ const o = new ResizeObserver(() => {
515
+ cancelAnimationFrame(l), l = window.requestAnimationFrame(r);
516
+ });
517
+ return o.observe(e), () => {
518
+ window.cancelAnimationFrame(l), o.unobserve(e);
519
+ };
520
+ }
521
+ }, [e, r]);
522
+ }
523
+ var De = B, je = G, ze = Z;
524
+ export {
525
+ ze as Corner,
526
+ De as Root,
527
+ B as ScrollArea,
528
+ Z as ScrollAreaCorner,
529
+ ce as ScrollAreaScrollbar,
530
+ we as ScrollAreaThumb,
531
+ G as ScrollAreaViewport,
532
+ je as Viewport,
533
+ Le as createScrollAreaScope
534
+ };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import * as t from "react";
3
+ import { composeRefs as m } from "../../react-compose-refs/dist/index.js";
4
+ import { j as f } from "../../../../_virtual/jsx-runtime.js";
5
+ // @__NO_SIDE_EFFECTS__
6
+ function C(e) {
7
+ const i = /* @__PURE__ */ y(e), o = t.forwardRef((n, r) => {
8
+ const { children: l, ...s } = n, c = t.Children.toArray(l), p = c.find(g);
9
+ if (p) {
10
+ const a = p.props.children, u = c.map((d) => d === p ? t.Children.count(a) > 1 ? t.Children.only(null) : t.isValidElement(a) ? a.props.children : null : d);
11
+ return /* @__PURE__ */ f.jsx(i, { ...s, ref: r, children: t.isValidElement(a) ? t.cloneElement(a, void 0, u) : null });
12
+ }
13
+ return /* @__PURE__ */ f.jsx(i, { ...s, ref: r, children: l });
14
+ });
15
+ return o.displayName = `${e}.Slot`, o;
16
+ }
17
+ // @__NO_SIDE_EFFECTS__
18
+ function y(e) {
19
+ const i = t.forwardRef((o, n) => {
20
+ const { children: r, ...l } = o;
21
+ if (t.isValidElement(r)) {
22
+ const s = x(r), c = R(l, r.props);
23
+ return r.type !== t.Fragment && (c.ref = n ? m(n, s) : s), t.cloneElement(r, c);
24
+ }
25
+ return t.Children.count(r) > 1 ? t.Children.only(null) : null;
26
+ });
27
+ return i.displayName = `${e}.SlotClone`, i;
28
+ }
29
+ var h = Symbol("radix.slottable");
30
+ function g(e) {
31
+ return t.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === h;
32
+ }
33
+ function R(e, i) {
34
+ const o = { ...i };
35
+ for (const n in i) {
36
+ const r = e[n], l = i[n];
37
+ /^on[A-Z]/.test(n) ? r && l ? o[n] = (...s) => {
38
+ l(...s), r(...s);
39
+ } : r && (o[n] = r) : n === "style" ? o[n] = { ...r, ...l } : n === "className" && (o[n] = [r, l].filter(Boolean).join(" "));
40
+ }
41
+ return { ...e, ...o };
42
+ }
43
+ function x(e) {
44
+ var i, o;
45
+ let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, r = n && "isReactWarning" in n && n.isReactWarning;
46
+ return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
47
+ }
48
+ export {
49
+ C as createSlot
50
+ };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import * as u from "react";
3
+ function n(r) {
4
+ const e = u.useRef(r);
5
+ return u.useEffect(() => {
6
+ e.current = r;
7
+ }), u.useMemo(() => (...c) => {
8
+ var t;
9
+ return (t = e.current) == null ? void 0 : t.call(e, ...c);
10
+ }, []);
11
+ }
12
+ export {
13
+ n as useCallbackRef
14
+ };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import * as u from "react";
3
+ import { useCallbackRef as c } from "../../react-use-callback-ref/dist/index.js";
4
+ function m({
5
+ prop: e,
6
+ defaultProp: s,
7
+ onChange: a = () => {
8
+ }
9
+ }) {
10
+ const [o, n] = C({ defaultProp: s, onChange: a }), t = e !== void 0, i = t ? e : o, f = c(a), p = u.useCallback(
11
+ (r) => {
12
+ if (t) {
13
+ const l = typeof r == "function" ? r(e) : r;
14
+ l !== e && f(l);
15
+ } else
16
+ n(r);
17
+ },
18
+ [t, e, n, f]
19
+ );
20
+ return [i, p];
21
+ }
22
+ function C({
23
+ defaultProp: e,
24
+ onChange: s
25
+ }) {
26
+ const a = u.useState(e), [o] = a, n = u.useRef(o), t = c(s);
27
+ return u.useEffect(() => {
28
+ n.current !== o && (t(o), n.current = o);
29
+ }, [o, n, t]), a;
30
+ }
31
+ export {
32
+ m as useControllableState
33
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import * as t from "react";
3
+ var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
4
+ };
5
+ export {
6
+ e as useLayoutEffect
7
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import * as r from "react";
3
+ function t(e) {
4
+ const u = r.useRef({ value: e, previous: e });
5
+ return r.useMemo(() => (u.current.value !== e && (u.current.previous = u.current.value, u.current.value = e), u.current.previous), [e]);
6
+ }
7
+ export {
8
+ t as usePrevious
9
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import * as a from "react";
3
+ import { useLayoutEffect as b } from "../../react-use-layout-effect/dist/index.js";
4
+ function d(e) {
5
+ const [u, t] = a.useState(void 0);
6
+ return b(() => {
7
+ if (e) {
8
+ t({ width: e.offsetWidth, height: e.offsetHeight });
9
+ const f = new ResizeObserver((o) => {
10
+ if (!Array.isArray(o) || !o.length)
11
+ return;
12
+ const n = o[0];
13
+ let i, s;
14
+ if ("borderBoxSize" in n) {
15
+ const r = n.borderBoxSize, h = Array.isArray(r) ? r[0] : r;
16
+ i = h.inlineSize, s = h.blockSize;
17
+ } else
18
+ i = e.offsetWidth, s = e.offsetHeight;
19
+ t({ width: i, height: s });
20
+ });
21
+ return f.observe(e, { box: "border-box" }), () => f.unobserve(e);
22
+ } else
23
+ t(void 0);
24
+ }, [e]), u;
25
+ }
26
+ export {
27
+ d as useSize
28
+ };