@wrdagency/blockout 0.0.19 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/2NBKRL7C-7XoDiJp9.js +85 -0
  2. package/dist/2RSXSRCN-qt84MtKs.js +61 -0
  3. package/dist/4CMBR7SL-BHIN8rB4.js +308 -0
  4. package/dist/5JTVDSTH-CG1NL6Fw.js +174 -0
  5. package/dist/5VQZOHHZ-CscZGerP.js +59 -0
  6. package/dist/6VRAQV3D-Clhw_nNS.js +201 -0
  7. package/dist/7PRQYBBV-91wrWGjk.js +17 -0
  8. package/dist/ArrowRight.es-xyNbtVOa.js +60 -0
  9. package/dist/DG5U6ZEL-CVj-Czp2.js +17 -0
  10. package/dist/F5MUBM3I-87B2_4WK.js +54 -0
  11. package/dist/LMDWO4NN--KEvZePp.js +610 -0
  12. package/dist/MTZPJQMC-DyCWBG18.js +14 -0
  13. package/dist/P7GR5CS5-BoOYUfSQ.js +19 -0
  14. package/dist/PFRGBC2K-BEg8ahbY.js +303 -0
  15. package/dist/RS7LB2H4-D0fWv5qu.js +15 -0
  16. package/dist/RZ4GPYOB-13-5LlEb.js +37 -0
  17. package/dist/S43UC3DV-Dn8EFLaT.js +22 -0
  18. package/dist/Square.es-KJLdY11q.js +72 -0
  19. package/dist/T7VMP3TM-DeRMoW8g.js +77 -0
  20. package/dist/TP7N7UIH-BHb1rEeb.js +34 -0
  21. package/dist/UQQRIHDV-Bu8e1bYU.js +69 -0
  22. package/dist/UYGDZTLQ-DcCmv5SE.js +12 -0
  23. package/dist/VIIRIBF3-D5DmZNtI.js +26 -0
  24. package/dist/WMYDSCNQ-DECXdiUT.js +1346 -0
  25. package/dist/WYCIER3C-8jmp2F15.js +175 -0
  26. package/dist/YV4JVR4I-LkUIiJWj.js +351 -0
  27. package/dist/assets/button.css +1 -1
  28. package/dist/assets/index.css +1 -1
  29. package/dist/assets/index10.css +1 -1
  30. package/dist/assets/index11.css +1 -1
  31. package/dist/assets/index12.css +1 -1
  32. package/dist/assets/index13.css +1 -1
  33. package/dist/assets/index14.css +1 -0
  34. package/dist/assets/index15.css +1 -0
  35. package/dist/assets/index16.css +1 -0
  36. package/dist/assets/index17.css +1 -0
  37. package/dist/assets/index18.css +1 -0
  38. package/dist/assets/index19.css +1 -0
  39. package/dist/assets/index2.css +1 -1
  40. package/dist/assets/index3.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index5.css +1 -1
  43. package/dist/assets/index6.css +1 -1
  44. package/dist/assets/index7.css +1 -1
  45. package/dist/assets/index8.css +1 -1
  46. package/dist/assets/index9.css +1 -1
  47. package/dist/assets/style.css +1 -1
  48. package/dist/assets/style2.css +1 -0
  49. package/dist/assets/style3.css +1 -0
  50. package/dist/assets/style4.css +1 -0
  51. package/dist/assets/styles.css +1 -1
  52. package/dist/components/block-editor/editor.d.ts +5 -0
  53. package/dist/components/block-editor/editor.js +6 -0
  54. package/dist/components/block-editor/index.d.ts +1 -0
  55. package/dist/components/block-editor/index.js +4 -0
  56. package/dist/components/breadcrumbs/index.js +87 -31
  57. package/dist/components/button/button.d.ts +1 -1
  58. package/dist/components/button/button.js +5 -5
  59. package/dist/components/button/icon.d.ts +1 -2
  60. package/dist/components/button/icon.js +10 -3
  61. package/dist/components/button/index.d.ts +4 -0
  62. package/dist/components/controls/base-control/affix.js +7 -7
  63. package/dist/components/controls/base-control/index.js +11 -11
  64. package/dist/components/controls/base-popover-control/index.d.ts +9 -0
  65. package/dist/components/controls/base-popover-control/index.js +47 -0
  66. package/dist/components/controls/checkbox-control/index.d.ts +8 -0
  67. package/dist/components/controls/checkbox-control/index.js +57 -0
  68. package/dist/components/controls/choice-control/choice.js +13 -11
  69. package/dist/components/controls/choice-control/index.js +1 -1
  70. package/dist/components/controls/index.d.ts +4 -1
  71. package/dist/components/controls/index.js +25 -16
  72. package/dist/components/controls/number-control/index.js +29 -27
  73. package/dist/components/controls/password-control/index.js +1 -1
  74. package/dist/components/controls/recurrence-control/index.d.ts +8 -0
  75. package/dist/components/controls/recurrence-control/index.js +208 -0
  76. package/dist/components/controls/select-control/component.d.ts +12 -0
  77. package/dist/components/controls/select-control/component.js +1879 -0
  78. package/dist/components/controls/select-control/index.d.ts +2 -12
  79. package/dist/components/controls/select-control/index.js +5 -1860
  80. package/dist/components/controls/select-control/options.d.ts +7 -0
  81. package/dist/components/controls/select-control/options.js +9 -0
  82. package/dist/components/controls/textarea-control/index.js +1 -1
  83. package/dist/components/controls/toggle-control/index.js +11 -9
  84. package/dist/components/controls/toggle-group-control/index.d.ts +19 -0
  85. package/dist/components/controls/toggle-group-control/index.js +50 -0
  86. package/dist/components/data-table/header.js +120 -171
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/filesystem/file.d.ts +7 -0
  89. package/dist/components/filesystem/file.js +44 -0
  90. package/dist/components/filesystem/folder.d.ts +6 -0
  91. package/dist/components/filesystem/folder.js +160 -0
  92. package/dist/components/filesystem/icon.d.ts +7 -0
  93. package/dist/components/filesystem/icon.js +908 -0
  94. package/dist/components/filesystem/index.js +14 -0
  95. package/dist/components/filesystem/list.d.ts +4 -0
  96. package/dist/components/filesystem/list.js +18 -0
  97. package/dist/components/filesystem/root.d.ts +3 -0
  98. package/dist/components/filesystem/root.js +7 -0
  99. package/dist/components/form/components/index.js +12 -12
  100. package/dist/components/form/components/pagination.js +23 -16
  101. package/dist/components/index.d.ts +5 -0
  102. package/dist/components/index.js +50 -31
  103. package/dist/components/markdown/{index.d.ts → editor/component.d.ts} +2 -2
  104. package/dist/components/markdown/editor/component.js +25583 -0
  105. package/dist/components/markdown/editor/index.d.ts +1 -0
  106. package/dist/components/markdown/editor/index.js +4 -0
  107. package/dist/components/markdown/formats.js +29 -27
  108. package/dist/components/markdown/index.js +5 -25842
  109. package/dist/components/markdown/prose.d.ts +3 -0
  110. package/dist/components/markdown/prose.js +15 -0
  111. package/dist/components/menu/index.js +24 -23
  112. package/dist/components/menu/item.js +1 -1
  113. package/dist/components/menu/items/action.js +1 -1
  114. package/dist/components/menu/items/spacer.js +14 -42
  115. package/dist/components/menu/items/submenu.js +2 -2
  116. package/dist/components/menu/items/toggle.js +25 -91
  117. package/dist/components/progress/index.js +1 -1
  118. package/dist/components/tabs/index.js +12 -0
  119. package/dist/components/tabs/list.d.ts +7 -0
  120. package/dist/components/tabs/list.js +42 -0
  121. package/dist/components/tabs/panel.d.ts +8 -0
  122. package/dist/components/tabs/panel.js +132 -0
  123. package/dist/components/tabs/root.d.ts +9 -0
  124. package/dist/components/tabs/root.js +173 -0
  125. package/dist/components/tabs/tab.d.ts +7 -0
  126. package/dist/components/tabs/tab.js +81 -0
  127. package/dist/components/toolbar/index.js +27 -0
  128. package/dist/components/toolbar/root.d.ts +6 -0
  129. package/dist/components/toolbar/root.js +6 -0
  130. package/dist/composite-provider-DxKEAxsZ.js +10 -0
  131. package/dist/floating-ui.dom-BqewRPVB.js +1124 -0
  132. package/dist/hooks/state.d.ts +4 -0
  133. package/dist/hooks/state.js +7 -0
  134. package/dist/hooks/theme.js +7 -38
  135. package/dist/index-1AjPIqTN.js +73 -0
  136. package/dist/index-B5y9bioP.js +258 -0
  137. package/dist/index-BI5rPXbu.js +391 -0
  138. package/dist/index.js +63 -40
  139. package/dist/{item-D9r2-3fk.js → item-BrZqCoM7.js} +240 -234
  140. package/dist/options-Cfoqhxw2.js +96 -0
  141. package/dist/primitives/index.d.ts +2 -0
  142. package/dist/primitives/index.js +4 -0
  143. package/dist/primitives/resizable/index.js +1 -1
  144. package/dist/primitives/scroll-area/index.d.ts +7 -0
  145. package/dist/primitives/scroll-area/index.js +545 -0
  146. package/dist/primitives/truncate/index.d.ts +7 -0
  147. package/dist/primitives/truncate/index.js +46 -0
  148. package/dist/primitives/visually-hidden/index.d.ts +2 -2
  149. package/dist/primitives/visually-hidden/index.js +13 -3
  150. package/dist/root-CdR32nP9.js +73 -0
  151. package/dist/tslib.es6-DN7pKd6F.js +44 -0
  152. package/dist/types/date.d.ts +39 -0
  153. package/dist/types/date.js +1749 -0
  154. package/dist/types/options.d.ts +8 -6
  155. package/dist/utils/components.d.ts +5 -0
  156. package/dist/utils/components.js +14 -0
  157. package/dist/utils/date.d.ts +1 -0
  158. package/dist/utils/date.js +15 -0
  159. package/dist/utils/string.d.ts +4 -0
  160. package/dist/utils/string.js +18 -0
  161. package/package.json +4 -1
  162. package/dist/2NBKRL7C-D-Q0qGRV.js +0 -81
  163. package/dist/P7GR5CS5-qyeuZVEs.js +0 -640
  164. package/dist/T7VMP3TM-BxgFbvdx.js +0 -2106
  165. package/dist/UQQRIHDV-BGs025hb.js +0 -1046
  166. package/dist/VIIRIBF3-D9clDhln.js +0 -21
  167. package/dist/floating-ui.dom-9sqP7IwC.js +0 -1512
@@ -0,0 +1,96 @@
1
+ import { Frequency as l, Weekday as e, Month as a } from "./types/date.js";
2
+ const u = [
3
+ { label: "Daily", value: l.Daily },
4
+ { label: "Weekly", value: l.Weekly },
5
+ { label: "Monthly", value: l.Monthly }
6
+ ], y = [
7
+ { label: "Day", value: l.Daily },
8
+ { label: "Week", value: l.Weekly },
9
+ { label: "Month", value: l.Monthly }
10
+ ], b = [
11
+ {
12
+ label: "Monday",
13
+ value: e.Monday
14
+ },
15
+ {
16
+ label: "Tuesday",
17
+ value: e.Tuesday
18
+ },
19
+ {
20
+ label: "Wednesday",
21
+ value: e.Wednesday
22
+ },
23
+ {
24
+ label: "Thursday",
25
+ value: e.Thursday
26
+ },
27
+ {
28
+ label: "Friday",
29
+ value: e.Friday
30
+ },
31
+ {
32
+ label: "Saturday",
33
+ value: e.Saturday
34
+ },
35
+ {
36
+ label: "Sunday",
37
+ value: e.Sunday
38
+ }
39
+ ], r = [
40
+ {
41
+ label: "Mo",
42
+ value: e.Monday
43
+ },
44
+ {
45
+ label: "Tu",
46
+ value: e.Tuesday
47
+ },
48
+ {
49
+ label: "We",
50
+ value: e.Wednesday
51
+ },
52
+ {
53
+ label: "Th",
54
+ value: e.Thursday
55
+ },
56
+ {
57
+ label: "Fr",
58
+ value: e.Friday
59
+ },
60
+ {
61
+ label: "Sa",
62
+ value: e.Saturday
63
+ },
64
+ {
65
+ label: "Su",
66
+ value: e.Sunday
67
+ }
68
+ ], v = [
69
+ { label: "January", value: a.January },
70
+ { label: "February", value: a.February },
71
+ { label: "March", value: a.March },
72
+ { label: "April", value: a.April },
73
+ { label: "May", value: a.May },
74
+ { label: "June", value: a.June },
75
+ { label: "July", value: a.July },
76
+ { label: "August", value: a.August },
77
+ { label: "September", value: a.September },
78
+ { label: "October", value: a.October },
79
+ { label: "November", value: a.November },
80
+ { label: "December", value: a.December }
81
+ ], o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
82
+ __proto__: null,
83
+ frequency: u,
84
+ frequencySingular: y,
85
+ months: v,
86
+ weekdays: b,
87
+ weekdaysShort: r
88
+ }, Symbol.toStringTag, { value: "Module" }));
89
+ export {
90
+ b as a,
91
+ u as b,
92
+ y as f,
93
+ v as m,
94
+ o,
95
+ r as w
96
+ };
@@ -1,3 +1,5 @@
1
1
  export { Draggable } from './draggable';
2
2
  export { Resizable } from './resizable';
3
+ export { ScrollArea } from './scroll-area';
4
+ export { Truncate } from './truncate';
3
5
  export { VisuallyHidden } from './visually-hidden';
@@ -1,8 +1,12 @@
1
1
  import { Draggable as o } from "./draggable/index.js";
2
2
  import { Resizable as l } from "./resizable/index.js";
3
+ import { ScrollArea as f } from "./scroll-area/index.js";
4
+ import { Truncate as p } from "./truncate/index.js";
3
5
  import { VisuallyHidden as i } from "./visually-hidden/index.js";
4
6
  export {
5
7
  o as Draggable,
6
8
  l as Resizable,
9
+ f as ScrollArea,
10
+ p as Truncate,
7
11
  i as VisuallyHidden
8
12
  };
@@ -2,7 +2,7 @@ import { jsxs as v, jsx as h } from "react/jsx-runtime";
2
2
  import { cn as g } from "../../utils/css.js";
3
3
  import { useRef as _, useState as z, useEffect as R } from "react";
4
4
  import { Draggable as d } from "../draggable/index.js";
5
- import '../../assets/style.css';/* empty css */
5
+ import '../../assets/style2.css';/* empty css */
6
6
  const B = ({
7
7
  as: c,
8
8
  axis: t = "both",
@@ -0,0 +1,7 @@
1
+ import { PolymorphicProps } from '../../types/component';
2
+ import { ElementType } from 'react';
3
+ interface ScrollAreaProps {
4
+ axis?: "both" | "y" | "x";
5
+ }
6
+ export declare const ScrollArea: <As extends ElementType = "div">({ as, axis, children, className, ...restProps }: PolymorphicProps<As, ScrollAreaProps>) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,545 @@
1
+ import { jsx as f, jsxs as q, Fragment as ie } from "react/jsx-runtime";
2
+ import { cn as se } from "../../utils/css.js";
3
+ import * as c from "react";
4
+ import { u as T, a as de, c as ue, P as x, b as I, d as R, e as C, f as he, g as fe } from "../../index-B5y9bioP.js";
5
+ import '../../assets/style3.css';/* empty css */
6
+ function be(e, t) {
7
+ return c.useReducer((r, l) => t[r][l] ?? r, e);
8
+ }
9
+ var V = "ScrollArea", [G, We] = ue(V), [me, p] = G(V), J = c.forwardRef(
10
+ (e, t) => {
11
+ const {
12
+ __scopeScrollArea: r,
13
+ type: l = "hover",
14
+ dir: o,
15
+ scrollHideDelay: n = 600,
16
+ ...a
17
+ } = e, [i, s] = c.useState(null), [h, d] = c.useState(null), [b, u] = c.useState(null), [m, v] = c.useState(null), [y, M] = c.useState(null), [P, L] = c.useState(0), [U, D] = c.useState(0), [N, _] = c.useState(!1), [W, H] = c.useState(!1), S = T(t, (E) => s(E)), w = de(o);
18
+ return /* @__PURE__ */ f(
19
+ me,
20
+ {
21
+ scope: r,
22
+ type: l,
23
+ dir: w,
24
+ scrollHideDelay: n,
25
+ scrollArea: i,
26
+ viewport: h,
27
+ onViewportChange: d,
28
+ content: b,
29
+ onContentChange: u,
30
+ scrollbarX: m,
31
+ onScrollbarXChange: v,
32
+ scrollbarXEnabled: N,
33
+ onScrollbarXEnabledChange: _,
34
+ scrollbarY: y,
35
+ onScrollbarYChange: M,
36
+ scrollbarYEnabled: W,
37
+ onScrollbarYEnabledChange: H,
38
+ onCornerWidthChange: L,
39
+ onCornerHeightChange: D,
40
+ children: /* @__PURE__ */ f(
41
+ x.div,
42
+ {
43
+ dir: w,
44
+ ...a,
45
+ ref: S,
46
+ style: {
47
+ position: "relative",
48
+ // Pass corner sizes as CSS vars to reduce re-renders of context consumers
49
+ "--radix-scroll-area-corner-width": P + "px",
50
+ "--radix-scroll-area-corner-height": U + "px",
51
+ ...e.style
52
+ }
53
+ }
54
+ )
55
+ }
56
+ );
57
+ }
58
+ );
59
+ J.displayName = V;
60
+ var K = "ScrollAreaViewport", Q = c.forwardRef(
61
+ (e, t) => {
62
+ const { __scopeScrollArea: r, children: l, nonce: o, ...n } = e, a = p(K, r), i = c.useRef(null), s = T(t, i, a.onViewportChange);
63
+ return /* @__PURE__ */ q(ie, { children: [
64
+ /* @__PURE__ */ f(
65
+ "style",
66
+ {
67
+ dangerouslySetInnerHTML: {
68
+ __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}"
69
+ },
70
+ nonce: o
71
+ }
72
+ ),
73
+ /* @__PURE__ */ f(
74
+ x.div,
75
+ {
76
+ "data-radix-scroll-area-viewport": "",
77
+ ...n,
78
+ ref: s,
79
+ style: {
80
+ /**
81
+ * We don't support `visible` because the intention is to have at least one scrollbar
82
+ * if this component is used and `visible` will behave like `auto` in that case
83
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
84
+ *
85
+ * We don't handle `auto` because the intention is for the native implementation
86
+ * to be hidden if using this component. We just want to ensure the node is scrollable
87
+ * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
88
+ * the browser from having to work out whether to render native scrollbars or not,
89
+ * we tell it to with the intention of hiding them in CSS.
90
+ */
91
+ overflowX: a.scrollbarXEnabled ? "scroll" : "hidden",
92
+ overflowY: a.scrollbarYEnabled ? "scroll" : "hidden",
93
+ ...e.style
94
+ },
95
+ children: /* @__PURE__ */ f("div", { ref: a.onContentChange, style: { minWidth: "100%", display: "table" }, children: l })
96
+ }
97
+ )
98
+ ] });
99
+ }
100
+ );
101
+ Q.displayName = K;
102
+ var g = "ScrollAreaScrollbar", Z = c.forwardRef(
103
+ (e, t) => {
104
+ const { forceMount: r, ...l } = e, o = p(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
105
+ return c.useEffect(() => (i ? n(!0) : a(!0), () => {
106
+ i ? n(!1) : a(!1);
107
+ }), [i, n, a]), o.type === "hover" ? /* @__PURE__ */ f(Se, { ...l, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ f(ve, { ...l, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ f(ee, { ...l, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ f(k, { ...l, ref: t }) : null;
108
+ }
109
+ );
110
+ Z.displayName = g;
111
+ var Se = c.forwardRef((e, t) => {
112
+ const { forceMount: r, ...l } = e, o = p(g, e.__scopeScrollArea), [n, a] = c.useState(!1);
113
+ return c.useEffect(() => {
114
+ const i = o.scrollArea;
115
+ let s = 0;
116
+ if (i) {
117
+ const h = () => {
118
+ window.clearTimeout(s), a(!0);
119
+ }, d = () => {
120
+ s = window.setTimeout(() => a(!1), o.scrollHideDelay);
121
+ };
122
+ return i.addEventListener("pointerenter", h), i.addEventListener("pointerleave", d), () => {
123
+ window.clearTimeout(s), i.removeEventListener("pointerenter", h), i.removeEventListener("pointerleave", d);
124
+ };
125
+ }
126
+ }, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ f(I, { present: r || n, children: /* @__PURE__ */ f(
127
+ ee,
128
+ {
129
+ "data-state": n ? "visible" : "hidden",
130
+ ...l,
131
+ ref: t
132
+ }
133
+ ) });
134
+ }), ve = c.forwardRef((e, t) => {
135
+ const { forceMount: r, ...l } = e, o = p(g, e.__scopeScrollArea), n = e.orientation === "horizontal", a = Y(() => s("SCROLL_END"), 100), [i, s] = be("hidden", {
136
+ hidden: {
137
+ SCROLL: "scrolling"
138
+ },
139
+ scrolling: {
140
+ SCROLL_END: "idle",
141
+ POINTER_ENTER: "interacting"
142
+ },
143
+ interacting: {
144
+ SCROLL: "interacting",
145
+ POINTER_LEAVE: "idle"
146
+ },
147
+ idle: {
148
+ HIDE: "hidden",
149
+ SCROLL: "scrolling",
150
+ POINTER_ENTER: "interacting"
151
+ }
152
+ });
153
+ return c.useEffect(() => {
154
+ if (i === "idle") {
155
+ const h = window.setTimeout(() => s("HIDE"), o.scrollHideDelay);
156
+ return () => window.clearTimeout(h);
157
+ }
158
+ }, [i, o.scrollHideDelay, s]), c.useEffect(() => {
159
+ const h = o.viewport, d = n ? "scrollLeft" : "scrollTop";
160
+ if (h) {
161
+ let b = h[d];
162
+ const u = () => {
163
+ const m = h[d];
164
+ b !== m && (s("SCROLL"), a()), b = m;
165
+ };
166
+ return h.addEventListener("scroll", u), () => h.removeEventListener("scroll", u);
167
+ }
168
+ }, [o.viewport, n, s, a]), /* @__PURE__ */ f(I, { present: r || i !== "hidden", children: /* @__PURE__ */ f(
169
+ k,
170
+ {
171
+ "data-state": i === "hidden" ? "hidden" : "visible",
172
+ ...l,
173
+ ref: t,
174
+ onPointerEnter: R(e.onPointerEnter, () => s("POINTER_ENTER")),
175
+ onPointerLeave: R(e.onPointerLeave, () => s("POINTER_LEAVE"))
176
+ }
177
+ ) });
178
+ }), ee = c.forwardRef((e, t) => {
179
+ const r = p(g, e.__scopeScrollArea), { forceMount: l, ...o } = e, [n, a] = c.useState(!1), i = e.orientation === "horizontal", s = Y(() => {
180
+ if (r.viewport) {
181
+ const h = r.viewport.offsetWidth < r.viewport.scrollWidth, d = r.viewport.offsetHeight < r.viewport.scrollHeight;
182
+ a(i ? h : d);
183
+ }
184
+ }, 10);
185
+ return A(r.viewport, s), A(r.content, s), /* @__PURE__ */ f(I, { present: l || n, children: /* @__PURE__ */ f(
186
+ k,
187
+ {
188
+ "data-state": n ? "visible" : "hidden",
189
+ ...o,
190
+ ref: t
191
+ }
192
+ ) });
193
+ }), k = c.forwardRef((e, t) => {
194
+ const { orientation: r = "vertical", ...l } = e, o = p(g, e.__scopeScrollArea), n = c.useRef(null), a = c.useRef(0), [i, s] = c.useState({
195
+ content: 0,
196
+ viewport: 0,
197
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
198
+ }), h = le(i.viewport, i.content), d = {
199
+ ...l,
200
+ sizes: i,
201
+ onSizesChange: s,
202
+ hasThumb: h > 0 && h < 1,
203
+ onThumbChange: (u) => n.current = u,
204
+ onThumbPointerUp: () => a.current = 0,
205
+ onThumbPointerDown: (u) => a.current = u
206
+ };
207
+ function b(u, m) {
208
+ return Re(u, a.current, i, m);
209
+ }
210
+ return r === "horizontal" ? /* @__PURE__ */ f(
211
+ pe,
212
+ {
213
+ ...d,
214
+ ref: t,
215
+ onThumbPositionChange: () => {
216
+ if (o.viewport && n.current) {
217
+ const u = o.viewport.scrollLeft, m = F(u, i, o.dir);
218
+ n.current.style.transform = `translate3d(${m}px, 0, 0)`;
219
+ }
220
+ },
221
+ onWheelScroll: (u) => {
222
+ o.viewport && (o.viewport.scrollLeft = u);
223
+ },
224
+ onDragScroll: (u) => {
225
+ o.viewport && (o.viewport.scrollLeft = b(u, o.dir));
226
+ }
227
+ }
228
+ ) : r === "vertical" ? /* @__PURE__ */ f(
229
+ we,
230
+ {
231
+ ...d,
232
+ ref: t,
233
+ onThumbPositionChange: () => {
234
+ if (o.viewport && n.current) {
235
+ const u = o.viewport.scrollTop, m = F(u, i);
236
+ n.current.style.transform = `translate3d(0, ${m}px, 0)`;
237
+ }
238
+ },
239
+ onWheelScroll: (u) => {
240
+ o.viewport && (o.viewport.scrollTop = u);
241
+ },
242
+ onDragScroll: (u) => {
243
+ o.viewport && (o.viewport.scrollTop = b(u));
244
+ }
245
+ }
246
+ ) : null;
247
+ }), pe = c.forwardRef((e, t) => {
248
+ const { sizes: r, onSizesChange: l, ...o } = e, n = p(g, e.__scopeScrollArea), [a, i] = c.useState(), s = c.useRef(null), h = T(t, s, n.onScrollbarXChange);
249
+ return c.useEffect(() => {
250
+ s.current && i(getComputedStyle(s.current));
251
+ }, [s]), /* @__PURE__ */ f(
252
+ oe,
253
+ {
254
+ "data-orientation": "horizontal",
255
+ ...o,
256
+ ref: h,
257
+ sizes: r,
258
+ style: {
259
+ bottom: 0,
260
+ left: n.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
261
+ right: n.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
262
+ "--radix-scroll-area-thumb-width": X(r) + "px",
263
+ ...e.style
264
+ },
265
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
266
+ onDragScroll: (d) => e.onDragScroll(d.x),
267
+ onWheelScroll: (d, b) => {
268
+ if (n.viewport) {
269
+ const u = n.viewport.scrollLeft + d.deltaX;
270
+ e.onWheelScroll(u), ae(u, b) && d.preventDefault();
271
+ }
272
+ },
273
+ onResize: () => {
274
+ s.current && n.viewport && a && l({
275
+ content: n.viewport.scrollWidth,
276
+ viewport: n.viewport.offsetWidth,
277
+ scrollbar: {
278
+ size: s.current.clientWidth,
279
+ paddingStart: O(a.paddingLeft),
280
+ paddingEnd: O(a.paddingRight)
281
+ }
282
+ });
283
+ }
284
+ }
285
+ );
286
+ }), we = c.forwardRef((e, t) => {
287
+ const { sizes: r, onSizesChange: l, ...o } = e, n = p(g, e.__scopeScrollArea), [a, i] = c.useState(), s = c.useRef(null), h = T(t, s, n.onScrollbarYChange);
288
+ return c.useEffect(() => {
289
+ s.current && i(getComputedStyle(s.current));
290
+ }, [s]), /* @__PURE__ */ f(
291
+ oe,
292
+ {
293
+ "data-orientation": "vertical",
294
+ ...o,
295
+ ref: h,
296
+ sizes: r,
297
+ style: {
298
+ top: 0,
299
+ right: n.dir === "ltr" ? 0 : void 0,
300
+ left: n.dir === "rtl" ? 0 : void 0,
301
+ bottom: "var(--radix-scroll-area-corner-height)",
302
+ "--radix-scroll-area-thumb-height": X(r) + "px",
303
+ ...e.style
304
+ },
305
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
306
+ onDragScroll: (d) => e.onDragScroll(d.y),
307
+ onWheelScroll: (d, b) => {
308
+ if (n.viewport) {
309
+ const u = n.viewport.scrollTop + d.deltaY;
310
+ e.onWheelScroll(u), ae(u, b) && d.preventDefault();
311
+ }
312
+ },
313
+ onResize: () => {
314
+ s.current && n.viewport && a && l({
315
+ content: n.viewport.scrollHeight,
316
+ viewport: n.viewport.offsetHeight,
317
+ scrollbar: {
318
+ size: s.current.clientHeight,
319
+ paddingStart: O(a.paddingTop),
320
+ paddingEnd: O(a.paddingBottom)
321
+ }
322
+ });
323
+ }
324
+ }
325
+ );
326
+ }), [ge, re] = G(g), oe = c.forwardRef((e, t) => {
327
+ const {
328
+ __scopeScrollArea: r,
329
+ sizes: l,
330
+ hasThumb: o,
331
+ onThumbChange: n,
332
+ onThumbPointerUp: a,
333
+ onThumbPointerDown: i,
334
+ onThumbPositionChange: s,
335
+ onDragScroll: h,
336
+ onWheelScroll: d,
337
+ onResize: b,
338
+ ...u
339
+ } = e, m = p(g, r), [v, y] = c.useState(null), M = T(t, (S) => y(S)), P = c.useRef(null), L = c.useRef(""), U = m.viewport, D = l.content - l.viewport, N = C(d), _ = C(s), W = Y(b, 10);
340
+ function H(S) {
341
+ if (P.current) {
342
+ const w = S.clientX - P.current.left, E = S.clientY - P.current.top;
343
+ h({ x: w, y: E });
344
+ }
345
+ }
346
+ return c.useEffect(() => {
347
+ const S = (w) => {
348
+ const E = w.target;
349
+ (v == null ? void 0 : v.contains(E)) && N(w, D);
350
+ };
351
+ return document.addEventListener("wheel", S, { passive: !1 }), () => document.removeEventListener("wheel", S, { passive: !1 });
352
+ }, [U, v, D, N]), c.useEffect(_, [l, _]), A(v, W), A(m.content, W), /* @__PURE__ */ f(
353
+ ge,
354
+ {
355
+ scope: r,
356
+ scrollbar: v,
357
+ hasThumb: o,
358
+ onThumbChange: C(n),
359
+ onThumbPointerUp: C(a),
360
+ onThumbPositionChange: _,
361
+ onThumbPointerDown: C(i),
362
+ children: /* @__PURE__ */ f(
363
+ x.div,
364
+ {
365
+ ...u,
366
+ ref: M,
367
+ style: { position: "absolute", ...u.style },
368
+ onPointerDown: R(e.onPointerDown, (S) => {
369
+ S.button === 0 && (S.target.setPointerCapture(S.pointerId), P.current = v.getBoundingClientRect(), L.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", m.viewport && (m.viewport.style.scrollBehavior = "auto"), H(S));
370
+ }),
371
+ onPointerMove: R(e.onPointerMove, H),
372
+ onPointerUp: R(e.onPointerUp, (S) => {
373
+ const w = S.target;
374
+ w.hasPointerCapture(S.pointerId) && w.releasePointerCapture(S.pointerId), document.body.style.webkitUserSelect = L.current, m.viewport && (m.viewport.style.scrollBehavior = ""), P.current = null;
375
+ })
376
+ }
377
+ )
378
+ }
379
+ );
380
+ }), z = "ScrollAreaThumb", te = c.forwardRef(
381
+ (e, t) => {
382
+ const { forceMount: r, ...l } = e, o = re(z, e.__scopeScrollArea);
383
+ return /* @__PURE__ */ f(I, { present: r || o.hasThumb, children: /* @__PURE__ */ f(Pe, { ref: t, ...l }) });
384
+ }
385
+ ), Pe = c.forwardRef(
386
+ (e, t) => {
387
+ const { __scopeScrollArea: r, style: l, ...o } = e, n = p(z, r), a = re(z, r), { onThumbPositionChange: i } = a, s = T(
388
+ t,
389
+ (b) => a.onThumbChange(b)
390
+ ), h = c.useRef(void 0), d = Y(() => {
391
+ h.current && (h.current(), h.current = void 0);
392
+ }, 100);
393
+ return c.useEffect(() => {
394
+ const b = n.viewport;
395
+ if (b) {
396
+ const u = () => {
397
+ if (d(), !h.current) {
398
+ const m = Ee(b, i);
399
+ h.current = m, i();
400
+ }
401
+ };
402
+ return i(), b.addEventListener("scroll", u), () => b.removeEventListener("scroll", u);
403
+ }
404
+ }, [n.viewport, d, i]), /* @__PURE__ */ f(
405
+ x.div,
406
+ {
407
+ "data-state": a.hasThumb ? "visible" : "hidden",
408
+ ...o,
409
+ ref: s,
410
+ style: {
411
+ width: "var(--radix-scroll-area-thumb-width)",
412
+ height: "var(--radix-scroll-area-thumb-height)",
413
+ ...l
414
+ },
415
+ onPointerDownCapture: R(e.onPointerDownCapture, (b) => {
416
+ const m = b.target.getBoundingClientRect(), v = b.clientX - m.left, y = b.clientY - m.top;
417
+ a.onThumbPointerDown({ x: v, y });
418
+ }),
419
+ onPointerUp: R(e.onPointerUp, a.onThumbPointerUp)
420
+ }
421
+ );
422
+ }
423
+ );
424
+ te.displayName = z;
425
+ var B = "ScrollAreaCorner", ne = c.forwardRef(
426
+ (e, t) => {
427
+ const r = p(B, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
428
+ return r.type !== "scroll" && l ? /* @__PURE__ */ f(Ce, { ...e, ref: t }) : null;
429
+ }
430
+ );
431
+ ne.displayName = B;
432
+ var Ce = c.forwardRef((e, t) => {
433
+ const { __scopeScrollArea: r, ...l } = e, o = p(B, r), [n, a] = c.useState(0), [i, s] = c.useState(0), h = !!(n && i);
434
+ return A(o.scrollbarX, () => {
435
+ var b;
436
+ const d = ((b = o.scrollbarX) == null ? void 0 : b.offsetHeight) || 0;
437
+ o.onCornerHeightChange(d), s(d);
438
+ }), A(o.scrollbarY, () => {
439
+ var b;
440
+ const d = ((b = o.scrollbarY) == null ? void 0 : b.offsetWidth) || 0;
441
+ o.onCornerWidthChange(d), a(d);
442
+ }), h ? /* @__PURE__ */ f(
443
+ x.div,
444
+ {
445
+ ...l,
446
+ ref: t,
447
+ style: {
448
+ width: n,
449
+ height: i,
450
+ position: "absolute",
451
+ right: o.dir === "ltr" ? 0 : void 0,
452
+ left: o.dir === "rtl" ? 0 : void 0,
453
+ bottom: 0,
454
+ ...e.style
455
+ }
456
+ }
457
+ ) : null;
458
+ });
459
+ function O(e) {
460
+ return e ? parseInt(e, 10) : 0;
461
+ }
462
+ function le(e, t) {
463
+ const r = e / t;
464
+ return isNaN(r) ? 0 : r;
465
+ }
466
+ function X(e) {
467
+ const t = le(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, l = (e.scrollbar.size - r) * t;
468
+ return Math.max(l, 18);
469
+ }
470
+ function Re(e, t, r, l = "ltr") {
471
+ const o = X(r), n = o / 2, a = t || n, i = o - a, s = r.scrollbar.paddingStart + a, h = r.scrollbar.size - r.scrollbar.paddingEnd - i, d = r.content - r.viewport, b = l === "ltr" ? [0, d] : [d * -1, 0];
472
+ return ce([s, h], b)(e);
473
+ }
474
+ function F(e, t, r = "ltr") {
475
+ const l = X(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, n = t.scrollbar.size - o, a = t.content - t.viewport, i = n - l, s = r === "ltr" ? [0, a] : [a * -1, 0], h = fe(e, s);
476
+ return ce([0, a], [0, i])(h);
477
+ }
478
+ function ce(e, t) {
479
+ return (r) => {
480
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
481
+ const l = (t[1] - t[0]) / (e[1] - e[0]);
482
+ return t[0] + l * (r - e[0]);
483
+ };
484
+ }
485
+ function ae(e, t) {
486
+ return e > 0 && e < t;
487
+ }
488
+ var Ee = (e, t = () => {
489
+ }) => {
490
+ let r = { left: e.scrollLeft, top: e.scrollTop }, l = 0;
491
+ return function o() {
492
+ const n = { left: e.scrollLeft, top: e.scrollTop }, a = r.left !== n.left, i = r.top !== n.top;
493
+ (a || i) && t(), r = n, l = window.requestAnimationFrame(o);
494
+ }(), () => window.cancelAnimationFrame(l);
495
+ };
496
+ function Y(e, t) {
497
+ const r = C(e), l = c.useRef(0);
498
+ return c.useEffect(() => () => window.clearTimeout(l.current), []), c.useCallback(() => {
499
+ window.clearTimeout(l.current), l.current = window.setTimeout(r, t);
500
+ }, [r, t]);
501
+ }
502
+ function A(e, t) {
503
+ const r = C(t);
504
+ he(() => {
505
+ let l = 0;
506
+ if (e) {
507
+ const o = new ResizeObserver(() => {
508
+ cancelAnimationFrame(l), l = window.requestAnimationFrame(r);
509
+ });
510
+ return o.observe(e), () => {
511
+ window.cancelAnimationFrame(l), o.unobserve(e);
512
+ };
513
+ }
514
+ }, [e, r]);
515
+ }
516
+ var Ae = J, Te = Q, $ = Z, j = te, ye = ne;
517
+ const He = ({
518
+ as: e,
519
+ axis: t = "both",
520
+ children: r,
521
+ className: l,
522
+ ...o
523
+ }) => /* @__PURE__ */ f(Ae, { asChild: !0, children: /* @__PURE__ */ q(e || "div", { className: se("primitive-scroll-area", l), ...o, children: [
524
+ /* @__PURE__ */ f(Te, { className: "primitive-scroll-area__viewport", children: r }),
525
+ t !== "y" && /* @__PURE__ */ f(
526
+ $,
527
+ {
528
+ className: "primitive-scroll-area__bar primitive-scroll-area__bar--x",
529
+ orientation: "horizontal",
530
+ children: /* @__PURE__ */ f(j, { className: "primitive-scroll-area__thumb" })
531
+ }
532
+ ),
533
+ t !== "x" && /* @__PURE__ */ f(
534
+ $,
535
+ {
536
+ className: "primitive-scroll-area__bar primitive-scroll-area__bar--y",
537
+ orientation: "vertical",
538
+ children: /* @__PURE__ */ f(j, { className: "primitive-scroll-area__thumb" })
539
+ }
540
+ ),
541
+ t === "both" && /* @__PURE__ */ f(ye, { className: "primitive-scroll-area__corner" })
542
+ ] }) });
543
+ export {
544
+ He as ScrollArea
545
+ };
@@ -0,0 +1,7 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface TruncateProps extends PropsWithChildren {
3
+ className?: string;
4
+ scrollOnHover?: boolean;
5
+ }
6
+ export declare const Truncate: FC<TruncateProps>;
7
+ export {};