@stevederico/skateboard-ui 3.0.2 → 3.6.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 (175) hide show
  1. package/App.jsx +13 -13
  2. package/CHANGELOG.md +64 -0
  3. package/README.md +59 -65
  4. package/components/AuthOverlay.jsx +4 -4
  5. package/components/ProtectedRoute.jsx +1 -1
  6. package/components/ThemeToggle.jsx +1 -1
  7. package/components/UpgradeSheet.jsx +2 -2
  8. package/{core → components/core}/DynamicIcon.jsx +1 -1
  9. package/{layout → components/layout}/Header.jsx +4 -4
  10. package/{layout → components/layout}/Layout.jsx +1 -1
  11. package/{layout → components/layout}/Sidebar.jsx +2 -2
  12. package/{layout → components/layout}/TabBar.jsx +1 -1
  13. package/{views → components/views}/LandingView.jsx +5 -5
  14. package/{views → components/views}/NotFound.jsx +2 -2
  15. package/{views → components/views}/PaymentView.jsx +1 -1
  16. package/{views → components/views}/SettingsView.jsx +6 -6
  17. package/{views → components/views}/SignInView.jsx +6 -6
  18. package/{views → components/views}/SignOutView.jsx +1 -1
  19. package/{views → components/views}/SignUpView.jsx +6 -6
  20. package/{views → components/views}/TextView.jsx +3 -3
  21. package/hooks/useAuthGate.js +1 -1
  22. package/index.js +1 -1
  23. package/package.json +32 -50
  24. package/shadcn/lib/base-ui/LICENSE +21 -0
  25. package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
  26. package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
  27. package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
  28. package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
  29. package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
  30. package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
  31. package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
  32. package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
  33. package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
  34. package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
  35. package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
  36. package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
  37. package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
  38. package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
  39. package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
  40. package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
  41. package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
  42. package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
  43. package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
  44. package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
  45. package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
  46. package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
  47. package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
  48. package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
  49. package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
  50. package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
  51. package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
  52. package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
  53. package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
  54. package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
  55. package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
  56. package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
  57. package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
  58. package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
  59. package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
  60. package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
  61. package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
  62. package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
  63. package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
  64. package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
  65. package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
  66. package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
  67. package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
  68. package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
  69. package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
  70. package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
  71. package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
  72. package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
  73. package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
  74. package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
  75. package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
  76. package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
  77. package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
  78. package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
  79. package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
  80. package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
  81. package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
  82. package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
  83. package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
  84. package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
  85. package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
  86. package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
  87. package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
  88. package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
  89. package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
  90. package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
  91. package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
  92. package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
  93. package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
  94. package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
  95. package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
  96. package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
  97. package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
  98. package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
  99. package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
  100. package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
  101. package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
  102. package/shadcn/lib/base-ui/accordion.js +650 -0
  103. package/shadcn/lib/base-ui/alert-dialog.js +138 -0
  104. package/shadcn/lib/base-ui/avatar.js +235 -0
  105. package/shadcn/lib/base-ui/button.js +52 -0
  106. package/shadcn/lib/base-ui/checkbox.js +454 -0
  107. package/shadcn/lib/base-ui/collapsible.js +283 -0
  108. package/shadcn/lib/base-ui/context-menu.js +324 -0
  109. package/shadcn/lib/base-ui/dialog.js +71 -0
  110. package/shadcn/lib/base-ui/input.js +1028 -0
  111. package/shadcn/lib/base-ui/menu.js +61 -0
  112. package/shadcn/lib/base-ui/menubar.js +157 -0
  113. package/shadcn/lib/base-ui/merge-props.js +15 -0
  114. package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
  115. package/shadcn/lib/base-ui/popover.js +1090 -0
  116. package/shadcn/lib/base-ui/preview-card.js +709 -0
  117. package/shadcn/lib/base-ui/progress.js +278 -0
  118. package/shadcn/lib/base-ui/radio-group.js +247 -0
  119. package/shadcn/lib/base-ui/radio.js +382 -0
  120. package/shadcn/lib/base-ui/scroll-area.js +1061 -0
  121. package/shadcn/lib/base-ui/select.js +2438 -0
  122. package/shadcn/lib/base-ui/separator.js +11 -0
  123. package/shadcn/lib/base-ui/slider.js +1595 -0
  124. package/shadcn/lib/base-ui/switch.js +333 -0
  125. package/shadcn/lib/base-ui/tabs.js +892 -0
  126. package/shadcn/lib/base-ui/toggle-group.js +152 -0
  127. package/shadcn/lib/base-ui/toggle.js +133 -0
  128. package/shadcn/lib/base-ui/tooltip.js +791 -0
  129. package/shadcn/lib/base-ui/use-render.js +15 -0
  130. package/shadcn/lib/tailwind-merge.js +3312 -0
  131. package/shadcn/lib/utils.js +1 -1
  132. package/shadcn/ui/accordion.jsx +1 -1
  133. package/shadcn/ui/alert-dialog.jsx +1 -1
  134. package/shadcn/ui/avatar.jsx +1 -1
  135. package/shadcn/ui/badge.jsx +2 -2
  136. package/shadcn/ui/breadcrumb.jsx +2 -2
  137. package/shadcn/ui/button-group.jsx +2 -2
  138. package/shadcn/ui/button.jsx +1 -1
  139. package/shadcn/ui/calendar.jsx +1 -1
  140. package/shadcn/ui/checkbox.jsx +1 -1
  141. package/shadcn/ui/collapsible.jsx +1 -1
  142. package/shadcn/ui/command.jsx +1 -1
  143. package/shadcn/ui/context-menu.jsx +1 -1
  144. package/shadcn/ui/dialog.jsx +1 -1
  145. package/shadcn/ui/drawer.jsx +176 -74
  146. package/shadcn/ui/dropdown-menu.jsx +1 -1
  147. package/shadcn/ui/hover-card.jsx +1 -1
  148. package/shadcn/ui/input.jsx +1 -1
  149. package/shadcn/ui/item.jsx +2 -2
  150. package/shadcn/ui/menubar.jsx +2 -2
  151. package/shadcn/ui/navigation-menu.jsx +1 -1
  152. package/shadcn/ui/popover.jsx +1 -1
  153. package/shadcn/ui/progress.jsx +1 -1
  154. package/shadcn/ui/radio-group.jsx +2 -2
  155. package/shadcn/ui/scroll-area.jsx +1 -1
  156. package/shadcn/ui/select.jsx +1 -1
  157. package/shadcn/ui/separator.jsx +1 -1
  158. package/shadcn/ui/sheet.jsx +1 -1
  159. package/shadcn/ui/sidebar.jsx +3 -3
  160. package/shadcn/ui/slider.jsx +1 -1
  161. package/shadcn/ui/switch.jsx +1 -1
  162. package/shadcn/ui/tabs.jsx +1 -1
  163. package/shadcn/ui/toggle-group.jsx +2 -2
  164. package/shadcn/ui/toggle.jsx +1 -1
  165. package/shadcn/ui/tooltip.jsx +1 -1
  166. package/styles.css +31 -0
  167. package/MIGRATION.md +0 -230
  168. package/shadcn/ui/carousel.jsx +0 -195
  169. package/shadcn/ui/chart.jsx +0 -312
  170. package/shadcn/ui/resizable.jsx +0 -47
  171. /package/{core → components/core}/Calendar.jsx +0 -0
  172. /package/{core → components/core}/Command.jsx +0 -0
  173. /package/{core → components/core}/Context.jsx +0 -0
  174. /package/{core → components/core}/ThemeProvider.jsx +0 -0
  175. /package/{core → components/core}/Utilities.js +0 -0
@@ -0,0 +1,1061 @@
1
+ /* @base-ui/react 1.4.1 — vendored (MIT — MUI Inc).
2
+ * Refresh: scripts/vendor-base-ui.js (see header for instructions).
3
+ * Do not edit by hand. */
4
+ import {
5
+ normalizeScrollOffset,
6
+ styleDisableScrollbar
7
+ } from "./_chunk-k1e5fvcj.js";
8
+ import {
9
+ clamp
10
+ } from "./_chunk-szcr6mhk.js";
11
+ import {
12
+ useCSPContext
13
+ } from "./_chunk-ymj1dpqg.js";
14
+ import {
15
+ useDirection
16
+ } from "./_chunk-wtw745qd.js";
17
+ import {
18
+ contains,
19
+ getTarget
20
+ } from "./_chunk-atnkefgd.js";
21
+ import {
22
+ isWebKit
23
+ } from "./_chunk-t7j3rbpv.js";
24
+ import {
25
+ useTimeout
26
+ } from "./_chunk-7v1t86x1.js";
27
+ import {
28
+ addEventListener
29
+ } from "./_chunk-mvv30fkv.js";
30
+ import {
31
+ useBaseUiId
32
+ } from "./_chunk-8kh3xk78.js";
33
+ import"./_chunk-8jz3hb7q.js";
34
+ import"./_chunk-sx6vkz01.js";
35
+ import"./_chunk-n7dnqnbw.js";
36
+ import {
37
+ useStableCallback
38
+ } from "./_chunk-mznt6ktj.js";
39
+ import {
40
+ useIsoLayoutEffect
41
+ } from "./_chunk-b40erthe.js";
42
+ import {
43
+ useRenderElement
44
+ } from "./_chunk-1s41sngz.js";
45
+ import {
46
+ __export
47
+ } from "./_chunk-1e6khrvm.js";
48
+
49
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/index.parts.js
50
+ var exports_index_parts = {};
51
+ __export(exports_index_parts, {
52
+ Viewport: () => ScrollAreaViewport,
53
+ Thumb: () => ScrollAreaThumb,
54
+ Scrollbar: () => ScrollAreaScrollbar,
55
+ Root: () => ScrollAreaRoot,
56
+ Corner: () => ScrollAreaCorner,
57
+ Content: () => ScrollAreaContent
58
+ });
59
+
60
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/ScrollAreaRoot.js
61
+ import * as React2 from "react";
62
+
63
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/ScrollAreaRootContext.js
64
+ import * as React from "react";
65
+ "use client";
66
+ var ScrollAreaRootContext = /* @__PURE__ */ React.createContext(undefined);
67
+ if (true)
68
+ ScrollAreaRootContext.displayName = "ScrollAreaRootContext";
69
+ function useScrollAreaRootContext() {
70
+ const context = React.useContext(ScrollAreaRootContext);
71
+ if (context === undefined) {
72
+ throw new Error("Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
73
+ }
74
+ return context;
75
+ }
76
+
77
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/ScrollAreaRootCssVars.js
78
+ var ScrollAreaRootCssVars = /* @__PURE__ */ function(ScrollAreaRootCssVars2) {
79
+ ScrollAreaRootCssVars2["scrollAreaCornerHeight"] = "--scroll-area-corner-height";
80
+ ScrollAreaRootCssVars2["scrollAreaCornerWidth"] = "--scroll-area-corner-width";
81
+ return ScrollAreaRootCssVars2;
82
+ }({});
83
+
84
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/constants.js
85
+ var SCROLL_TIMEOUT = 500;
86
+ var MIN_THUMB_SIZE = 16;
87
+
88
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/utils/getOffset.js
89
+ function getOffset(element, prop, axis) {
90
+ if (!element) {
91
+ return 0;
92
+ }
93
+ const styles = getComputedStyle(element);
94
+ const propAxis = axis === "x" ? "Inline" : "Block";
95
+ if (axis === "x" && prop === "margin") {
96
+ return parseFloat(styles[`${prop}InlineStart`]) * 2;
97
+ }
98
+ return parseFloat(styles[`${prop}${propAxis}Start`]) + parseFloat(styles[`${prop}${propAxis}End`]);
99
+ }
100
+
101
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js
102
+ var ScrollAreaScrollbarDataAttributes = /* @__PURE__ */ function(ScrollAreaScrollbarDataAttributes2) {
103
+ ScrollAreaScrollbarDataAttributes2["orientation"] = "data-orientation";
104
+ ScrollAreaScrollbarDataAttributes2["hovering"] = "data-hovering";
105
+ ScrollAreaScrollbarDataAttributes2["scrolling"] = "data-scrolling";
106
+ ScrollAreaScrollbarDataAttributes2["hasOverflowX"] = "data-has-overflow-x";
107
+ ScrollAreaScrollbarDataAttributes2["hasOverflowY"] = "data-has-overflow-y";
108
+ ScrollAreaScrollbarDataAttributes2["overflowXStart"] = "data-overflow-x-start";
109
+ ScrollAreaScrollbarDataAttributes2["overflowXEnd"] = "data-overflow-x-end";
110
+ ScrollAreaScrollbarDataAttributes2["overflowYStart"] = "data-overflow-y-start";
111
+ ScrollAreaScrollbarDataAttributes2["overflowYEnd"] = "data-overflow-y-end";
112
+ return ScrollAreaScrollbarDataAttributes2;
113
+ }({});
114
+
115
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/ScrollAreaRootDataAttributes.js
116
+ var ScrollAreaRootDataAttributes = /* @__PURE__ */ function(ScrollAreaRootDataAttributes2) {
117
+ ScrollAreaRootDataAttributes2["scrolling"] = "data-scrolling";
118
+ ScrollAreaRootDataAttributes2["hasOverflowX"] = "data-has-overflow-x";
119
+ ScrollAreaRootDataAttributes2["hasOverflowY"] = "data-has-overflow-y";
120
+ ScrollAreaRootDataAttributes2["overflowXStart"] = "data-overflow-x-start";
121
+ ScrollAreaRootDataAttributes2["overflowXEnd"] = "data-overflow-x-end";
122
+ ScrollAreaRootDataAttributes2["overflowYStart"] = "data-overflow-y-start";
123
+ ScrollAreaRootDataAttributes2["overflowYEnd"] = "data-overflow-y-end";
124
+ return ScrollAreaRootDataAttributes2;
125
+ }({});
126
+
127
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/stateAttributes.js
128
+ var scrollAreaStateAttributesMapping = {
129
+ hasOverflowX: (value) => value ? {
130
+ [ScrollAreaRootDataAttributes.hasOverflowX]: ""
131
+ } : null,
132
+ hasOverflowY: (value) => value ? {
133
+ [ScrollAreaRootDataAttributes.hasOverflowY]: ""
134
+ } : null,
135
+ overflowXStart: (value) => value ? {
136
+ [ScrollAreaRootDataAttributes.overflowXStart]: ""
137
+ } : null,
138
+ overflowXEnd: (value) => value ? {
139
+ [ScrollAreaRootDataAttributes.overflowXEnd]: ""
140
+ } : null,
141
+ overflowYStart: (value) => value ? {
142
+ [ScrollAreaRootDataAttributes.overflowYStart]: ""
143
+ } : null,
144
+ overflowYEnd: (value) => value ? {
145
+ [ScrollAreaRootDataAttributes.overflowYEnd]: ""
146
+ } : null,
147
+ cornerHidden: () => null
148
+ };
149
+
150
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/root/ScrollAreaRoot.js
151
+ import { jsxs as _jsxs } from "react/jsx-runtime";
152
+ "use client";
153
+ var DEFAULT_COORDS = {
154
+ x: 0,
155
+ y: 0
156
+ };
157
+ var DEFAULT_SIZE = {
158
+ width: 0,
159
+ height: 0
160
+ };
161
+ var DEFAULT_OVERFLOW_EDGES = {
162
+ xStart: false,
163
+ xEnd: false,
164
+ yStart: false,
165
+ yEnd: false
166
+ };
167
+ var DEFAULT_HIDDEN_STATE = {
168
+ x: true,
169
+ y: true,
170
+ corner: true
171
+ };
172
+ var ScrollAreaRoot = /* @__PURE__ */ React2.forwardRef(function ScrollAreaRoot2(componentProps, forwardedRef) {
173
+ const {
174
+ render,
175
+ className,
176
+ overflowEdgeThreshold: overflowEdgeThresholdProp,
177
+ style,
178
+ ...elementProps
179
+ } = componentProps;
180
+ const overflowEdgeThreshold = normalizeOverflowEdgeThreshold(overflowEdgeThresholdProp);
181
+ const rootId = useBaseUiId();
182
+ const scrollYTimeout = useTimeout();
183
+ const scrollXTimeout = useTimeout();
184
+ const {
185
+ nonce,
186
+ disableStyleElements
187
+ } = useCSPContext();
188
+ const [hovering, setHovering] = React2.useState(false);
189
+ const [scrollingX, setScrollingX] = React2.useState(false);
190
+ const [scrollingY, setScrollingY] = React2.useState(false);
191
+ const [touchModality, setTouchModality] = React2.useState(false);
192
+ const [hasMeasuredScrollbar, setHasMeasuredScrollbar] = React2.useState(false);
193
+ const [cornerSize, setCornerSize] = React2.useState(DEFAULT_SIZE);
194
+ const [thumbSize, setThumbSize] = React2.useState(DEFAULT_SIZE);
195
+ const [overflowEdges, setOverflowEdges] = React2.useState(DEFAULT_OVERFLOW_EDGES);
196
+ const [hiddenState, setHiddenState] = React2.useState(DEFAULT_HIDDEN_STATE);
197
+ const rootRef = React2.useRef(null);
198
+ const viewportRef = React2.useRef(null);
199
+ const scrollbarYRef = React2.useRef(null);
200
+ const scrollbarXRef = React2.useRef(null);
201
+ const thumbYRef = React2.useRef(null);
202
+ const thumbXRef = React2.useRef(null);
203
+ const cornerRef = React2.useRef(null);
204
+ const thumbDraggingRef = React2.useRef(false);
205
+ const startYRef = React2.useRef(0);
206
+ const startXRef = React2.useRef(0);
207
+ const startScrollTopRef = React2.useRef(0);
208
+ const startScrollLeftRef = React2.useRef(0);
209
+ const currentOrientationRef = React2.useRef("vertical");
210
+ const scrollPositionRef = React2.useRef(DEFAULT_COORDS);
211
+ const handleScroll = useStableCallback((scrollPosition) => {
212
+ const offsetX = scrollPosition.x - scrollPositionRef.current.x;
213
+ const offsetY = scrollPosition.y - scrollPositionRef.current.y;
214
+ scrollPositionRef.current = scrollPosition;
215
+ if (offsetY !== 0) {
216
+ setScrollingY(true);
217
+ scrollYTimeout.start(SCROLL_TIMEOUT, () => {
218
+ setScrollingY(false);
219
+ });
220
+ }
221
+ if (offsetX !== 0) {
222
+ setScrollingX(true);
223
+ scrollXTimeout.start(SCROLL_TIMEOUT, () => {
224
+ setScrollingX(false);
225
+ });
226
+ }
227
+ });
228
+ const handlePointerDown = useStableCallback((event) => {
229
+ if (event.button !== 0) {
230
+ return;
231
+ }
232
+ thumbDraggingRef.current = true;
233
+ startYRef.current = event.clientY;
234
+ startXRef.current = event.clientX;
235
+ currentOrientationRef.current = event.currentTarget.getAttribute(ScrollAreaScrollbarDataAttributes.orientation);
236
+ if (viewportRef.current) {
237
+ startScrollTopRef.current = viewportRef.current.scrollTop;
238
+ startScrollLeftRef.current = viewportRef.current.scrollLeft;
239
+ }
240
+ if (thumbYRef.current && currentOrientationRef.current === "vertical") {
241
+ thumbYRef.current.setPointerCapture(event.pointerId);
242
+ }
243
+ if (thumbXRef.current && currentOrientationRef.current === "horizontal") {
244
+ thumbXRef.current.setPointerCapture(event.pointerId);
245
+ }
246
+ });
247
+ const handlePointerMove = useStableCallback((event) => {
248
+ if (!thumbDraggingRef.current) {
249
+ return;
250
+ }
251
+ const deltaY = event.clientY - startYRef.current;
252
+ const deltaX = event.clientX - startXRef.current;
253
+ if (viewportRef.current) {
254
+ const scrollableContentHeight = viewportRef.current.scrollHeight;
255
+ const viewportHeight = viewportRef.current.clientHeight;
256
+ const scrollableContentWidth = viewportRef.current.scrollWidth;
257
+ const viewportWidth = viewportRef.current.clientWidth;
258
+ if (thumbYRef.current && scrollbarYRef.current && currentOrientationRef.current === "vertical") {
259
+ const scrollbarYOffset = getOffset(scrollbarYRef.current, "padding", "y");
260
+ const thumbYOffset = getOffset(thumbYRef.current, "margin", "y");
261
+ const thumbHeight = thumbYRef.current.offsetHeight;
262
+ const maxThumbOffsetY = scrollbarYRef.current.offsetHeight - thumbHeight - scrollbarYOffset - thumbYOffset;
263
+ const scrollRatioY = deltaY / maxThumbOffsetY;
264
+ viewportRef.current.scrollTop = startScrollTopRef.current + scrollRatioY * (scrollableContentHeight - viewportHeight);
265
+ event.preventDefault();
266
+ setScrollingY(true);
267
+ scrollYTimeout.start(SCROLL_TIMEOUT, () => {
268
+ setScrollingY(false);
269
+ });
270
+ }
271
+ if (thumbXRef.current && scrollbarXRef.current && currentOrientationRef.current === "horizontal") {
272
+ const scrollbarXOffset = getOffset(scrollbarXRef.current, "padding", "x");
273
+ const thumbXOffset = getOffset(thumbXRef.current, "margin", "x");
274
+ const thumbWidth = thumbXRef.current.offsetWidth;
275
+ const maxThumbOffsetX = scrollbarXRef.current.offsetWidth - thumbWidth - scrollbarXOffset - thumbXOffset;
276
+ const scrollRatioX = deltaX / maxThumbOffsetX;
277
+ viewportRef.current.scrollLeft = startScrollLeftRef.current + scrollRatioX * (scrollableContentWidth - viewportWidth);
278
+ event.preventDefault();
279
+ setScrollingX(true);
280
+ scrollXTimeout.start(SCROLL_TIMEOUT, () => {
281
+ setScrollingX(false);
282
+ });
283
+ }
284
+ }
285
+ });
286
+ const handlePointerUp = useStableCallback((event) => {
287
+ thumbDraggingRef.current = false;
288
+ if (thumbYRef.current && currentOrientationRef.current === "vertical") {
289
+ thumbYRef.current.releasePointerCapture(event.pointerId);
290
+ }
291
+ if (thumbXRef.current && currentOrientationRef.current === "horizontal") {
292
+ thumbXRef.current.releasePointerCapture(event.pointerId);
293
+ }
294
+ });
295
+ function handleTouchModalityChange(event) {
296
+ setTouchModality(event.pointerType === "touch");
297
+ }
298
+ function handlePointerEnterOrMove(event) {
299
+ handleTouchModalityChange(event);
300
+ if (event.pointerType !== "touch") {
301
+ const isTargetRootChild = contains(rootRef.current, event.target);
302
+ setHovering(isTargetRootChild);
303
+ }
304
+ }
305
+ const state = React2.useMemo(() => ({
306
+ scrolling: scrollingX || scrollingY,
307
+ hasOverflowX: !hiddenState.x,
308
+ hasOverflowY: !hiddenState.y,
309
+ overflowXStart: overflowEdges.xStart,
310
+ overflowXEnd: overflowEdges.xEnd,
311
+ overflowYStart: overflowEdges.yStart,
312
+ overflowYEnd: overflowEdges.yEnd,
313
+ cornerHidden: hiddenState.corner
314
+ }), [scrollingX, scrollingY, hiddenState.x, hiddenState.y, hiddenState.corner, overflowEdges]);
315
+ const props = {
316
+ role: "presentation",
317
+ onPointerEnter: handlePointerEnterOrMove,
318
+ onPointerMove: handlePointerEnterOrMove,
319
+ onPointerDown: handleTouchModalityChange,
320
+ onPointerLeave() {
321
+ setHovering(false);
322
+ },
323
+ style: {
324
+ position: "relative",
325
+ [ScrollAreaRootCssVars.scrollAreaCornerHeight]: `${cornerSize.height}px`,
326
+ [ScrollAreaRootCssVars.scrollAreaCornerWidth]: `${cornerSize.width}px`
327
+ }
328
+ };
329
+ const element = useRenderElement("div", componentProps, {
330
+ state,
331
+ ref: [forwardedRef, rootRef],
332
+ props: [props, elementProps],
333
+ stateAttributesMapping: scrollAreaStateAttributesMapping
334
+ });
335
+ const contextValue = React2.useMemo(() => ({
336
+ handlePointerDown,
337
+ handlePointerMove,
338
+ handlePointerUp,
339
+ handleScroll,
340
+ cornerSize,
341
+ setCornerSize,
342
+ thumbSize,
343
+ setThumbSize,
344
+ hasMeasuredScrollbar,
345
+ setHasMeasuredScrollbar,
346
+ touchModality,
347
+ cornerRef,
348
+ scrollingX,
349
+ setScrollingX,
350
+ scrollingY,
351
+ setScrollingY,
352
+ hovering,
353
+ setHovering,
354
+ viewportRef,
355
+ rootRef,
356
+ scrollbarYRef,
357
+ scrollbarXRef,
358
+ thumbYRef,
359
+ thumbXRef,
360
+ rootId,
361
+ hiddenState,
362
+ setHiddenState,
363
+ overflowEdges,
364
+ setOverflowEdges,
365
+ viewportState: state,
366
+ overflowEdgeThreshold
367
+ }), [handlePointerDown, handlePointerMove, handlePointerUp, handleScroll, cornerSize, thumbSize, hasMeasuredScrollbar, touchModality, scrollingX, setScrollingX, scrollingY, setScrollingY, hovering, setHovering, rootId, hiddenState, overflowEdges, state, overflowEdgeThreshold]);
368
+ return /* @__PURE__ */ _jsxs(ScrollAreaRootContext.Provider, {
369
+ value: contextValue,
370
+ children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), element]
371
+ });
372
+ });
373
+ if (true)
374
+ ScrollAreaRoot.displayName = "ScrollAreaRoot";
375
+ function normalizeOverflowEdgeThreshold(threshold) {
376
+ if (typeof threshold === "number") {
377
+ const value = Math.max(0, threshold);
378
+ return {
379
+ xStart: value,
380
+ xEnd: value,
381
+ yStart: value,
382
+ yEnd: value
383
+ };
384
+ }
385
+ return {
386
+ xStart: Math.max(0, threshold?.xStart || 0),
387
+ xEnd: Math.max(0, threshold?.xEnd || 0),
388
+ yStart: Math.max(0, threshold?.yStart || 0),
389
+ yEnd: Math.max(0, threshold?.yEnd || 0)
390
+ };
391
+ }
392
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewport.js
393
+ import * as React4 from "react";
394
+
395
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewportContext.js
396
+ import * as React3 from "react";
397
+ "use client";
398
+ var ScrollAreaViewportContext = /* @__PURE__ */ React3.createContext(undefined);
399
+ if (true)
400
+ ScrollAreaViewportContext.displayName = "ScrollAreaViewportContext";
401
+ function useScrollAreaViewportContext() {
402
+ const context = React3.useContext(ScrollAreaViewportContext);
403
+ if (context === undefined) {
404
+ throw new Error("Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.");
405
+ }
406
+ return context;
407
+ }
408
+
409
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewportCssVars.js
410
+ var ScrollAreaViewportCssVars = /* @__PURE__ */ function(ScrollAreaViewportCssVars2) {
411
+ ScrollAreaViewportCssVars2["scrollAreaOverflowXStart"] = "--scroll-area-overflow-x-start";
412
+ ScrollAreaViewportCssVars2["scrollAreaOverflowXEnd"] = "--scroll-area-overflow-x-end";
413
+ ScrollAreaViewportCssVars2["scrollAreaOverflowYStart"] = "--scroll-area-overflow-y-start";
414
+ ScrollAreaViewportCssVars2["scrollAreaOverflowYEnd"] = "--scroll-area-overflow-y-end";
415
+ return ScrollAreaViewportCssVars2;
416
+ }({});
417
+
418
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewport.js
419
+ import { jsx as _jsx } from "react/jsx-runtime";
420
+ "use client";
421
+ var scrollAreaOverflowVarsRegistered = false;
422
+ function removeCSSVariableInheritance() {
423
+ if (scrollAreaOverflowVarsRegistered || isWebKit) {
424
+ return;
425
+ }
426
+ if (typeof CSS !== "undefined" && "registerProperty" in CSS) {
427
+ [ScrollAreaViewportCssVars.scrollAreaOverflowXStart, ScrollAreaViewportCssVars.scrollAreaOverflowXEnd, ScrollAreaViewportCssVars.scrollAreaOverflowYStart, ScrollAreaViewportCssVars.scrollAreaOverflowYEnd].forEach((name) => {
428
+ try {
429
+ CSS.registerProperty({
430
+ name,
431
+ syntax: "<length>",
432
+ inherits: false,
433
+ initialValue: "0px"
434
+ });
435
+ } catch {}
436
+ });
437
+ }
438
+ scrollAreaOverflowVarsRegistered = true;
439
+ }
440
+ var ScrollAreaViewport = /* @__PURE__ */ React4.forwardRef(function ScrollAreaViewport2(componentProps, forwardedRef) {
441
+ const {
442
+ render,
443
+ className,
444
+ style,
445
+ ...elementProps
446
+ } = componentProps;
447
+ const {
448
+ viewportRef,
449
+ scrollbarYRef,
450
+ scrollbarXRef,
451
+ thumbYRef,
452
+ thumbXRef,
453
+ cornerRef,
454
+ cornerSize,
455
+ setCornerSize,
456
+ setThumbSize,
457
+ rootId,
458
+ setHiddenState,
459
+ hiddenState,
460
+ setHasMeasuredScrollbar,
461
+ handleScroll,
462
+ setHovering,
463
+ setOverflowEdges,
464
+ overflowEdges,
465
+ overflowEdgeThreshold,
466
+ scrollingX,
467
+ scrollingY
468
+ } = useScrollAreaRootContext();
469
+ const direction = useDirection();
470
+ const programmaticScrollRef = React4.useRef(true);
471
+ const lastMeasuredViewportMetricsRef = React4.useRef([NaN, NaN, NaN, NaN]);
472
+ const scrollEndTimeout = useTimeout();
473
+ const waitForAnimationsTimeout = useTimeout();
474
+ const computeThumbPosition = useStableCallback(() => {
475
+ const viewportEl = viewportRef.current;
476
+ const scrollbarYEl = scrollbarYRef.current;
477
+ const scrollbarXEl = scrollbarXRef.current;
478
+ const thumbYEl = thumbYRef.current;
479
+ const thumbXEl = thumbXRef.current;
480
+ const cornerEl = cornerRef.current;
481
+ if (!viewportEl) {
482
+ return;
483
+ }
484
+ const scrollableContentHeight = viewportEl.scrollHeight;
485
+ const scrollableContentWidth = viewportEl.scrollWidth;
486
+ const viewportHeight = viewportEl.clientHeight;
487
+ const viewportWidth = viewportEl.clientWidth;
488
+ const scrollTop = viewportEl.scrollTop;
489
+ const scrollLeft = viewportEl.scrollLeft;
490
+ const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;
491
+ const isFirstMeasurement = Number.isNaN(lastMeasuredViewportMetrics[0]);
492
+ lastMeasuredViewportMetrics[0] = viewportHeight;
493
+ lastMeasuredViewportMetrics[1] = scrollableContentHeight;
494
+ lastMeasuredViewportMetrics[2] = viewportWidth;
495
+ lastMeasuredViewportMetrics[3] = scrollableContentWidth;
496
+ if (isFirstMeasurement) {
497
+ setHasMeasuredScrollbar(true);
498
+ }
499
+ if (scrollableContentHeight === 0 || scrollableContentWidth === 0) {
500
+ return;
501
+ }
502
+ const nextHiddenState = getHiddenState(viewportEl);
503
+ const scrollbarYHidden = nextHiddenState.y;
504
+ const scrollbarXHidden = nextHiddenState.x;
505
+ const ratioX = viewportWidth / scrollableContentWidth;
506
+ const ratioY = viewportHeight / scrollableContentHeight;
507
+ const maxScrollLeft = Math.max(0, scrollableContentWidth - viewportWidth);
508
+ const maxScrollTop = Math.max(0, scrollableContentHeight - viewportHeight);
509
+ let scrollLeftFromStart = 0;
510
+ let scrollLeftFromEnd = 0;
511
+ if (!scrollbarXHidden) {
512
+ let rawScrollLeftFromStart = 0;
513
+ if (direction === "rtl") {
514
+ rawScrollLeftFromStart = clamp(-scrollLeft, 0, maxScrollLeft);
515
+ } else {
516
+ rawScrollLeftFromStart = clamp(scrollLeft, 0, maxScrollLeft);
517
+ }
518
+ scrollLeftFromStart = normalizeScrollOffset(rawScrollLeftFromStart, maxScrollLeft);
519
+ scrollLeftFromEnd = maxScrollLeft - scrollLeftFromStart;
520
+ }
521
+ const rawScrollTopFromStart = !scrollbarYHidden ? clamp(scrollTop, 0, maxScrollTop) : 0;
522
+ const scrollTopFromStart = !scrollbarYHidden ? normalizeScrollOffset(rawScrollTopFromStart, maxScrollTop) : 0;
523
+ const scrollTopFromEnd = !scrollbarYHidden ? maxScrollTop - scrollTopFromStart : 0;
524
+ const nextWidth = scrollbarXHidden ? 0 : viewportWidth;
525
+ const nextHeight = scrollbarYHidden ? 0 : viewportHeight;
526
+ let nextCornerWidth = 0;
527
+ let nextCornerHeight = 0;
528
+ if (!scrollbarXHidden && !scrollbarYHidden) {
529
+ nextCornerWidth = scrollbarYEl?.offsetWidth || 0;
530
+ nextCornerHeight = scrollbarXEl?.offsetHeight || 0;
531
+ }
532
+ const cornerNotYetSized = cornerSize.width === 0 && cornerSize.height === 0;
533
+ const cornerWidthOffset = cornerNotYetSized ? nextCornerWidth : 0;
534
+ const cornerHeightOffset = cornerNotYetSized ? nextCornerHeight : 0;
535
+ const scrollbarXOffset = getOffset(scrollbarXEl, "padding", "x");
536
+ const scrollbarYOffset = getOffset(scrollbarYEl, "padding", "y");
537
+ const thumbXOffset = getOffset(thumbXEl, "margin", "x");
538
+ const thumbYOffset = getOffset(thumbYEl, "margin", "y");
539
+ const idealNextWidth = nextWidth - scrollbarXOffset - thumbXOffset;
540
+ const idealNextHeight = nextHeight - scrollbarYOffset - thumbYOffset;
541
+ const maxNextWidth = scrollbarXEl ? Math.min(scrollbarXEl.offsetWidth - cornerWidthOffset, idealNextWidth) : idealNextWidth;
542
+ const maxNextHeight = scrollbarYEl ? Math.min(scrollbarYEl.offsetHeight - cornerHeightOffset, idealNextHeight) : idealNextHeight;
543
+ const clampedNextWidth = Math.max(MIN_THUMB_SIZE, maxNextWidth * ratioX);
544
+ const clampedNextHeight = Math.max(MIN_THUMB_SIZE, maxNextHeight * ratioY);
545
+ setThumbSize((prevSize) => {
546
+ if (prevSize.height === clampedNextHeight && prevSize.width === clampedNextWidth) {
547
+ return prevSize;
548
+ }
549
+ return {
550
+ width: clampedNextWidth,
551
+ height: clampedNextHeight
552
+ };
553
+ });
554
+ if (scrollbarYEl && thumbYEl) {
555
+ const maxThumbOffsetY = scrollbarYEl.offsetHeight - clampedNextHeight - scrollbarYOffset - thumbYOffset;
556
+ const scrollRangeY = scrollableContentHeight - viewportHeight;
557
+ const scrollRatioY = scrollRangeY === 0 ? 0 : scrollTop / scrollRangeY;
558
+ const thumbOffsetY = Math.min(maxThumbOffsetY, Math.max(0, scrollRatioY * maxThumbOffsetY));
559
+ thumbYEl.style.transform = `translate3d(0,${thumbOffsetY}px,0)`;
560
+ }
561
+ if (scrollbarXEl && thumbXEl) {
562
+ const maxThumbOffsetX = scrollbarXEl.offsetWidth - clampedNextWidth - scrollbarXOffset - thumbXOffset;
563
+ const scrollRangeX = scrollableContentWidth - viewportWidth;
564
+ const scrollRatioX = scrollRangeX === 0 ? 0 : scrollLeft / scrollRangeX;
565
+ const thumbOffsetX = direction === "rtl" ? clamp(scrollRatioX * maxThumbOffsetX, -maxThumbOffsetX, 0) : clamp(scrollRatioX * maxThumbOffsetX, 0, maxThumbOffsetX);
566
+ thumbXEl.style.transform = `translate3d(${thumbOffsetX}px,0,0)`;
567
+ }
568
+ const overflowMetricsPx = [[ScrollAreaViewportCssVars.scrollAreaOverflowXStart, scrollLeftFromStart], [ScrollAreaViewportCssVars.scrollAreaOverflowXEnd, scrollLeftFromEnd], [ScrollAreaViewportCssVars.scrollAreaOverflowYStart, scrollTopFromStart], [ScrollAreaViewportCssVars.scrollAreaOverflowYEnd, scrollTopFromEnd]];
569
+ for (const [cssVar, value] of overflowMetricsPx) {
570
+ viewportEl.style.setProperty(cssVar, `${value}px`);
571
+ }
572
+ if (cornerEl) {
573
+ if (scrollbarXHidden || scrollbarYHidden) {
574
+ setCornerSize({
575
+ width: 0,
576
+ height: 0
577
+ });
578
+ } else if (!scrollbarXHidden && !scrollbarYHidden) {
579
+ setCornerSize({
580
+ width: nextCornerWidth,
581
+ height: nextCornerHeight
582
+ });
583
+ }
584
+ }
585
+ setHiddenState((prevState) => mergeHiddenState(prevState, nextHiddenState));
586
+ const nextOverflowEdges = {
587
+ xStart: !scrollbarXHidden && scrollLeftFromStart > overflowEdgeThreshold.xStart,
588
+ xEnd: !scrollbarXHidden && scrollLeftFromEnd > overflowEdgeThreshold.xEnd,
589
+ yStart: !scrollbarYHidden && scrollTopFromStart > overflowEdgeThreshold.yStart,
590
+ yEnd: !scrollbarYHidden && scrollTopFromEnd > overflowEdgeThreshold.yEnd
591
+ };
592
+ setOverflowEdges((prev) => {
593
+ if (prev.xStart === nextOverflowEdges.xStart && prev.xEnd === nextOverflowEdges.xEnd && prev.yStart === nextOverflowEdges.yStart && prev.yEnd === nextOverflowEdges.yEnd) {
594
+ return prev;
595
+ }
596
+ return nextOverflowEdges;
597
+ });
598
+ });
599
+ useIsoLayoutEffect(() => {
600
+ if (!viewportRef.current) {
601
+ return;
602
+ }
603
+ removeCSSVariableInheritance();
604
+ }, [viewportRef]);
605
+ useIsoLayoutEffect(() => {
606
+ queueMicrotask(computeThumbPosition);
607
+ }, [computeThumbPosition, hiddenState, direction]);
608
+ useIsoLayoutEffect(() => {
609
+ if (viewportRef.current?.matches(":hover")) {
610
+ setHovering(true);
611
+ }
612
+ }, [viewportRef, setHovering]);
613
+ React4.useEffect(() => {
614
+ const viewport = viewportRef.current;
615
+ if (typeof ResizeObserver === "undefined" || !viewport) {
616
+ return;
617
+ }
618
+ let hasInitialized = false;
619
+ const ro = new ResizeObserver(() => {
620
+ if (!hasInitialized) {
621
+ hasInitialized = true;
622
+ const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;
623
+ if (lastMeasuredViewportMetrics[0] === viewport.clientHeight && lastMeasuredViewportMetrics[1] === viewport.scrollHeight && lastMeasuredViewportMetrics[2] === viewport.clientWidth && lastMeasuredViewportMetrics[3] === viewport.scrollWidth) {
624
+ return;
625
+ }
626
+ }
627
+ computeThumbPosition();
628
+ });
629
+ ro.observe(viewport);
630
+ waitForAnimationsTimeout.start(0, () => {
631
+ const animations = viewport.getAnimations({
632
+ subtree: true
633
+ });
634
+ if (animations.length === 0) {
635
+ return;
636
+ }
637
+ Promise.allSettled(animations.map((animation) => animation.finished)).then(computeThumbPosition).catch(() => {});
638
+ });
639
+ return () => {
640
+ ro.disconnect();
641
+ waitForAnimationsTimeout.clear();
642
+ };
643
+ }, [computeThumbPosition, viewportRef, waitForAnimationsTimeout]);
644
+ function handleUserInteraction() {
645
+ programmaticScrollRef.current = false;
646
+ }
647
+ const props = {
648
+ role: "presentation",
649
+ ...rootId && {
650
+ "data-id": `${rootId}-viewport`
651
+ },
652
+ tabIndex: hiddenState.x && hiddenState.y ? -1 : 0,
653
+ className: styleDisableScrollbar.className,
654
+ style: {
655
+ overflow: "scroll"
656
+ },
657
+ onScroll() {
658
+ if (!viewportRef.current) {
659
+ return;
660
+ }
661
+ computeThumbPosition();
662
+ if (!programmaticScrollRef.current) {
663
+ handleScroll({
664
+ x: viewportRef.current.scrollLeft,
665
+ y: viewportRef.current.scrollTop
666
+ });
667
+ }
668
+ scrollEndTimeout.start(100, () => {
669
+ programmaticScrollRef.current = true;
670
+ });
671
+ },
672
+ onWheel: handleUserInteraction,
673
+ onTouchMove: handleUserInteraction,
674
+ onPointerMove: handleUserInteraction,
675
+ onPointerEnter: handleUserInteraction,
676
+ onKeyDown: handleUserInteraction
677
+ };
678
+ const viewportState = React4.useMemo(() => ({
679
+ scrolling: scrollingX || scrollingY,
680
+ hasOverflowX: !hiddenState.x,
681
+ hasOverflowY: !hiddenState.y,
682
+ overflowXStart: overflowEdges.xStart,
683
+ overflowXEnd: overflowEdges.xEnd,
684
+ overflowYStart: overflowEdges.yStart,
685
+ overflowYEnd: overflowEdges.yEnd,
686
+ cornerHidden: hiddenState.corner
687
+ }), [scrollingX, scrollingY, hiddenState.x, hiddenState.y, hiddenState.corner, overflowEdges]);
688
+ const element = useRenderElement("div", componentProps, {
689
+ ref: [forwardedRef, viewportRef],
690
+ state: viewportState,
691
+ props: [props, elementProps],
692
+ stateAttributesMapping: scrollAreaStateAttributesMapping
693
+ });
694
+ const contextValue = React4.useMemo(() => ({
695
+ computeThumbPosition
696
+ }), [computeThumbPosition]);
697
+ return /* @__PURE__ */ _jsx(ScrollAreaViewportContext.Provider, {
698
+ value: contextValue,
699
+ children: element
700
+ });
701
+ });
702
+ if (true)
703
+ ScrollAreaViewport.displayName = "ScrollAreaViewport";
704
+ function getHiddenState(viewport) {
705
+ const y = viewport.clientHeight >= viewport.scrollHeight;
706
+ const x = viewport.clientWidth >= viewport.scrollWidth;
707
+ return {
708
+ y,
709
+ x,
710
+ corner: y || x
711
+ };
712
+ }
713
+ function mergeHiddenState(prevState, nextState) {
714
+ if (prevState.y === nextState.y && prevState.x === nextState.x && prevState.corner === nextState.corner) {
715
+ return prevState;
716
+ }
717
+ return nextState;
718
+ }
719
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js
720
+ import * as React6 from "react";
721
+
722
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbarContext.js
723
+ import * as React5 from "react";
724
+ "use client";
725
+ var ScrollAreaScrollbarContext = /* @__PURE__ */ React5.createContext(undefined);
726
+ if (true)
727
+ ScrollAreaScrollbarContext.displayName = "ScrollAreaScrollbarContext";
728
+ function useScrollAreaScrollbarContext() {
729
+ const context = React5.useContext(ScrollAreaScrollbarContext);
730
+ if (context === undefined) {
731
+ throw new Error("Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
732
+ }
733
+ return context;
734
+ }
735
+
736
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.js
737
+ var ScrollAreaScrollbarCssVars = /* @__PURE__ */ function(ScrollAreaScrollbarCssVars2) {
738
+ ScrollAreaScrollbarCssVars2["scrollAreaThumbHeight"] = "--scroll-area-thumb-height";
739
+ ScrollAreaScrollbarCssVars2["scrollAreaThumbWidth"] = "--scroll-area-thumb-width";
740
+ return ScrollAreaScrollbarCssVars2;
741
+ }({});
742
+
743
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js
744
+ import { jsx as _jsx2 } from "react/jsx-runtime";
745
+ "use client";
746
+ var ScrollAreaScrollbar = /* @__PURE__ */ React6.forwardRef(function ScrollAreaScrollbar2(componentProps, forwardedRef) {
747
+ const {
748
+ render,
749
+ className,
750
+ orientation = "vertical",
751
+ keepMounted = false,
752
+ style,
753
+ ...elementProps
754
+ } = componentProps;
755
+ const {
756
+ hovering,
757
+ scrollingX,
758
+ scrollingY,
759
+ hiddenState,
760
+ overflowEdges,
761
+ scrollbarYRef,
762
+ scrollbarXRef,
763
+ viewportRef,
764
+ thumbYRef,
765
+ thumbXRef,
766
+ handlePointerDown,
767
+ handlePointerUp,
768
+ rootId,
769
+ thumbSize,
770
+ hasMeasuredScrollbar
771
+ } = useScrollAreaRootContext();
772
+ const state = {
773
+ hovering,
774
+ scrolling: {
775
+ horizontal: scrollingX,
776
+ vertical: scrollingY
777
+ }[orientation],
778
+ orientation,
779
+ hasOverflowX: !hiddenState.x,
780
+ hasOverflowY: !hiddenState.y,
781
+ overflowXStart: overflowEdges.xStart,
782
+ overflowXEnd: overflowEdges.xEnd,
783
+ overflowYStart: overflowEdges.yStart,
784
+ overflowYEnd: overflowEdges.yEnd,
785
+ cornerHidden: hiddenState.corner
786
+ };
787
+ const direction = useDirection();
788
+ const hideTrackUntilMeasured = !hasMeasuredScrollbar && !keepMounted;
789
+ React6.useEffect(() => {
790
+ const viewportEl = viewportRef.current;
791
+ const scrollbarEl = orientation === "vertical" ? scrollbarYRef.current : scrollbarXRef.current;
792
+ if (!scrollbarEl) {
793
+ return;
794
+ }
795
+ function handleWheel(event) {
796
+ if (!viewportEl || !scrollbarEl || event.ctrlKey) {
797
+ return;
798
+ }
799
+ event.preventDefault();
800
+ if (orientation === "vertical") {
801
+ if (viewportEl.scrollTop === 0 && event.deltaY < 0) {
802
+ return;
803
+ }
804
+ } else if (viewportEl.scrollLeft === 0 && event.deltaX < 0) {
805
+ return;
806
+ }
807
+ if (orientation === "vertical") {
808
+ if (viewportEl.scrollTop === viewportEl.scrollHeight - viewportEl.clientHeight && event.deltaY > 0) {
809
+ return;
810
+ }
811
+ } else if (viewportEl.scrollLeft === viewportEl.scrollWidth - viewportEl.clientWidth && event.deltaX > 0) {
812
+ return;
813
+ }
814
+ if (orientation === "vertical") {
815
+ viewportEl.scrollTop += event.deltaY;
816
+ } else {
817
+ viewportEl.scrollLeft += event.deltaX;
818
+ }
819
+ }
820
+ return addEventListener(scrollbarEl, "wheel", handleWheel, {
821
+ passive: false
822
+ });
823
+ }, [orientation, scrollbarXRef, scrollbarYRef, viewportRef]);
824
+ const props = {
825
+ ...rootId && {
826
+ "data-id": `${rootId}-scrollbar`
827
+ },
828
+ onPointerDown(event) {
829
+ if (event.button !== 0) {
830
+ return;
831
+ }
832
+ const target = getTarget(event.nativeEvent);
833
+ const thumb = orientation === "vertical" ? thumbYRef.current : thumbXRef.current;
834
+ if (thumb && contains(thumb, target)) {
835
+ return;
836
+ }
837
+ if (!viewportRef.current) {
838
+ return;
839
+ }
840
+ if (thumbYRef.current && scrollbarYRef.current && orientation === "vertical") {
841
+ const thumbYOffset = getOffset(thumbYRef.current, "margin", "y");
842
+ const scrollbarYOffset = getOffset(scrollbarYRef.current, "padding", "y");
843
+ const thumbHeight = thumbYRef.current.offsetHeight;
844
+ const trackRectY = scrollbarYRef.current.getBoundingClientRect();
845
+ const clickY = event.clientY - trackRectY.top - thumbHeight / 2 - scrollbarYOffset + thumbYOffset / 2;
846
+ const scrollableContentHeight = viewportRef.current.scrollHeight;
847
+ const viewportHeight = viewportRef.current.clientHeight;
848
+ const maxThumbOffsetY = scrollbarYRef.current.offsetHeight - thumbHeight - scrollbarYOffset - thumbYOffset;
849
+ const scrollRatioY = clickY / maxThumbOffsetY;
850
+ const newScrollTop = scrollRatioY * (scrollableContentHeight - viewportHeight);
851
+ viewportRef.current.scrollTop = newScrollTop;
852
+ }
853
+ if (thumbXRef.current && scrollbarXRef.current && orientation === "horizontal") {
854
+ const thumbXOffset = getOffset(thumbXRef.current, "margin", "x");
855
+ const scrollbarXOffset = getOffset(scrollbarXRef.current, "padding", "x");
856
+ const thumbWidth = thumbXRef.current.offsetWidth;
857
+ const trackRectX = scrollbarXRef.current.getBoundingClientRect();
858
+ const clickX = event.clientX - trackRectX.left - thumbWidth / 2 - scrollbarXOffset + thumbXOffset / 2;
859
+ const scrollableContentWidth = viewportRef.current.scrollWidth;
860
+ const viewportWidth = viewportRef.current.clientWidth;
861
+ const maxThumbOffsetX = scrollbarXRef.current.offsetWidth - thumbWidth - scrollbarXOffset - thumbXOffset;
862
+ const scrollRatioX = clickX / maxThumbOffsetX;
863
+ let newScrollLeft;
864
+ if (direction === "rtl") {
865
+ newScrollLeft = (1 - scrollRatioX) * (scrollableContentWidth - viewportWidth);
866
+ if (viewportRef.current.scrollLeft <= 0) {
867
+ newScrollLeft = -newScrollLeft;
868
+ }
869
+ } else {
870
+ newScrollLeft = scrollRatioX * (scrollableContentWidth - viewportWidth);
871
+ }
872
+ viewportRef.current.scrollLeft = newScrollLeft;
873
+ }
874
+ handlePointerDown(event);
875
+ },
876
+ onPointerUp: handlePointerUp,
877
+ style: {
878
+ position: "absolute",
879
+ touchAction: "none",
880
+ WebkitUserSelect: "none",
881
+ userSelect: "none",
882
+ visibility: hideTrackUntilMeasured ? "hidden" : undefined,
883
+ ...orientation === "vertical" && {
884
+ top: 0,
885
+ bottom: `var(${ScrollAreaRootCssVars.scrollAreaCornerHeight})`,
886
+ insetInlineEnd: 0,
887
+ [ScrollAreaScrollbarCssVars.scrollAreaThumbHeight]: `${thumbSize.height}px`
888
+ },
889
+ ...orientation === "horizontal" && {
890
+ insetInlineStart: 0,
891
+ insetInlineEnd: `var(${ScrollAreaRootCssVars.scrollAreaCornerWidth})`,
892
+ bottom: 0,
893
+ [ScrollAreaScrollbarCssVars.scrollAreaThumbWidth]: `${thumbSize.width}px`
894
+ }
895
+ }
896
+ };
897
+ const element = useRenderElement("div", componentProps, {
898
+ ref: [forwardedRef, orientation === "vertical" ? scrollbarYRef : scrollbarXRef],
899
+ state,
900
+ props: [props, elementProps],
901
+ stateAttributesMapping: scrollAreaStateAttributesMapping
902
+ });
903
+ const contextValue = React6.useMemo(() => ({
904
+ orientation
905
+ }), [orientation]);
906
+ const isHidden = orientation === "vertical" ? hiddenState.y : hiddenState.x;
907
+ const shouldRender = keepMounted || !isHidden;
908
+ if (!shouldRender) {
909
+ return null;
910
+ }
911
+ return /* @__PURE__ */ _jsx2(ScrollAreaScrollbarContext.Provider, {
912
+ value: contextValue,
913
+ children: element
914
+ });
915
+ });
916
+ if (true)
917
+ ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar";
918
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/content/ScrollAreaContent.js
919
+ import * as React7 from "react";
920
+ "use client";
921
+ var ScrollAreaContent = /* @__PURE__ */ React7.forwardRef(function ScrollAreaContent2(componentProps, forwardedRef) {
922
+ const {
923
+ render,
924
+ className,
925
+ style,
926
+ ...elementProps
927
+ } = componentProps;
928
+ const contentWrapperRef = React7.useRef(null);
929
+ const {
930
+ computeThumbPosition
931
+ } = useScrollAreaViewportContext();
932
+ const {
933
+ viewportState
934
+ } = useScrollAreaRootContext();
935
+ useIsoLayoutEffect(() => {
936
+ if (typeof ResizeObserver === "undefined") {
937
+ return;
938
+ }
939
+ let hasInitialized = false;
940
+ const ro = new ResizeObserver(() => {
941
+ if (!hasInitialized) {
942
+ hasInitialized = true;
943
+ return;
944
+ }
945
+ computeThumbPosition();
946
+ });
947
+ if (contentWrapperRef.current) {
948
+ ro.observe(contentWrapperRef.current);
949
+ }
950
+ return () => {
951
+ ro.disconnect();
952
+ };
953
+ }, [computeThumbPosition]);
954
+ const element = useRenderElement("div", componentProps, {
955
+ ref: [forwardedRef, contentWrapperRef],
956
+ state: viewportState,
957
+ stateAttributesMapping: scrollAreaStateAttributesMapping,
958
+ props: [{
959
+ role: "presentation",
960
+ style: {
961
+ minWidth: "fit-content"
962
+ }
963
+ }, elementProps]
964
+ });
965
+ return element;
966
+ });
967
+ if (true)
968
+ ScrollAreaContent.displayName = "ScrollAreaContent";
969
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/thumb/ScrollAreaThumb.js
970
+ import * as React8 from "react";
971
+ "use client";
972
+ var ScrollAreaThumb = /* @__PURE__ */ React8.forwardRef(function ScrollAreaThumb2(componentProps, forwardedRef) {
973
+ const {
974
+ render,
975
+ className,
976
+ style,
977
+ ...elementProps
978
+ } = componentProps;
979
+ const {
980
+ thumbYRef,
981
+ thumbXRef,
982
+ handlePointerDown,
983
+ handlePointerMove,
984
+ handlePointerUp,
985
+ setScrollingX,
986
+ setScrollingY,
987
+ hasMeasuredScrollbar
988
+ } = useScrollAreaRootContext();
989
+ const {
990
+ orientation
991
+ } = useScrollAreaScrollbarContext();
992
+ const state = {
993
+ orientation
994
+ };
995
+ const element = useRenderElement("div", componentProps, {
996
+ ref: [forwardedRef, orientation === "vertical" ? thumbYRef : thumbXRef],
997
+ state,
998
+ props: [{
999
+ onPointerDown: handlePointerDown,
1000
+ onPointerMove: handlePointerMove,
1001
+ onPointerUp(event) {
1002
+ if (orientation === "vertical") {
1003
+ setScrollingY(false);
1004
+ }
1005
+ if (orientation === "horizontal") {
1006
+ setScrollingX(false);
1007
+ }
1008
+ handlePointerUp(event);
1009
+ },
1010
+ style: {
1011
+ visibility: hasMeasuredScrollbar ? undefined : "hidden",
1012
+ ...orientation === "vertical" && {
1013
+ height: `var(${ScrollAreaScrollbarCssVars.scrollAreaThumbHeight})`
1014
+ },
1015
+ ...orientation === "horizontal" && {
1016
+ width: `var(${ScrollAreaScrollbarCssVars.scrollAreaThumbWidth})`
1017
+ }
1018
+ }
1019
+ }, elementProps]
1020
+ });
1021
+ return element;
1022
+ });
1023
+ if (true)
1024
+ ScrollAreaThumb.displayName = "ScrollAreaThumb";
1025
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/scroll-area/corner/ScrollAreaCorner.js
1026
+ import * as React9 from "react";
1027
+ "use client";
1028
+ var ScrollAreaCorner = /* @__PURE__ */ React9.forwardRef(function ScrollAreaCorner2(componentProps, forwardedRef) {
1029
+ const {
1030
+ render,
1031
+ className,
1032
+ style,
1033
+ ...elementProps
1034
+ } = componentProps;
1035
+ const {
1036
+ cornerRef,
1037
+ cornerSize,
1038
+ hiddenState
1039
+ } = useScrollAreaRootContext();
1040
+ const element = useRenderElement("div", componentProps, {
1041
+ ref: [forwardedRef, cornerRef],
1042
+ props: [{
1043
+ style: {
1044
+ position: "absolute",
1045
+ bottom: 0,
1046
+ insetInlineEnd: 0,
1047
+ width: cornerSize.width,
1048
+ height: cornerSize.height
1049
+ }
1050
+ }, elementProps]
1051
+ });
1052
+ if (hiddenState.corner) {
1053
+ return null;
1054
+ }
1055
+ return element;
1056
+ });
1057
+ if (true)
1058
+ ScrollAreaCorner.displayName = "ScrollAreaCorner";
1059
+ export {
1060
+ exports_index_parts as ScrollArea
1061
+ };