@orchidui/dashboard 1.8.1-96 → 1.8.1-98

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 (166) hide show
  1. package/dist/Dashboard/Card/OcCard.js +1 -1
  2. package/dist/Dashboard/TextEditor/QuillEditor.js +1 -1
  3. package/dist/{OcCard-B3SCzVwn.js → OcCard-D3be6IMj.js} +58 -54
  4. package/dist/OcCodeBlock-uFQyGnLq.js +37 -0
  5. package/dist/{OcLottieAnimation-DeMoIDaX.js → OcLottieAnimation-BB7AK2AO.js} +62 -62
  6. package/dist/{QuillEditor-hFQ0MJZO.js → QuillEditor-DRwC0sgJ.js} +579 -556
  7. package/dist/index.js +4 -4
  8. package/package.json +3 -265
  9. package/dist/AccordionTrigger.vue_vue_type_script_setup_true_lang-BdmLII9i.js +0 -295
  10. package/dist/CalendarPrevButton.vue_vue_type_script_setup_true_lang-DpJRpFhK.js +0 -891
  11. package/dist/CardTitle.vue_vue_type_script_setup_true_lang-D2_Bj3jw.js +0 -68
  12. package/dist/Checkbox.vue_vue_type_script_setup_true_lang-C51LjITJ.js +0 -172
  13. package/dist/CollapsibleTrigger-fCarY5DJ.js +0 -154
  14. package/dist/Collection-COudIl-A.js +0 -55
  15. package/dist/ConfigProvider-7mV0D7Sp.js +0 -6
  16. package/dist/DialogContent.vue_vue_type_script_setup_true_lang-CdrrrG29.js +0 -68
  17. package/dist/DialogOverlay-Cj3UTjZ8.js +0 -309
  18. package/dist/DialogPortal-zAvO8zt4.js +0 -23
  19. package/dist/DialogTrigger-BIF1A4hk.js +0 -72
  20. package/dist/DismissableLayer-C7IJliOb.js +0 -151
  21. package/dist/FocusScope--pJ6bboI.js +0 -121
  22. package/dist/FormMessage.vue_vue_type_script_setup_true_lang-DwlnFEn2.js +0 -92
  23. package/dist/Input.vue_vue_type_script_setup_true_lang-BrjsUUvL.js +0 -27
  24. package/dist/Label.vue_vue_type_script_setup_true_lang-D_LMIKBv.js +0 -51
  25. package/dist/ListboxItem-CjMk-mEX.js +0 -417
  26. package/dist/MenuSubTrigger-CUrxnPwO.js +0 -845
  27. package/dist/OcCodeBlock-CBdVqav7.js +0 -37
  28. package/dist/PopoverTrigger.vue_vue_type_script_setup_true_lang-DtI_qIyx.js +0 -394
  29. package/dist/PopperContent-BT3Svcc3.js +0 -1465
  30. package/dist/Presence-CxfTrw6l.js +0 -133
  31. package/dist/Primitive-B3twiLO1.js +0 -44
  32. package/dist/RadioGroupItem.vue_vue_type_script_setup_true_lang-BNfRYIhL.js +0 -297
  33. package/dist/RovingFocusGroup-0OHdFQl0.js +0 -92
  34. package/dist/RovingFocusItem-s7Ug6oxb.js +0 -82
  35. package/dist/SelectValue.vue_vue_type_script_setup_true_lang-CVsYrN1R.js +0 -1255
  36. package/dist/Separator-DRam5i7g.js +0 -54
  37. package/dist/Separator.vue_vue_type_script_setup_true_lang-DGPbh6Dt.js +0 -27
  38. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-k1A7l6Y-.js +0 -17
  39. package/dist/Switch.vue_vue_type_script_setup_true_lang-94ZKgnTz.js +0 -135
  40. package/dist/Teleport-DnUewq5H.js +0 -25
  41. package/dist/Textarea.vue_vue_type_script_setup_true_lang-DKazues9.js +0 -27
  42. package/dist/TooltipTrigger.vue_vue_type_script_setup_true_lang-CZ3AuN38.js +0 -426
  43. package/dist/VisuallyHidden-DMAU4heD.js +0 -41
  44. package/dist/VisuallyHiddenInput-DvJnsVHt.js +0 -59
  45. package/dist/_commonjsHelpers-B4e78b8K.js +0 -28
  46. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  47. package/dist/array-CqVTtuYm.js +0 -6
  48. package/dist/arrays-4jDZqbdb.js +0 -20
  49. package/dist/check-C2tzJ0Gk.js +0 -11
  50. package/dist/chevron-down-CnpAlizg.js +0 -13
  51. package/dist/chevron-left-BOwFasou.js +0 -13
  52. package/dist/chevron-right-D308801z.js +0 -13
  53. package/dist/circle-A-6NpYiX.js +0 -13
  54. package/dist/clamp-BL1Rb24G.js +0 -22
  55. package/dist/constant-CuDQlTIy.js +0 -3433
  56. package/dist/createContext-CZEfaSVa.js +0 -17
  57. package/dist/createLucideIcon-eXqDwUWj.js +0 -71
  58. package/dist/ellipsis-CEG9G7eN.js +0 -15
  59. package/dist/getActiveElement-B-HWdUIb.js +0 -11
  60. package/dist/handleAndDispatchCustomEvent-Byh08EHr.js +0 -11
  61. package/dist/index-B3LW8uSH.js +0 -133
  62. package/dist/index-BIlpXuWX.js +0 -3430
  63. package/dist/index-BlGEiPHj.js +0 -1246
  64. package/dist/index-BwPb_idr.js +0 -574
  65. package/dist/index-C9julNQm.js +0 -173
  66. package/dist/index-C_aI-Wfj.js +0 -34
  67. package/dist/index-CumjCvqB.js +0 -5703
  68. package/dist/index-LqWMCtOd.js +0 -809
  69. package/dist/index-OpE2oGce.js +0 -110
  70. package/dist/isValueEqualOrExist-BDSMUv8t.js +0 -8
  71. package/dist/lib/utils.js +0 -5
  72. package/dist/nullish-CjWwlQS3.js +0 -6
  73. package/dist/ohash.D__AXeF1-DX2n0b2C.js +0 -106
  74. package/dist/plus-CgluTYQY.js +0 -14
  75. package/dist/text-zwICaAnx.js +0 -743
  76. package/dist/ui/accordion/index.js +0 -7
  77. package/dist/ui/alert/index.js +0 -64
  78. package/dist/ui/alert-dialog/index.js +0 -356
  79. package/dist/ui/aspect-ratio/index.js +0 -50
  80. package/dist/ui/auto-form/constant.js +0 -5
  81. package/dist/ui/auto-form/dependencies.js +0 -61
  82. package/dist/ui/auto-form/index.js +0 -227
  83. package/dist/ui/auto-form/interface.js +0 -4
  84. package/dist/ui/auto-form/utils.js +0 -89
  85. package/dist/ui/avatar/index.js +0 -189
  86. package/dist/ui/badge/index.js +0 -37
  87. package/dist/ui/breadcrumb/index.js +0 -126
  88. package/dist/ui/button/index.js +0 -55
  89. package/dist/ui/calendar/index.js +0 -15
  90. package/dist/ui/card/index.js +0 -38
  91. package/dist/ui/carousel/index.js +0 -174
  92. package/dist/ui/carousel/interface.js +0 -1
  93. package/dist/ui/carousel/useCarousel.js +0 -1288
  94. package/dist/ui/chart/index.js +0 -8
  95. package/dist/ui/chart/interface.js +0 -1
  96. package/dist/ui/chart-area/index.js +0 -331
  97. package/dist/ui/chart-bar/index.js +0 -490
  98. package/dist/ui/chart-donut/index.js +0 -509
  99. package/dist/ui/chart-line/index.js +0 -110
  100. package/dist/ui/checkbox/index.js +0 -4
  101. package/dist/ui/collapsible/index.js +0 -60
  102. package/dist/ui/combobox/index.js +0 -877
  103. package/dist/ui/command/index.js +0 -323
  104. package/dist/ui/context-menu/index.js +0 -734
  105. package/dist/ui/dialog/index.js +0 -169
  106. package/dist/ui/drawer/index.js +0 -971
  107. package/dist/ui/dropdown-menu/index.js +0 -723
  108. package/dist/ui/form/index.js +0 -13
  109. package/dist/ui/form/injectionKeys.js +0 -4
  110. package/dist/ui/form/useFormField.js +0 -25
  111. package/dist/ui/hover-card/index.js +0 -331
  112. package/dist/ui/input/index.js +0 -4
  113. package/dist/ui/label/index.js +0 -4
  114. package/dist/ui/menubar/index.js +0 -862
  115. package/dist/ui/navigation-menu/index.js +0 -873
  116. package/dist/ui/number-field/index.js +0 -682
  117. package/dist/ui/pagination/index.js +0 -444
  118. package/dist/ui/pin-input/index.js +0 -308
  119. package/dist/ui/popover/index.js +0 -6
  120. package/dist/ui/progress/index.js +0 -137
  121. package/dist/ui/radio-group/index.js +0 -5
  122. package/dist/ui/range-calendar/index.js +0 -986
  123. package/dist/ui/resizable/index.js +0 -1432
  124. package/dist/ui/scroll-area/index.js +0 -775
  125. package/dist/ui/select/index.js +0 -135
  126. package/dist/ui/separator/index.js +0 -4
  127. package/dist/ui/sheet/index.js +0 -188
  128. package/dist/ui/sidebar/index.js +0 -652
  129. package/dist/ui/sidebar/utils.js +0 -12
  130. package/dist/ui/skeleton/index.js +0 -4
  131. package/dist/ui/slider/index.js +0 -478
  132. package/dist/ui/sonner/index.js +0 -892
  133. package/dist/ui/stepper/index.js +0 -442
  134. package/dist/ui/switch/index.js +0 -4
  135. package/dist/ui/table/index.js +0 -153
  136. package/dist/ui/tabs/index.js +0 -280
  137. package/dist/ui/tags-input/index.js +0 -449
  138. package/dist/ui/textarea/index.js +0 -4
  139. package/dist/ui/toast/index.js +0 -738
  140. package/dist/ui/toast/use-toast.js +0 -85
  141. package/dist/ui/toggle/index.js +0 -6
  142. package/dist/ui/toggle-group/index.js +0 -112
  143. package/dist/ui/tooltip/index.js +0 -29
  144. package/dist/useArrowNavigation-BRMPveaB.js +0 -49
  145. package/dist/useBodyScrollLock-CazCRZjZ.js +0 -153
  146. package/dist/useDirection-C3C_TLKm.js +0 -14
  147. package/dist/useFocusGuards-CyjC9cG9.js +0 -26
  148. package/dist/useFormControl-CFVC51Lp.js +0 -11
  149. package/dist/useForwardExpose-DZT6mL_U.js +0 -37
  150. package/dist/useForwardPropsEmits-0XKBv1pB.js +0 -33
  151. package/dist/useGraceArea-D7-GP1ii.js +0 -137
  152. package/dist/useId-reAg216X.js +0 -13
  153. package/dist/useKbd-BJNupnml.js +0 -41
  154. package/dist/useLocale-BfU0LC8Z.js +0 -14
  155. package/dist/useNonce-C1ZOgOp5.js +0 -14
  156. package/dist/usePrimitiveElement-BjwUvHih.js +0 -15
  157. package/dist/useSingleOrMultipleValue-BkTAaaJB.js +0 -43
  158. package/dist/useSize-BnyQ8FZF.js +0 -37
  159. package/dist/useTypeahead-oSidjyFF.js +0 -40
  160. package/dist/utils-DKNaYMZh.js +0 -57
  161. package/dist/utils-Dx9la83v.js +0 -35
  162. package/dist/utils-DxQ_ywGa.js +0 -55
  163. package/dist/utils-SFgRDk1R.js +0 -2748
  164. package/dist/utils-W-UiqiPE.js +0 -1869
  165. package/dist/vee-validate-Cf8JDJ_k.js +0 -2232
  166. package/dist/x-Cl6YllUK.js +0 -14
@@ -1,775 +0,0 @@
1
- import { defineComponent as C, ref as b, toRefs as M, createBlock as g, openBlock as S, unref as r, normalizeStyle as W, withCtx as m, renderSlot as w, computed as R, watch as I, createCommentVNode as U, mergeProps as _, onMounted as B, onUnmounted as X, createVNode as x, watchEffect as G, createElementBlock as ne, Fragment as ae, createElementVNode as se, createTextVNode as ce } from "vue";
2
- import { c as Q } from "../../utils-SFgRDk1R.js";
3
- import { q as H, v as Z, w as ie } from "../../index-BwPb_idr.js";
4
- import { c as ue } from "../../clamp-BL1Rb24G.js";
5
- import { u as P } from "../../useForwardExpose-DZT6mL_U.js";
6
- import { P as z } from "../../Primitive-B3twiLO1.js";
7
- import { c as F } from "../../createContext-CZEfaSVa.js";
8
- import { u as de } from "../../useDirection-C3C_TLKm.js";
9
- import { P as j, u as fe } from "../../Presence-CxfTrw6l.js";
10
- import { r as ee } from "../../index-OpE2oGce.js";
11
- import { u as ve } from "../../useNonce-C1ZOgOp5.js";
12
- const [$, pe] = F("ScrollAreaRoot"), he = /* @__PURE__ */ C({
13
- __name: "ScrollAreaRoot",
14
- props: {
15
- type: { default: "hover" },
16
- dir: {},
17
- scrollHideDelay: { default: 600 },
18
- asChild: { type: Boolean },
19
- as: {}
20
- },
21
- setup(s, { expose: e }) {
22
- const l = s, t = b(0), n = b(0), a = b(), c = b(), o = b(), u = b(), f = b(!1), p = b(!1), { type: y, dir: h, scrollHideDelay: E } = M(l), T = de(h);
23
- function A() {
24
- var d;
25
- (d = a.value) == null || d.scrollTo({
26
- top: 0
27
- });
28
- }
29
- function L() {
30
- var d;
31
- (d = a.value) == null || d.scrollTo({
32
- top: 0,
33
- left: 0
34
- });
35
- }
36
- e({
37
- /** Viewport element within ScrollArea */
38
- viewport: a,
39
- /** Scroll viewport to top */
40
- scrollTop: A,
41
- /** Scroll viewport to top-left */
42
- scrollTopLeft: L
43
- });
44
- const { forwardRef: i, currentElement: v } = P();
45
- return pe({
46
- type: y,
47
- dir: T,
48
- scrollHideDelay: E,
49
- scrollArea: v,
50
- viewport: a,
51
- onViewportChange: (d) => {
52
- a.value = d || void 0;
53
- },
54
- content: c,
55
- onContentChange: (d) => {
56
- c.value = d;
57
- },
58
- scrollbarX: o,
59
- scrollbarXEnabled: f,
60
- scrollbarY: u,
61
- scrollbarYEnabled: p,
62
- onScrollbarXChange: (d) => {
63
- o.value = d || void 0;
64
- },
65
- onScrollbarYChange: (d) => {
66
- u.value = d || void 0;
67
- },
68
- onScrollbarXEnabledChange: (d) => {
69
- f.value = d;
70
- },
71
- onScrollbarYEnabledChange: (d) => {
72
- p.value = d;
73
- },
74
- onCornerWidthChange: (d) => {
75
- t.value = d;
76
- },
77
- onCornerHeightChange: (d) => {
78
- n.value = d;
79
- }
80
- }), (d, k) => (S(), g(r(z), {
81
- ref: r(i),
82
- "as-child": l.asChild,
83
- as: d.as,
84
- dir: r(T),
85
- style: W({
86
- position: "relative",
87
- // Pass corner sizes as CSS vars to reduce re-renders of context consumers
88
- "--reka-scroll-area-corner-width": `${t.value}px`,
89
- "--reka-scroll-area-corner-height": `${n.value}px`
90
- })
91
- }, {
92
- default: m(() => [
93
- w(d.$slots, "default")
94
- ]),
95
- _: 3
96
- }, 8, ["as-child", "as", "dir", "style"]));
97
- }
98
- }), me = /* @__PURE__ */ C({
99
- __name: "ScrollAreaCornerImpl",
100
- setup(s) {
101
- const e = $(), l = b(0), t = b(0), n = R(() => !!l.value && !!t.value);
102
- function a() {
103
- var u;
104
- const o = ((u = e.scrollbarX.value) == null ? void 0 : u.offsetHeight) || 0;
105
- e.onCornerHeightChange(o), t.value = o;
106
- }
107
- function c() {
108
- var u;
109
- const o = ((u = e.scrollbarY.value) == null ? void 0 : u.offsetWidth) || 0;
110
- e.onCornerWidthChange(o), l.value = o;
111
- }
112
- return H(e.scrollbarX.value, a), H(e.scrollbarY.value, c), I(() => e.scrollbarX.value, a), I(() => e.scrollbarY.value, c), (o, u) => {
113
- var f;
114
- return n.value ? (S(), g(r(z), _({
115
- key: 0,
116
- style: {
117
- width: `${l.value}px`,
118
- height: `${t.value}px`,
119
- position: "absolute",
120
- right: r(e).dir.value === "ltr" ? 0 : void 0,
121
- left: r(e).dir.value === "rtl" ? 0 : void 0,
122
- bottom: 0
123
- }
124
- }, (f = o.$parent) == null ? void 0 : f.$props), {
125
- default: m(() => [
126
- w(o.$slots, "default")
127
- ]),
128
- _: 3
129
- }, 16, ["style"])) : U("", !0);
130
- };
131
- }
132
- }), be = /* @__PURE__ */ C({
133
- __name: "ScrollAreaCorner",
134
- props: {
135
- asChild: { type: Boolean },
136
- as: {}
137
- },
138
- setup(s) {
139
- const e = s, { forwardRef: l } = P(), t = $(), n = R(
140
- () => !!t.scrollbarX.value && !!t.scrollbarY.value
141
- ), a = R(
142
- () => t.type.value !== "scroll" && n.value
143
- );
144
- return (c, o) => a.value ? (S(), g(me, _({ key: 0 }, e, { ref: r(l) }), {
145
- default: m(() => [
146
- w(c.$slots, "default")
147
- ]),
148
- _: 3
149
- }, 16)) : U("", !0);
150
- }
151
- });
152
- function te(s, e) {
153
- return (l) => {
154
- if (s[0] === s[1] || e[0] === e[1])
155
- return e[0];
156
- const t = (e[1] - e[0]) / (s[1] - s[0]);
157
- return e[0] + t * (l - s[0]);
158
- };
159
- }
160
- function Y(s) {
161
- const e = oe(s.viewport, s.content), l = s.scrollbar.paddingStart + s.scrollbar.paddingEnd, t = (s.scrollbar.size - l) * e;
162
- return Math.max(t, 18);
163
- }
164
- function oe(s, e) {
165
- const l = s / e;
166
- return Number.isNaN(l) ? 0 : l;
167
- }
168
- function Se(s, e = () => {
169
- }) {
170
- let l = { left: s.scrollLeft, top: s.scrollTop }, t = 0;
171
- return function n() {
172
- const a = { left: s.scrollLeft, top: s.scrollTop }, c = l.left !== a.left, o = l.top !== a.top;
173
- (c || o) && e(), l = a, t = window.requestAnimationFrame(n);
174
- }(), () => window.cancelAnimationFrame(t);
175
- }
176
- function J(s, e, l = "ltr") {
177
- const t = Y(e), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, a = e.scrollbar.size - n, c = e.content - e.viewport, o = a - t, u = l === "ltr" ? [0, c] : [c * -1, 0], f = ue(
178
- s,
179
- u[0],
180
- u[1]
181
- );
182
- return te([0, c], [0, o])(f);
183
- }
184
- function O(s) {
185
- return s ? Number.parseInt(s, 10) : 0;
186
- }
187
- function ge(s, e, l, t = "ltr") {
188
- const n = Y(l), a = n / 2, c = e || a, o = n - c, u = l.scrollbar.paddingStart + c, f = l.scrollbar.size - l.scrollbar.paddingEnd - o, p = l.content - l.viewport, y = t === "ltr" ? [0, p] : [p * -1, 0];
189
- return te(
190
- [u, f],
191
- y
192
- )(s);
193
- }
194
- function K(s, e) {
195
- return s > 0 && s < e;
196
- }
197
- const re = /* @__PURE__ */ C({
198
- __name: "ScrollAreaScrollbarImpl",
199
- props: {
200
- isHorizontal: { type: Boolean }
201
- },
202
- emits: ["onDragScroll", "onWheelScroll", "onThumbPointerDown"],
203
- setup(s, { emit: e }) {
204
- const l = s, t = e, n = $(), a = V(), c = N(), { forwardRef: o, currentElement: u } = P(), f = b(""), p = b();
205
- function y(i) {
206
- var v, d;
207
- if (p.value) {
208
- const k = i.clientX - ((v = p.value) == null ? void 0 : v.left), D = i.clientY - ((d = p.value) == null ? void 0 : d.top);
209
- t("onDragScroll", { x: k, y: D });
210
- }
211
- }
212
- function h(i) {
213
- i.button === 0 && (i.target.setPointerCapture(i.pointerId), p.value = u.value.getBoundingClientRect(), f.value = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", n.viewport && (n.viewport.value.style.scrollBehavior = "auto"), y(i));
214
- }
215
- function E(i) {
216
- y(i);
217
- }
218
- function T(i) {
219
- const v = i.target;
220
- v.hasPointerCapture(i.pointerId) && v.releasePointerCapture(i.pointerId), document.body.style.webkitUserSelect = f.value, n.viewport && (n.viewport.value.style.scrollBehavior = ""), p.value = void 0;
221
- }
222
- function A(i) {
223
- var D;
224
- const v = i.target, d = (D = u.value) == null ? void 0 : D.contains(v), k = a.sizes.value.content - a.sizes.value.viewport;
225
- d && a.handleWheelScroll(i, k);
226
- }
227
- B(() => {
228
- document.addEventListener("wheel", A, { passive: !1 });
229
- }), X(() => {
230
- document.removeEventListener("wheel", A);
231
- });
232
- function L() {
233
- var i, v, d, k, D;
234
- u.value && (l.isHorizontal ? a.handleSizeChange({
235
- content: ((i = n.viewport.value) == null ? void 0 : i.scrollWidth) ?? 0,
236
- viewport: ((v = n.viewport.value) == null ? void 0 : v.offsetWidth) ?? 0,
237
- scrollbar: {
238
- size: u.value.clientWidth ?? 0,
239
- paddingStart: O(getComputedStyle(u.value).paddingLeft),
240
- paddingEnd: O(getComputedStyle(u.value).paddingRight)
241
- }
242
- }) : a.handleSizeChange({
243
- content: ((d = n.viewport.value) == null ? void 0 : d.scrollHeight) ?? 0,
244
- viewport: ((k = n.viewport.value) == null ? void 0 : k.offsetHeight) ?? 0,
245
- scrollbar: {
246
- size: ((D = u.value) == null ? void 0 : D.clientHeight) ?? 0,
247
- paddingStart: O(getComputedStyle(u.value).paddingLeft),
248
- paddingEnd: O(getComputedStyle(u.value).paddingRight)
249
- }
250
- }));
251
- }
252
- return H(u, L), H(n.content, L), (i, v) => (S(), g(r(z), {
253
- ref: r(o),
254
- style: { position: "absolute" },
255
- "data-scrollbarimpl": "",
256
- as: r(c).as.value,
257
- "as-child": r(c).asChild.value,
258
- onPointerdown: h,
259
- onPointermove: E,
260
- onPointerup: T
261
- }, {
262
- default: m(() => [
263
- w(i.$slots, "default")
264
- ]),
265
- _: 3
266
- }, 8, ["as", "as-child"]));
267
- }
268
- }), we = /* @__PURE__ */ C({
269
- __name: "ScrollAreaScrollbarX",
270
- setup(s) {
271
- const e = $(), l = V(), { forwardRef: t, currentElement: n } = P();
272
- B(() => {
273
- n.value && e.onScrollbarXChange(n.value);
274
- });
275
- const a = R(() => l.sizes.value);
276
- return (c, o) => (S(), g(re, {
277
- ref: r(t),
278
- "is-horizontal": !0,
279
- "data-orientation": "horizontal",
280
- style: W({
281
- bottom: 0,
282
- left: r(e).dir.value === "rtl" ? "var(--reka-scroll-area-corner-width)" : 0,
283
- right: r(e).dir.value === "ltr" ? "var(--reka-scroll-area-corner-width)" : 0,
284
- "--reka-scroll-area-thumb-width": a.value ? `${r(Y)(a.value)}px` : void 0
285
- }),
286
- onOnDragScroll: o[0] || (o[0] = (u) => r(l).onDragScroll(u.x))
287
- }, {
288
- default: m(() => [
289
- w(c.$slots, "default")
290
- ]),
291
- _: 3
292
- }, 8, ["style"]));
293
- }
294
- }), Ce = /* @__PURE__ */ C({
295
- __name: "ScrollAreaScrollbarY",
296
- setup(s) {
297
- const e = $(), l = V(), { forwardRef: t, currentElement: n } = P();
298
- B(() => {
299
- n.value && e.onScrollbarYChange(n.value);
300
- });
301
- const a = R(() => l.sizes.value);
302
- return (c, o) => (S(), g(re, {
303
- ref: r(t),
304
- "is-horizontal": !1,
305
- "data-orientation": "vertical",
306
- style: W({
307
- top: 0,
308
- right: r(e).dir.value === "ltr" ? 0 : void 0,
309
- left: r(e).dir.value === "rtl" ? 0 : void 0,
310
- bottom: "var(--reka-scroll-area-corner-height)",
311
- "--reka-scroll-area-thumb-height": a.value ? `${r(Y)(a.value)}px` : void 0
312
- }),
313
- onOnDragScroll: o[0] || (o[0] = (u) => r(l).onDragScroll(u.y))
314
- }, {
315
- default: m(() => [
316
- w(c.$slots, "default")
317
- ]),
318
- _: 3
319
- }, 8, ["style"]));
320
- }
321
- }), [V, _e] = F("ScrollAreaScrollbarVisible"), q = /* @__PURE__ */ C({
322
- __name: "ScrollAreaScrollbarVisible",
323
- setup(s) {
324
- const e = $(), l = N(), { forwardRef: t } = P(), n = b({
325
- content: 0,
326
- viewport: 0,
327
- scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
328
- }), a = R(() => {
329
- const i = oe(n.value.viewport, n.value.content);
330
- return i > 0 && i < 1;
331
- }), c = b(), o = b(0);
332
- function u(i, v) {
333
- if (E.value) {
334
- const d = e.viewport.value.scrollLeft + i.deltaY;
335
- e.viewport.value.scrollLeft = d, K(d, v) && i.preventDefault();
336
- } else {
337
- const d = e.viewport.value.scrollTop + i.deltaY;
338
- e.viewport.value.scrollTop = d, K(d, v) && i.preventDefault();
339
- }
340
- }
341
- function f(i, v) {
342
- E.value ? o.value = v.x : o.value = v.y;
343
- }
344
- function p(i) {
345
- o.value = 0;
346
- }
347
- function y(i) {
348
- n.value = i;
349
- }
350
- function h(i, v) {
351
- return ge(
352
- i,
353
- o.value,
354
- n.value,
355
- v
356
- );
357
- }
358
- const E = R(
359
- () => l.isHorizontal.value
360
- );
361
- function T(i) {
362
- E.value ? e.viewport.value.scrollLeft = h(
363
- i,
364
- e.dir.value
365
- ) : e.viewport.value.scrollTop = h(i);
366
- }
367
- function A() {
368
- if (E.value) {
369
- if (e.viewport.value && c.value) {
370
- const i = e.viewport.value.scrollLeft, v = J(
371
- i,
372
- n.value,
373
- e.dir.value
374
- );
375
- c.value.style.transform = `translate3d(${v}px, 0, 0)`;
376
- }
377
- } else if (e.viewport.value && c.value) {
378
- const i = e.viewport.value.scrollTop, v = J(i, n.value);
379
- c.value.style.transform = `translate3d(0, ${v}px, 0)`;
380
- }
381
- }
382
- function L(i) {
383
- c.value = i;
384
- }
385
- return _e({
386
- sizes: n,
387
- hasThumb: a,
388
- handleWheelScroll: u,
389
- handleThumbDown: f,
390
- handleThumbUp: p,
391
- handleSizeChange: y,
392
- onThumbPositionChange: A,
393
- onThumbChange: L,
394
- onDragScroll: T
395
- }), (i, v) => E.value ? (S(), g(we, _({ key: 0 }, i.$attrs, { ref: r(t) }), {
396
- default: m(() => [
397
- w(i.$slots, "default")
398
- ]),
399
- _: 3
400
- }, 16)) : (S(), g(Ce, _({ key: 1 }, i.$attrs, { ref: r(t) }), {
401
- default: m(() => [
402
- w(i.$slots, "default")
403
- ]),
404
- _: 3
405
- }, 16));
406
- }
407
- }), le = /* @__PURE__ */ C({
408
- __name: "ScrollAreaScrollbarAuto",
409
- props: {
410
- forceMount: { type: Boolean }
411
- },
412
- setup(s) {
413
- const e = $(), l = N(), { forwardRef: t } = P(), n = b(!1), a = Z(() => {
414
- if (e.viewport.value) {
415
- const c = e.viewport.value.offsetWidth < e.viewport.value.scrollWidth, o = e.viewport.value.offsetHeight < e.viewport.value.scrollHeight;
416
- n.value = l.isHorizontal.value ? c : o;
417
- }
418
- }, 10);
419
- return B(() => a()), H(e.viewport, a), H(e.content, a), (c, o) => (S(), g(r(j), {
420
- present: c.forceMount || n.value
421
- }, {
422
- default: m(() => [
423
- x(q, _(c.$attrs, {
424
- ref: r(t),
425
- "data-state": n.value ? "visible" : "hidden"
426
- }), {
427
- default: m(() => [
428
- w(c.$slots, "default")
429
- ]),
430
- _: 3
431
- }, 16, ["data-state"])
432
- ]),
433
- _: 3
434
- }, 8, ["present"]));
435
- }
436
- }), ye = /* @__PURE__ */ C({
437
- inheritAttrs: !1,
438
- __name: "ScrollAreaScrollbarHover",
439
- props: {
440
- forceMount: { type: Boolean }
441
- },
442
- setup(s) {
443
- const e = $(), { forwardRef: l } = P();
444
- let t;
445
- const n = b(!1);
446
- function a() {
447
- window.clearTimeout(t), n.value = !0;
448
- }
449
- function c() {
450
- t = window.setTimeout(() => {
451
- n.value = !1;
452
- }, e.scrollHideDelay.value);
453
- }
454
- return B(() => {
455
- const o = e.scrollArea.value;
456
- o && (o.addEventListener("pointerenter", a), o.addEventListener("pointerleave", c));
457
- }), X(() => {
458
- const o = e.scrollArea.value;
459
- o && (window.clearTimeout(t), o.removeEventListener("pointerenter", a), o.removeEventListener("pointerleave", c));
460
- }), (o, u) => (S(), g(r(j), {
461
- present: o.forceMount || n.value
462
- }, {
463
- default: m(() => [
464
- x(le, _(o.$attrs, {
465
- ref: r(l),
466
- "data-state": n.value ? "visible" : "hidden"
467
- }), {
468
- default: m(() => [
469
- w(o.$slots, "default")
470
- ]),
471
- _: 3
472
- }, 16, ["data-state"])
473
- ]),
474
- _: 3
475
- }, 8, ["present"]));
476
- }
477
- }), Ee = /* @__PURE__ */ C({
478
- __name: "ScrollAreaScrollbarScroll",
479
- props: {
480
- forceMount: { type: Boolean }
481
- },
482
- setup(s) {
483
- const e = $(), l = N(), { forwardRef: t } = P(), { state: n, dispatch: a } = fe("hidden", {
484
- hidden: {
485
- SCROLL: "scrolling"
486
- },
487
- scrolling: {
488
- SCROLL_END: "idle",
489
- POINTER_ENTER: "interacting"
490
- },
491
- interacting: {
492
- SCROLL: "interacting",
493
- POINTER_LEAVE: "idle"
494
- },
495
- idle: {
496
- HIDE: "hidden",
497
- SCROLL: "scrolling",
498
- POINTER_ENTER: "interacting"
499
- }
500
- });
501
- G((o) => {
502
- if (n.value === "idle") {
503
- const u = window.setTimeout(
504
- () => a("HIDE"),
505
- e.scrollHideDelay.value
506
- );
507
- o(() => {
508
- window.clearTimeout(u);
509
- });
510
- }
511
- });
512
- const c = Z(() => a("SCROLL_END"), 100);
513
- return G((o) => {
514
- const u = e.viewport.value, f = l.isHorizontal.value ? "scrollLeft" : "scrollTop";
515
- if (u) {
516
- let p = u[f];
517
- const y = () => {
518
- const h = u[f];
519
- p !== h && (a("SCROLL"), c()), p = h;
520
- };
521
- u.addEventListener("scroll", y), o(() => {
522
- u.removeEventListener("scroll", y);
523
- });
524
- }
525
- }), (o, u) => (S(), g(r(j), {
526
- present: o.forceMount || r(n) !== "hidden"
527
- }, {
528
- default: m(() => [
529
- x(q, _(o.$attrs, { ref: r(t) }), {
530
- default: m(() => [
531
- w(o.$slots, "default")
532
- ]),
533
- _: 3
534
- }, 16)
535
- ]),
536
- _: 3
537
- }, 8, ["present"]));
538
- }
539
- }), [N, Pe] = F("ScrollAreaScrollbar"), $e = /* @__PURE__ */ C({
540
- inheritAttrs: !1,
541
- __name: "ScrollAreaScrollbar",
542
- props: {
543
- orientation: { default: "vertical" },
544
- forceMount: { type: Boolean },
545
- asChild: { type: Boolean },
546
- as: { default: "div" }
547
- },
548
- setup(s) {
549
- const e = s, { forwardRef: l } = P(), t = $(), n = R(() => e.orientation === "horizontal");
550
- I(
551
- n,
552
- () => {
553
- n.value ? t.onScrollbarXEnabledChange(!0) : t.onScrollbarYEnabledChange(!0);
554
- },
555
- { immediate: !0 }
556
- ), X(() => {
557
- t.onScrollbarXEnabledChange(!1), t.onScrollbarYEnabledChange(!1);
558
- });
559
- const { orientation: a, forceMount: c, asChild: o, as: u } = M(e);
560
- return Pe({
561
- orientation: a,
562
- forceMount: c,
563
- isHorizontal: n,
564
- as: u,
565
- asChild: o
566
- }), (f, p) => r(t).type.value === "hover" ? (S(), g(ye, _({ key: 0 }, f.$attrs, {
567
- ref: r(l),
568
- "force-mount": r(c)
569
- }), {
570
- default: m(() => [
571
- w(f.$slots, "default")
572
- ]),
573
- _: 3
574
- }, 16, ["force-mount"])) : r(t).type.value === "scroll" ? (S(), g(Ee, _({ key: 1 }, f.$attrs, {
575
- ref: r(l),
576
- "force-mount": r(c)
577
- }), {
578
- default: m(() => [
579
- w(f.$slots, "default")
580
- ]),
581
- _: 3
582
- }, 16, ["force-mount"])) : r(t).type.value === "auto" ? (S(), g(le, _({ key: 2 }, f.$attrs, {
583
- ref: r(l),
584
- "force-mount": r(c)
585
- }), {
586
- default: m(() => [
587
- w(f.$slots, "default")
588
- ]),
589
- _: 3
590
- }, 16, ["force-mount"])) : r(t).type.value === "always" ? (S(), g(q, _({ key: 3 }, f.$attrs, {
591
- ref: r(l),
592
- "data-state": "visible"
593
- }), {
594
- default: m(() => [
595
- w(f.$slots, "default")
596
- ]),
597
- _: 3
598
- }, 16)) : U("", !0);
599
- }
600
- }), Re = /* @__PURE__ */ C({
601
- __name: "ScrollAreaThumb",
602
- props: {
603
- asChild: { type: Boolean },
604
- as: {}
605
- },
606
- setup(s) {
607
- const e = s, l = $(), t = V();
608
- function n(h) {
609
- const T = h.target.getBoundingClientRect(), A = h.clientX - T.left, L = h.clientY - T.top;
610
- t.handleThumbDown(h, { x: A, y: L });
611
- }
612
- function a(h) {
613
- t.handleThumbUp(h);
614
- }
615
- const { forwardRef: c, currentElement: o } = P(), u = b(), f = R(() => l.viewport.value);
616
- function p() {
617
- if (!u.value) {
618
- const h = Se(
619
- f.value,
620
- t.onThumbPositionChange
621
- );
622
- u.value = h, t.onThumbPositionChange();
623
- }
624
- }
625
- const y = R(() => t.sizes.value);
626
- return ie(y, () => {
627
- t.onThumbChange(o.value), f.value && (t.onThumbPositionChange(), f.value.addEventListener("scroll", p));
628
- }), X(() => {
629
- var h;
630
- f.value.removeEventListener("scroll", p), (h = l.viewport.value) == null || h.removeEventListener("scroll", p);
631
- }), (h, E) => (S(), g(r(z), {
632
- ref: r(c),
633
- "data-state": r(t).hasThumb ? "visible" : "hidden",
634
- style: {
635
- width: "var(--reka-scroll-area-thumb-width)",
636
- height: "var(--reka-scroll-area-thumb-height)"
637
- },
638
- "as-child": e.asChild,
639
- as: h.as,
640
- onPointerdown: n,
641
- onPointerup: a
642
- }, {
643
- default: m(() => [
644
- w(h.$slots, "default")
645
- ]),
646
- _: 3
647
- }, 8, ["data-state", "as-child", "as"]));
648
- }
649
- }), Te = /* @__PURE__ */ C({
650
- inheritAttrs: !1,
651
- __name: "ScrollAreaViewport",
652
- props: {
653
- nonce: {},
654
- asChild: { type: Boolean },
655
- as: {}
656
- },
657
- setup(s, { expose: e }) {
658
- const l = s, { nonce: t } = M(l), n = ve(t), a = $(), c = b();
659
- B(() => {
660
- a.onViewportChange(c.value), a.onContentChange(u.value);
661
- }), e({
662
- viewportElement: c
663
- });
664
- const { forwardRef: o, currentElement: u } = P();
665
- return (f, p) => (S(), ne(ae, null, [
666
- se("div", _({
667
- ref_key: "viewportElement",
668
- ref: c,
669
- "data-reka-scroll-area-viewport": "",
670
- style: {
671
- /**
672
- * We don't support `visible` because the intention is to have at least one scrollbar
673
- * if this component is used and `visible` will behave like `auto` in that case
674
- * https://developer.mozilla.org/en-US/docs/Web/CSS/overflowed#description
675
- *
676
- * We don't handle `auto` because the intention is for the native implementation
677
- * to be hidden if using this component. We just want to ensure the node is scrollable
678
- * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
679
- * the browser from having to work out whether to render native scrollbars or not,
680
- * we tell it to with the intention of hiding them in CSS.
681
- */
682
- overflowX: r(a).scrollbarXEnabled.value ? "scroll" : "hidden",
683
- overflowY: r(a).scrollbarYEnabled.value ? "scroll" : "hidden"
684
- }
685
- }, f.$attrs, { tabindex: 0 }), [
686
- x(r(z), {
687
- ref: r(o),
688
- style: W({
689
- /**
690
- * When horizontal scrollbar is visible: this element should be at least
691
- * as wide as its children for size calculations to work correctly.
692
- *
693
- * When horizontal scrollbar is NOT visible: this element's width should
694
- * be constrained by the parent container to enable `text-overflow: ellipsis`
695
- */
696
- minWidth: r(a).scrollbarXEnabled.value ? "fit-content" : void 0
697
- }),
698
- "as-child": l.asChild,
699
- as: f.as
700
- }, {
701
- default: m(() => [
702
- w(f.$slots, "default")
703
- ]),
704
- _: 3
705
- }, 8, ["style", "as-child", "as"])
706
- ], 16),
707
- x(r(z), {
708
- as: "style",
709
- nonce: r(n)
710
- }, {
711
- default: m(() => p[0] || (p[0] = [
712
- ce(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-reka-scroll-area-viewport]::-webkit-scrollbar { display:none; } ")
713
- ])),
714
- _: 1
715
- }, 8, ["nonce"])
716
- ], 64));
717
- }
718
- }), xe = /* @__PURE__ */ C({
719
- __name: "ScrollBar",
720
- props: {
721
- orientation: { default: "vertical" },
722
- forceMount: { type: Boolean },
723
- asChild: { type: Boolean },
724
- as: {},
725
- class: {}
726
- },
727
- setup(s) {
728
- const e = s, l = ee(e, "class");
729
- return (t, n) => (S(), g(r($e), _(r(l), {
730
- class: r(Q)(
731
- "flex touch-none select-none transition-colors",
732
- t.orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-px",
733
- t.orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-px",
734
- e.class
735
- )
736
- }), {
737
- default: m(() => [
738
- x(r(Re), { class: "relative flex-1 rounded-full bg-border" })
739
- ]),
740
- _: 1
741
- }, 16, ["class"]));
742
- }
743
- }), Ve = /* @__PURE__ */ C({
744
- __name: "ScrollArea",
745
- props: {
746
- type: {},
747
- dir: {},
748
- scrollHideDelay: {},
749
- asChild: { type: Boolean },
750
- as: { type: [String, Object, Function] },
751
- class: {}
752
- },
753
- setup(s) {
754
- const e = s, l = ee(e, "class");
755
- return (t, n) => (S(), g(r(he), _(r(l), {
756
- class: r(Q)("relative overflow-hidden", e.class)
757
- }), {
758
- default: m(() => [
759
- x(r(Te), { class: "h-full w-full rounded-[inherit]" }, {
760
- default: m(() => [
761
- w(t.$slots, "default")
762
- ]),
763
- _: 3
764
- }),
765
- x(xe),
766
- x(r(be))
767
- ]),
768
- _: 3
769
- }, 16, ["class"]));
770
- }
771
- });
772
- export {
773
- Ve as ScrollArea,
774
- xe as ScrollBar
775
- };