@rockshin/tao-ui 0.0.57 → 0.0.58

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 (30) hide show
  1. package/dist/components/app/app-notices.js +10 -3
  2. package/dist/components/avatar/avatar.js +1 -1
  3. package/dist/components/badge/badge.js +2 -2
  4. package/dist/components/breadcrumb/breadcrumb.js +5 -1
  5. package/dist/components/calendar/calendar.js +4 -1
  6. package/dist/components/carousel/carousel.js +8 -2
  7. package/dist/components/collapse/collapse-panels.js +68 -67
  8. package/dist/components/date-picker/date-localization.js +12 -14
  9. package/dist/components/divider/divider.js +1 -1
  10. package/dist/components/float-button/float-button.js +7 -5
  11. package/dist/components/image/image.js +135 -143
  12. package/dist/components/input/otp.js +6 -0
  13. package/dist/components/input/search.js +7 -5
  14. package/dist/components/list/list.js +106 -105
  15. package/dist/components/masonry/masonry.js +1 -1
  16. package/dist/components/pagination/pagination.d.ts +2 -0
  17. package/dist/components/pagination/pagination.js +4 -0
  18. package/dist/components/rate/rate.js +83 -72
  19. package/dist/components/scroll-area/scroll-area.css +1 -1
  20. package/dist/components/scroll-area/scroll-area.js +294 -222
  21. package/dist/components/select/use-select-selection.d.ts +1 -1
  22. package/dist/components/select/use-select-selection.js +60 -53
  23. package/dist/components/statistic/statistic.js +84 -78
  24. package/dist/components/steps/steps.js +1 -1
  25. package/dist/components/table/table.js +4 -1
  26. package/dist/components/upload/upload.js +2 -2
  27. package/dist/number-input/cursor.js +20 -8
  28. package/dist/number-input/format.js +12 -4
  29. package/dist/number-input/use-number-input.js +4 -1
  30. package/package.json +1 -1
@@ -5,8 +5,10 @@ import { useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
5
5
  import { getScrollLeft, setScrollLeft } from "../../utils/scroll-left.js";
6
6
  import { cx } from "../../utils/semantic.js";
7
7
  import "./scroll-area.css";
8
+ const scrollIdleDelay = 600;
9
+ const keyboardScrollStep = 40;
8
10
  function ScrollArea(t0) {
9
- const $ = c(84);
11
+ const $ = c(90);
10
12
  const { children, type: t1, direction: t2, maxHeight, maxWidth, scrollbarSize: t3, scrollbarOffset: t4, scrollShadow: t5, onScroll: onScrollProp, onScrollEnd, scrollEndThreshold: t6, className, style, classNames, styles } = t0;
11
13
  const type = void 0 === t1 ? "hover" : t1;
12
14
  const direction = void 0 === t2 ? "vertical" : t2;
@@ -15,6 +17,8 @@ function ScrollArea(t0) {
15
17
  const scrollShadow = void 0 === t5 ? false : t5;
16
18
  const scrollEndThreshold = void 0 === t6 ? 10 : t6;
17
19
  const viewportRef = useRef(null);
20
+ const showVertical = "horizontal" !== direction;
21
+ const showHorizontal = "vertical" !== direction;
18
22
  let t7;
19
23
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20
24
  t7 = {
@@ -36,15 +40,29 @@ function ScrollArea(t0) {
36
40
  const { locale } = useTaoConfig();
37
41
  const firedScrollEnd = useRef(false);
38
42
  const lastScrollTop = useRef(0);
43
+ const [scrolling, setScrolling] = useState(false);
44
+ const scrollTimer = useRef(void 0);
39
45
  let t8;
40
- if ($[1] !== direction || $[2] !== scrollEndThreshold || $[3] !== textDirection) {
41
- t8 = ()=>{
46
+ let t9;
47
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
48
+ t8 = ()=>()=>clearTimeout(scrollTimer.current);
49
+ t9 = [];
50
+ $[1] = t8;
51
+ $[2] = t9;
52
+ } else {
53
+ t8 = $[1];
54
+ t9 = $[2];
55
+ }
56
+ useEffect(t8, t9);
57
+ let t10;
58
+ if ($[3] !== scrollEndThreshold || $[4] !== showHorizontal || $[5] !== showVertical || $[6] !== textDirection) {
59
+ t10 = ()=>{
42
60
  const el = viewportRef.current;
43
61
  if (!el) return;
44
62
  const { scrollTop, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
45
63
  const scrollLeft = getScrollLeft(el, getComputedStyle(el).direction || textDirection);
46
- const hasV = scrollHeight > clientHeight + 1;
47
- const hasH = scrollWidth > clientWidth + 1;
64
+ const hasV = showVertical && scrollHeight > clientHeight + 1;
65
+ const hasH = showHorizontal && scrollWidth > clientWidth + 1;
48
66
  setScrollState({
49
67
  hasVertical: hasV,
50
68
  hasHorizontal: hasH,
@@ -57,20 +75,21 @@ function ScrollArea(t0) {
57
75
  atLeft: scrollLeft <= 1,
58
76
  atRight: scrollLeft + clientWidth >= scrollWidth - 1
59
77
  });
60
- const nearBottom = "horizontal" !== direction && scrollHeight > clientHeight && scrollTop + clientHeight >= scrollHeight - scrollEndThreshold;
78
+ const nearBottom = showVertical && scrollHeight > clientHeight && scrollTop + clientHeight >= scrollHeight - scrollEndThreshold;
61
79
  if (!nearBottom) firedScrollEnd.current = false;
62
80
  return nearBottom;
63
81
  };
64
- $[1] = direction;
65
- $[2] = scrollEndThreshold;
66
- $[3] = textDirection;
67
- $[4] = t8;
68
- } else t8 = $[4];
69
- const updateScrollState = t8;
70
- let t10;
71
- let t9;
72
- if ($[5] !== updateScrollState) {
73
- t9 = ()=>{
82
+ $[3] = scrollEndThreshold;
83
+ $[4] = showHorizontal;
84
+ $[5] = showVertical;
85
+ $[6] = textDirection;
86
+ $[7] = t10;
87
+ } else t10 = $[7];
88
+ const updateScrollState = t10;
89
+ let t11;
90
+ let t12;
91
+ if ($[8] !== updateScrollState) {
92
+ t11 = ()=>{
74
93
  const el_0 = viewportRef.current;
75
94
  if (!el_0) return;
76
95
  const observer = new ResizeObserver(updateScrollState);
@@ -90,61 +109,111 @@ function ScrollArea(t0) {
90
109
  observer.disconnect();
91
110
  };
92
111
  };
93
- t10 = [
112
+ t12 = [
94
113
  updateScrollState
95
114
  ];
96
- $[5] = updateScrollState;
97
- $[6] = t10;
98
- $[7] = t9;
115
+ $[8] = updateScrollState;
116
+ $[9] = t11;
117
+ $[10] = t12;
99
118
  } else {
100
- t10 = $[6];
101
- t9 = $[7];
119
+ t11 = $[9];
120
+ t12 = $[10];
102
121
  }
103
- useEffect(t9, t10);
104
- let t11;
105
- if ($[8] !== onScrollEnd || $[9] !== onScrollProp || $[10] !== updateScrollState) {
106
- t11 = (e)=>{
122
+ useEffect(t11, t12);
123
+ let t13;
124
+ if ($[11] !== onScrollEnd || $[12] !== onScrollProp || $[13] !== type || $[14] !== updateScrollState) {
125
+ t13 = (e)=>{
107
126
  const scrollTop_0 = e.currentTarget.scrollTop;
108
127
  const movedVertically = scrollTop_0 !== lastScrollTop.current;
109
128
  lastScrollTop.current = scrollTop_0;
110
129
  const nearBottom_0 = updateScrollState();
130
+ if ("auto" === type || "scroll" === type) {
131
+ setScrolling(true);
132
+ clearTimeout(scrollTimer.current);
133
+ scrollTimer.current = setTimeout(()=>setScrolling(false), scrollIdleDelay);
134
+ }
111
135
  onScrollProp?.(e);
112
136
  if (onScrollEnd && movedVertically && nearBottom_0 && !firedScrollEnd.current) {
113
137
  firedScrollEnd.current = true;
114
138
  onScrollEnd();
115
139
  }
116
140
  };
117
- $[8] = onScrollEnd;
118
- $[9] = onScrollProp;
119
- $[10] = updateScrollState;
120
- $[11] = t11;
121
- } else t11 = $[11];
122
- const handleScroll = t11;
141
+ $[11] = onScrollEnd;
142
+ $[12] = onScrollProp;
143
+ $[13] = type;
144
+ $[14] = updateScrollState;
145
+ $[15] = t13;
146
+ } else t13 = $[15];
147
+ const handleScroll = t13;
148
+ let t14;
149
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
150
+ t14 = (axis, event)=>{
151
+ const viewport = viewportRef.current;
152
+ if (!viewport || event.defaultPrevented) return;
153
+ const vertical = "y" === axis;
154
+ const current = vertical ? viewport.scrollTop : getScrollLeft(viewport);
155
+ const page = vertical ? viewport.clientHeight : viewport.clientWidth;
156
+ const limit = (vertical ? viewport.scrollHeight : viewport.scrollWidth) - page;
157
+ const previous = vertical ? "ArrowUp" : "ArrowLeft";
158
+ const next = vertical ? "ArrowDown" : "ArrowRight";
159
+ let position;
160
+ switch(event.key){
161
+ case previous:
162
+ position = current - keyboardScrollStep;
163
+ break;
164
+ case next:
165
+ position = current + keyboardScrollStep;
166
+ break;
167
+ case "PageUp":
168
+ position = current - page;
169
+ break;
170
+ case "PageDown":
171
+ case "Enter":
172
+ case " ":
173
+ position = current + page;
174
+ break;
175
+ case "Home":
176
+ position = 0;
177
+ break;
178
+ case "End":
179
+ position = limit;
180
+ break;
181
+ default:
182
+ return;
183
+ }
184
+ event.preventDefault();
185
+ const offset = Math.max(0, Math.min(limit, position));
186
+ if (vertical) viewport.scrollTop = offset;
187
+ else setScrollLeft(viewport, offset);
188
+ };
189
+ $[16] = t14;
190
+ } else t14 = $[16];
191
+ const handleTrackKeyDown = t14;
123
192
  const activeDrag = useRef(null);
124
- let t12;
125
- let t13;
126
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
127
- t12 = ()=>()=>activeDrag.current?.cleanup();
128
- t13 = [];
129
- $[12] = t12;
130
- $[13] = t13;
193
+ let t15;
194
+ let t16;
195
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
196
+ t15 = ()=>()=>activeDrag.current?.cleanup();
197
+ t16 = [];
198
+ $[17] = t15;
199
+ $[18] = t16;
131
200
  } else {
132
- t12 = $[12];
133
- t13 = $[13];
201
+ t15 = $[17];
202
+ t16 = $[18];
134
203
  }
135
- useEffect(t12, t13);
136
- let t14;
137
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
138
- t14 = ()=>{
204
+ useEffect(t15, t16);
205
+ let t17;
206
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
207
+ t17 = ()=>{
139
208
  const drag = activeDrag.current;
140
209
  if (drag && !viewportRef.current?.parentElement?.contains(drag.thumb)) drag.cleanup();
141
210
  };
142
- $[14] = t14;
143
- } else t14 = $[14];
144
- useEffect(t14);
145
- let t15;
146
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
147
- t15 = (axis, e_0)=>{
211
+ $[19] = t17;
212
+ } else t17 = $[19];
213
+ useEffect(t17);
214
+ let t18;
215
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
216
+ t18 = (axis_0, e_0)=>{
148
217
  if (0 !== e_0.button) return;
149
218
  e_0.preventDefault();
150
219
  e_0.stopPropagation();
@@ -155,20 +224,20 @@ function ScrollArea(t0) {
155
224
  const ownerDocument = thumb.ownerDocument;
156
225
  const track = thumb.parentElement;
157
226
  if (!track) return;
158
- const pos = "y" === axis ? e_0.clientY : e_0.clientX;
159
- const scroll = "y" === axis ? el_1.scrollTop : getScrollLeft(el_1);
227
+ const pos = "y" === axis_0 ? e_0.clientY : e_0.clientX;
228
+ const scroll = "y" === axis_0 ? el_1.scrollTop : getScrollLeft(el_1);
160
229
  const pointerId = e_0.pointerId;
161
230
  const handleMove = (ev)=>{
162
231
  if (ev.pointerId !== pointerId || !viewportRef.current) return;
163
- const delta = ("y" === axis ? ev.clientY : ev.clientX) - pos;
232
+ const delta = ("y" === axis_0 ? ev.clientY : ev.clientX) - pos;
164
233
  const vp = viewportRef.current;
165
234
  const trackRect = track.getBoundingClientRect();
166
235
  const thumbRect = thumb.getBoundingClientRect();
167
- const travel = "y" === axis ? trackRect.height - thumbRect.height : trackRect.width - thumbRect.width;
168
- const maxScroll = "y" === axis ? vp.scrollHeight - vp.clientHeight : vp.scrollWidth - vp.clientWidth;
236
+ const travel = "y" === axis_0 ? trackRect.height - thumbRect.height : trackRect.width - thumbRect.width;
237
+ const maxScroll = "y" === axis_0 ? vp.scrollHeight - vp.clientHeight : vp.scrollWidth - vp.clientWidth;
169
238
  if (travel <= 0 || maxScroll <= 0) return;
170
239
  const nextScroll = Math.max(0, Math.min(maxScroll, scroll + delta / travel * maxScroll));
171
- if ("y" === axis) vp.scrollTop = nextScroll;
240
+ if ("y" === axis_0) vp.scrollTop = nextScroll;
172
241
  else setScrollLeft(vp, nextScroll);
173
242
  };
174
243
  const cleanup = ()=>{
@@ -188,120 +257,119 @@ function ScrollArea(t0) {
188
257
  ownerDocument.addEventListener("pointerup", handleEnd);
189
258
  ownerDocument.addEventListener("pointercancel", handleEnd);
190
259
  };
191
- $[15] = t15;
192
- } else t15 = $[15];
193
- const handleThumbPointerDown = t15;
194
- let t16;
195
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
196
- t16 = (axis_0, e_1)=>{
260
+ $[20] = t18;
261
+ } else t18 = $[20];
262
+ const handleThumbPointerDown = t18;
263
+ let t19;
264
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
265
+ t19 = (axis_1, e_1)=>{
197
266
  const el_2 = viewportRef.current;
198
267
  if (!el_2) return;
199
268
  if (e_1.target.hasAttribute("data-tao-scroll-thumb")) return;
200
269
  const rect = e_1.currentTarget.getBoundingClientRect();
201
- const trackSize = "y" === axis_0 ? rect.height : rect.width;
270
+ const trackSize = "y" === axis_1 ? rect.height : rect.width;
202
271
  if (trackSize <= 0) return;
203
- const clickPos = ("y" === axis_0 ? e_1.clientY - rect.top : e_1.clientX - rect.left) / trackSize;
204
- if ("y" === axis_0) el_2.scrollTop = clickPos * (el_2.scrollHeight - el_2.clientHeight);
272
+ const clickPos = ("y" === axis_1 ? e_1.clientY - rect.top : e_1.clientX - rect.left) / trackSize;
273
+ if ("y" === axis_1) el_2.scrollTop = clickPos * (el_2.scrollHeight - el_2.clientHeight);
205
274
  else setScrollLeft(el_2, clickPos * (el_2.scrollWidth - el_2.clientWidth));
206
275
  };
207
- $[16] = t16;
208
- } else t16 = $[16];
209
- const handleTrackClick = t16;
210
- const showVertical = "vertical" === direction || "both" === direction;
211
- const showHorizontal = "horizontal" === direction || "both" === direction;
212
- const t17 = maxHeight ?? void 0;
213
- const t18 = maxWidth ?? void 0;
214
- let t19;
215
- if ($[17] !== t17 || $[18] !== t18) {
216
- t19 = {
217
- maxHeight: t17,
218
- maxWidth: t18
219
- };
220
- $[17] = t17;
221
- $[18] = t18;
222
- $[19] = t19;
223
- } else t19 = $[19];
224
- const rootStyle = t19;
225
- const t20 = showVertical ? "scroll" : "hidden";
226
- const t21 = showHorizontal ? "scroll" : "hidden";
227
- const t22 = styles?.viewport;
228
- let t23;
229
- if ($[20] !== t20 || $[21] !== t21 || $[22] !== t22) {
230
- t23 = {
231
- overflowY: t20,
232
- overflowX: t21,
233
- ...t22
276
+ $[21] = t19;
277
+ } else t19 = $[21];
278
+ const handleTrackClick = t19;
279
+ const t20 = maxHeight ?? void 0;
280
+ const t21 = maxWidth ?? void 0;
281
+ let t22;
282
+ if ($[22] !== t20 || $[23] !== t21) {
283
+ t22 = {
284
+ maxHeight: t20,
285
+ maxWidth: t21
234
286
  };
235
- $[20] = t20;
236
- $[21] = t21;
237
- $[22] = t22;
238
- $[23] = t23;
239
- } else t23 = $[23];
240
- const viewportStyle = t23;
241
- const t24 = `${scrollbarSize}px`;
242
- const t25 = `${scrollbarOffset}px`;
287
+ $[22] = t20;
288
+ $[23] = t21;
289
+ $[24] = t22;
290
+ } else t22 = $[24];
291
+ const rootStyle = t22;
292
+ const t23 = showVertical ? "scroll" : "hidden";
293
+ const t24 = showHorizontal ? "scroll" : "hidden";
294
+ const t25 = styles?.viewport;
243
295
  let t26;
244
- if ($[24] !== t24 || $[25] !== t25) {
296
+ if ($[25] !== t23 || $[26] !== t24 || $[27] !== t25) {
245
297
  t26 = {
246
- "--tao-scrollbar-size": t24,
247
- "--tao-scrollbar-offset": t25
298
+ overflowY: t23,
299
+ overflowX: t24,
300
+ ...t25
248
301
  };
249
- $[24] = t24;
250
- $[25] = t25;
251
- $[26] = t26;
252
- } else t26 = $[26];
253
- const scrollbarVars = t26;
254
- const t27 = scrollState.hasVertical || void 0;
255
- const t28 = scrollState.hasHorizontal || void 0;
256
- const t29 = classNames?.root;
257
- let t30;
258
- if ($[27] !== className || $[28] !== t29) {
259
- t30 = cx(t29, className);
260
- $[27] = className;
261
- $[28] = t29;
262
- $[29] = t30;
263
- } else t30 = $[29];
264
- const t31 = styles?.root;
265
- let t32;
266
- if ($[30] !== rootStyle || $[31] !== scrollbarVars || $[32] !== style || $[33] !== t31) {
267
- t32 = {
302
+ $[25] = t23;
303
+ $[26] = t24;
304
+ $[27] = t25;
305
+ $[28] = t26;
306
+ } else t26 = $[28];
307
+ const viewportStyle = t26;
308
+ const t27 = `${scrollbarSize}px`;
309
+ const t28 = `${scrollbarOffset}px`;
310
+ let t29;
311
+ if ($[29] !== t27 || $[30] !== t28) {
312
+ t29 = {
313
+ "--tao-scrollbar-size": t27,
314
+ "--tao-scrollbar-offset": t28
315
+ };
316
+ $[29] = t27;
317
+ $[30] = t28;
318
+ $[31] = t29;
319
+ } else t29 = $[31];
320
+ const scrollbarVars = t29;
321
+ const t30 = scrolling || void 0;
322
+ const t31 = scrollState.hasVertical || void 0;
323
+ const t32 = scrollState.hasHorizontal || void 0;
324
+ const t33 = classNames?.root;
325
+ let t34;
326
+ if ($[32] !== className || $[33] !== t33) {
327
+ t34 = cx(t33, className);
328
+ $[32] = className;
329
+ $[33] = t33;
330
+ $[34] = t34;
331
+ } else t34 = $[34];
332
+ const t35 = styles?.root;
333
+ let t36;
334
+ if ($[35] !== rootStyle || $[36] !== scrollbarVars || $[37] !== style || $[38] !== t35) {
335
+ t36 = {
268
336
  ...rootStyle,
269
337
  ...scrollbarVars,
270
- ...t31,
338
+ ...t35,
271
339
  ...style
272
340
  };
273
- $[30] = rootStyle;
274
- $[31] = scrollbarVars;
275
- $[32] = style;
276
- $[33] = t31;
277
- $[34] = t32;
278
- } else t32 = $[34];
279
- const t33 = classNames?.viewport;
280
- let t34;
281
- if ($[35] !== t33) {
282
- t34 = cx(t33);
283
- $[35] = t33;
284
- $[36] = t34;
285
- } else t34 = $[36];
286
- let t35;
287
- if ($[37] !== children || $[38] !== handleScroll || $[39] !== t34 || $[40] !== viewportStyle) {
288
- t35 = /*#__PURE__*/ jsx("div", {
341
+ $[35] = rootStyle;
342
+ $[36] = scrollbarVars;
343
+ $[37] = style;
344
+ $[38] = t35;
345
+ $[39] = t36;
346
+ } else t36 = $[39];
347
+ const t37 = classNames?.viewport;
348
+ let t38;
349
+ if ($[40] !== t37) {
350
+ t38 = cx(t37);
351
+ $[40] = t37;
352
+ $[41] = t38;
353
+ } else t38 = $[41];
354
+ let t39;
355
+ if ($[42] !== children || $[43] !== handleScroll || $[44] !== t38 || $[45] !== viewportStyle) {
356
+ t39 = /*#__PURE__*/ jsx("div", {
289
357
  ref: viewportRef,
290
358
  "data-tao-scroll-viewport": "",
291
- className: t34,
359
+ className: t38,
292
360
  style: viewportStyle,
293
361
  onScroll: handleScroll,
294
362
  children: children
295
363
  });
296
- $[37] = children;
297
- $[38] = handleScroll;
298
- $[39] = t34;
299
- $[40] = viewportStyle;
300
- $[41] = t35;
301
- } else t35 = $[41];
302
- let t36;
303
- if ($[42] !== scrollShadow || $[43] !== scrollState.atBottom || $[44] !== scrollState.atTop || $[45] !== showVertical) {
304
- t36 = scrollShadow && showVertical && /*#__PURE__*/ jsxs(Fragment, {
364
+ $[42] = children;
365
+ $[43] = handleScroll;
366
+ $[44] = t38;
367
+ $[45] = viewportStyle;
368
+ $[46] = t39;
369
+ } else t39 = $[46];
370
+ let t40;
371
+ if ($[47] !== scrollShadow || $[48] !== scrollState.atBottom || $[49] !== scrollState.atTop || $[50] !== showVertical) {
372
+ t40 = scrollShadow && showVertical && /*#__PURE__*/ jsxs(Fragment, {
305
373
  children: [
306
374
  /*#__PURE__*/ jsx("div", {
307
375
  "data-tao-scroll-shadow": "top",
@@ -313,15 +381,15 @@ function ScrollArea(t0) {
313
381
  })
314
382
  ]
315
383
  });
316
- $[42] = scrollShadow;
317
- $[43] = scrollState.atBottom;
318
- $[44] = scrollState.atTop;
319
- $[45] = showVertical;
320
- $[46] = t36;
321
- } else t36 = $[46];
322
- let t37;
323
- if ($[47] !== scrollShadow || $[48] !== scrollState.atLeft || $[49] !== scrollState.atRight || $[50] !== showHorizontal) {
324
- t37 = scrollShadow && showHorizontal && /*#__PURE__*/ jsxs(Fragment, {
384
+ $[47] = scrollShadow;
385
+ $[48] = scrollState.atBottom;
386
+ $[49] = scrollState.atTop;
387
+ $[50] = showVertical;
388
+ $[51] = t40;
389
+ } else t40 = $[51];
390
+ let t41;
391
+ if ($[52] !== scrollShadow || $[53] !== scrollState.atLeft || $[54] !== scrollState.atRight || $[55] !== showHorizontal) {
392
+ t41 = scrollShadow && showHorizontal && /*#__PURE__*/ jsxs(Fragment, {
325
393
  children: [
326
394
  /*#__PURE__*/ jsx("div", {
327
395
  "data-tao-scroll-shadow": "left",
@@ -333,15 +401,15 @@ function ScrollArea(t0) {
333
401
  })
334
402
  ]
335
403
  });
336
- $[47] = scrollShadow;
337
- $[48] = scrollState.atLeft;
338
- $[49] = scrollState.atRight;
339
- $[50] = showHorizontal;
340
- $[51] = t37;
341
- } else t37 = $[51];
342
- let t38;
343
- if ($[52] !== classNames?.scrollbar || $[53] !== classNames?.thumb || $[54] !== locale || $[55] !== scrollState.hasVertical || $[56] !== scrollState.thumbYOffset || $[57] !== scrollState.thumbYRatio || $[58] !== showVertical || $[59] !== styles?.scrollbar || $[60] !== styles?.thumb) {
344
- t38 = showVertical && scrollState.hasVertical && /*#__PURE__*/ jsx("button", {
404
+ $[52] = scrollShadow;
405
+ $[53] = scrollState.atLeft;
406
+ $[54] = scrollState.atRight;
407
+ $[55] = showHorizontal;
408
+ $[56] = t41;
409
+ } else t41 = $[56];
410
+ let t42;
411
+ if ($[57] !== classNames?.scrollbar || $[58] !== classNames?.thumb || $[59] !== locale || $[60] !== scrollState.hasVertical || $[61] !== scrollState.thumbYOffset || $[62] !== scrollState.thumbYRatio || $[63] !== showVertical || $[64] !== styles?.scrollbar || $[65] !== styles?.thumb) {
412
+ t42 = showVertical && scrollState.hasVertical && /*#__PURE__*/ jsx("button", {
345
413
  type: "button",
346
414
  "data-tao-scrollbar": "",
347
415
  "data-tao-orientation": "vertical",
@@ -349,6 +417,7 @@ function ScrollArea(t0) {
349
417
  className: cx(classNames?.scrollbar),
350
418
  style: styles?.scrollbar,
351
419
  onClick: (e_2)=>handleTrackClick("y", e_2),
420
+ onKeyDown: (e_3)=>handleTrackKeyDown("y", e_3),
352
421
  children: /*#__PURE__*/ jsx("div", {
353
422
  "data-tao-scroll-thumb": "",
354
423
  "data-tao-orientation": "vertical",
@@ -359,30 +428,31 @@ function ScrollArea(t0) {
359
428
  transform: `translateY(-${100 * scrollState.thumbYOffset}%)`,
360
429
  ...styles?.thumb
361
430
  },
362
- onPointerDown: (e_3)=>handleThumbPointerDown("y", e_3)
431
+ onPointerDown: (e_4)=>handleThumbPointerDown("y", e_4)
363
432
  })
364
433
  });
365
- $[52] = classNames?.scrollbar;
366
- $[53] = classNames?.thumb;
367
- $[54] = locale;
368
- $[55] = scrollState.hasVertical;
369
- $[56] = scrollState.thumbYOffset;
370
- $[57] = scrollState.thumbYRatio;
371
- $[58] = showVertical;
372
- $[59] = styles?.scrollbar;
373
- $[60] = styles?.thumb;
374
- $[61] = t38;
375
- } else t38 = $[61];
376
- let t39;
377
- if ($[62] !== classNames?.scrollbar || $[63] !== classNames?.thumb || $[64] !== locale || $[65] !== scrollState.hasHorizontal || $[66] !== scrollState.thumbXOffset || $[67] !== scrollState.thumbXRatio || $[68] !== showHorizontal || $[69] !== styles?.scrollbar || $[70] !== styles?.thumb) {
378
- t39 = showHorizontal && scrollState.hasHorizontal && /*#__PURE__*/ jsx("button", {
434
+ $[57] = classNames?.scrollbar;
435
+ $[58] = classNames?.thumb;
436
+ $[59] = locale;
437
+ $[60] = scrollState.hasVertical;
438
+ $[61] = scrollState.thumbYOffset;
439
+ $[62] = scrollState.thumbYRatio;
440
+ $[63] = showVertical;
441
+ $[64] = styles?.scrollbar;
442
+ $[65] = styles?.thumb;
443
+ $[66] = t42;
444
+ } else t42 = $[66];
445
+ let t43;
446
+ if ($[67] !== classNames?.scrollbar || $[68] !== classNames?.thumb || $[69] !== locale || $[70] !== scrollState.hasHorizontal || $[71] !== scrollState.thumbXOffset || $[72] !== scrollState.thumbXRatio || $[73] !== showHorizontal || $[74] !== styles?.scrollbar || $[75] !== styles?.thumb) {
447
+ t43 = showHorizontal && scrollState.hasHorizontal && /*#__PURE__*/ jsx("button", {
379
448
  type: "button",
380
449
  "data-tao-scrollbar": "",
381
450
  "data-tao-orientation": "horizontal",
382
451
  "aria-label": locale.messages.scrollHorizontally,
383
452
  className: cx(classNames?.scrollbar),
384
453
  style: styles?.scrollbar,
385
- onClick: (e_4)=>handleTrackClick("x", e_4),
454
+ onClick: (e_5)=>handleTrackClick("x", e_5),
455
+ onKeyDown: (e_6)=>handleTrackKeyDown("x", e_6),
386
456
  children: /*#__PURE__*/ jsx("div", {
387
457
  "data-tao-scroll-thumb": "",
388
458
  "data-tao-orientation": "horizontal",
@@ -393,51 +463,53 @@ function ScrollArea(t0) {
393
463
  transform: `translateX(-${100 * scrollState.thumbXOffset}%)`,
394
464
  ...styles?.thumb
395
465
  },
396
- onPointerDown: (e_5)=>handleThumbPointerDown("x", e_5)
466
+ onPointerDown: (e_7)=>handleThumbPointerDown("x", e_7)
397
467
  })
398
468
  });
399
- $[62] = classNames?.scrollbar;
400
- $[63] = classNames?.thumb;
401
- $[64] = locale;
402
- $[65] = scrollState.hasHorizontal;
403
- $[66] = scrollState.thumbXOffset;
404
- $[67] = scrollState.thumbXRatio;
405
- $[68] = showHorizontal;
406
- $[69] = styles?.scrollbar;
407
- $[70] = styles?.thumb;
408
- $[71] = t39;
409
- } else t39 = $[71];
410
- let t40;
411
- if ($[72] !== directionRef || $[73] !== t27 || $[74] !== t28 || $[75] !== t30 || $[76] !== t32 || $[77] !== t35 || $[78] !== t36 || $[79] !== t37 || $[80] !== t38 || $[81] !== t39 || $[82] !== type) {
412
- t40 = /*#__PURE__*/ jsxs("div", {
469
+ $[67] = classNames?.scrollbar;
470
+ $[68] = classNames?.thumb;
471
+ $[69] = locale;
472
+ $[70] = scrollState.hasHorizontal;
473
+ $[71] = scrollState.thumbXOffset;
474
+ $[72] = scrollState.thumbXRatio;
475
+ $[73] = showHorizontal;
476
+ $[74] = styles?.scrollbar;
477
+ $[75] = styles?.thumb;
478
+ $[76] = t43;
479
+ } else t43 = $[76];
480
+ let t44;
481
+ if ($[77] !== directionRef || $[78] !== t30 || $[79] !== t31 || $[80] !== t32 || $[81] !== t34 || $[82] !== t36 || $[83] !== t39 || $[84] !== t40 || $[85] !== t41 || $[86] !== t42 || $[87] !== t43 || $[88] !== type) {
482
+ t44 = /*#__PURE__*/ jsxs("div", {
413
483
  ref: directionRef,
414
484
  "data-tao-scroll-area": "",
415
485
  "data-tao-scroll-type": type,
416
- "data-tao-has-v": t27,
417
- "data-tao-has-h": t28,
418
- className: t30,
419
- style: t32,
486
+ "data-tao-scrolling": t30,
487
+ "data-tao-has-v": t31,
488
+ "data-tao-has-h": t32,
489
+ className: t34,
490
+ style: t36,
420
491
  children: [
421
- t35,
422
- t36,
423
- t37,
424
- t38,
425
- t39
492
+ t39,
493
+ t40,
494
+ t41,
495
+ t42,
496
+ t43
426
497
  ]
427
498
  });
428
- $[72] = directionRef;
429
- $[73] = t27;
430
- $[74] = t28;
431
- $[75] = t30;
432
- $[76] = t32;
433
- $[77] = t35;
434
- $[78] = t36;
435
- $[79] = t37;
436
- $[80] = t38;
437
- $[81] = t39;
438
- $[82] = type;
439
- $[83] = t40;
440
- } else t40 = $[83];
441
- return t40;
499
+ $[77] = directionRef;
500
+ $[78] = t30;
501
+ $[79] = t31;
502
+ $[80] = t32;
503
+ $[81] = t34;
504
+ $[82] = t36;
505
+ $[83] = t39;
506
+ $[84] = t40;
507
+ $[85] = t41;
508
+ $[86] = t42;
509
+ $[87] = t43;
510
+ $[88] = type;
511
+ $[89] = t44;
512
+ } else t44 = $[89];
513
+ return t44;
442
514
  }
443
515
  export { ScrollArea };