@adecore/ui 0.31.12 → 0.33.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 (163) hide show
  1. package/dist/AccentSwatches.js +290 -13
  2. package/dist/Banner.js +90 -9
  3. package/dist/Button.js +114 -22
  4. package/dist/ButtonGroup.js +62 -8
  5. package/dist/Checkbox.js +73 -4
  6. package/dist/ChoiceCards.js +205 -11
  7. package/dist/CloseButton.js +87 -7
  8. package/dist/ColorSwatch.js +132 -15
  9. package/dist/ColorWheelPicker.js +305 -71
  10. package/dist/ColumnResizeHandle.js +43 -8
  11. package/dist/DisabledReason.js +27 -8
  12. package/dist/DockShell.js +144 -37
  13. package/dist/EmptyState.js +95 -6
  14. package/dist/ErrorBoundary.js +254 -31
  15. package/dist/Field.js +349 -31
  16. package/dist/FileIcon.js +67 -6
  17. package/dist/Icon.js +38 -6
  18. package/dist/IconButton.js +176 -20
  19. package/dist/IconPicker.js +344 -73
  20. package/dist/Input.js +233 -14
  21. package/dist/Kbd.js +150 -10
  22. package/dist/LazyBoundary.js +14 -5
  23. package/dist/ListRow.js +75 -15
  24. package/dist/Meter.js +108 -5
  25. package/dist/MiddleTruncate.js +126 -45
  26. package/dist/PanelEmpty.js +64 -5
  27. package/dist/PanelHeader.js +95 -13
  28. package/dist/Pill.js +114 -19
  29. package/dist/ProjectSwitcher.js +225 -12
  30. package/dist/PromptDialog.js +352 -37
  31. package/dist/SectionLabel.js +62 -8
  32. package/dist/SegmentBar.js +197 -36
  33. package/dist/Segmented.js +130 -23
  34. package/dist/Select.js +310 -19
  35. package/dist/SelectSearch.js +344 -29
  36. package/dist/Separator.js +35 -4
  37. package/dist/ShortcutHints.js +146 -76
  38. package/dist/Skeleton.js +31 -4
  39. package/dist/Slider.js +172 -10
  40. package/dist/SlidingColumn.js +194 -34
  41. package/dist/Spinner.js +100 -3
  42. package/dist/Stepper.js +232 -11
  43. package/dist/Surface.js +62 -8
  44. package/dist/Switch.js +60 -6
  45. package/dist/TextMenu.js +212 -17
  46. package/dist/Tile.js +149 -5
  47. package/dist/Toasts.js +391 -33
  48. package/dist/Tooltip.js +153 -16
  49. package/dist/UIProvider.js +62 -15
  50. package/dist/Waveform.js +362 -93
  51. package/dist/Wipe.js +259 -34
  52. package/dist/ZoomControls.js +356 -14
  53. package/dist/class-name.js +1 -1
  54. package/dist/clipboard.js +15 -17
  55. package/dist/context-menu/index.parts.js +1 -1
  56. package/dist/dialog/index.parts.js +1 -1
  57. package/dist/dialog/parts.js +378 -29
  58. package/dist/dialog-layer.js +51 -18
  59. package/dist/error-boundary.js +19 -19
  60. package/dist/error-message.js +1 -1
  61. package/dist/field-context.js +7 -5
  62. package/dist/file-icon.js +23 -21
  63. package/dist/file-tree/helpers.js +133 -119
  64. package/dist/file-tree/index.parts.js +3 -3
  65. package/dist/file-tree/parts.js +418 -127
  66. package/dist/file-tree/style.js +1 -1
  67. package/dist/file-tree/use-file-tree-shift.js +43 -30
  68. package/dist/file-tree/use-file-tree.js +60 -18
  69. package/dist/file-tree/use-slots.js +220 -192
  70. package/dist/floating.js +2 -2
  71. package/dist/format/datetime.js +88 -38
  72. package/dist/format/duration.js +59 -53
  73. package/dist/format/index.js +1 -1
  74. package/dist/format/locale.js +76 -56
  75. package/dist/format/number.js +77 -61
  76. package/dist/format/regions.js +4 -2
  77. package/dist/format/time-zone.js +1 -1
  78. package/dist/icon-button-size.js +12 -2
  79. package/dist/icon-picker.js +70 -61
  80. package/dist/index.js +57 -57
  81. package/dist/key-value-list/index.parts.js +1 -1
  82. package/dist/key-value-list/parts.js +256 -22
  83. package/dist/lazy-landings.js +10 -10
  84. package/dist/lazy.js +84 -71
  85. package/dist/locales/en.js +80 -80
  86. package/dist/locales/nl.js +80 -80
  87. package/dist/locales.js +10 -7
  88. package/dist/menu/index.parts.js +1 -1
  89. package/dist/menu/parts.js +882 -44
  90. package/dist/merge-refs.js +8 -9
  91. package/dist/middle-truncate.js +24 -25
  92. package/dist/modality.js +27 -19
  93. package/dist/placement.js +11 -20
  94. package/dist/platform.js +6 -6
  95. package/dist/popover/index.parts.js +1 -1
  96. package/dist/popover/parts.js +173 -11
  97. package/dist/popup-layer.js +38 -17
  98. package/dist/prefetch.js +78 -79
  99. package/dist/preview-card/index.parts.js +1 -1
  100. package/dist/project-switcher-row.js +153 -12
  101. package/dist/select-row.js +69 -5
  102. package/dist/select-shared.js +6 -6
  103. package/dist/selection.js +16 -16
  104. package/dist/seti-icons.js +413 -413
  105. package/dist/settings/ConfirmDialog.js +55 -8
  106. package/dist/settings/DetailHeader.js +72 -4
  107. package/dist/settings/MasterDetail.js +119 -7
  108. package/dist/settings/SettingsDialog.js +820 -80
  109. package/dist/settings/SettingsRow.js +205 -18
  110. package/dist/settings/SettingsSection.js +96 -6
  111. package/dist/settings/index.js +7 -7
  112. package/dist/settings/target.js +7 -2
  113. package/dist/shortcut-hints.js +73 -55
  114. package/dist/shortcut.js +140 -104
  115. package/dist/step-places.js +1 -1
  116. package/dist/tabs/index.parts.js +1 -1
  117. package/dist/tabs/overflow.js +18 -18
  118. package/dist/tabs/parts.js +780 -166
  119. package/dist/testing/dedupe.js +82 -75
  120. package/dist/testing/fake-source.js +12 -12
  121. package/dist/testing/index.js +1 -1
  122. package/dist/toast-store.js +65 -46
  123. package/dist/tree/index.parts.js +1 -1
  124. package/dist/tree/parts.js +721 -94
  125. package/dist/tree/shift.js +28 -22
  126. package/dist/tree/style.js +2 -2
  127. package/dist/tree/use-tree-shift.js +178 -117
  128. package/dist/useAsyncAction.js +23 -19
  129. package/dist/useColumnResize.js +36 -34
  130. package/dist/useContentSize.js +62 -18
  131. package/dist/useMeasuredWidth.js +14 -3
  132. package/dist/useNow.js +73 -30
  133. package/dist/wipe-split.js +14 -14
  134. package/dist/workspace/DropPreview.js +60 -7
  135. package/dist/workspace/SplitView.js +1025 -441
  136. package/dist/workspace/TabStrip.js +810 -191
  137. package/dist/workspace/Workspace.js +276 -26
  138. package/dist/workspace/context.js +8 -3
  139. package/dist/workspace/geometry.js +173 -150
  140. package/dist/workspace/model.js +313 -250
  141. package/dist/workspace/preview.js +61 -61
  142. package/dist/zoom.js +2 -2
  143. package/package.json +1 -1
  144. package/src/ErrorBoundary.tsx +1 -1
  145. package/src/Field.tsx +4 -3
  146. package/src/IconPicker.tsx +3 -3
  147. package/src/LazyBoundary.tsx +2 -0
  148. package/src/MiddleTruncate.tsx +2 -2
  149. package/src/SegmentBar.tsx +2 -2
  150. package/src/Toasts.tsx +3 -1
  151. package/src/Tooltip.tsx +7 -10
  152. package/src/Waveform.tsx +3 -3
  153. package/src/file-tree/parts.tsx +6 -9
  154. package/src/file-tree/use-file-tree-shift.tsx +6 -9
  155. package/src/lazy.tsx +4 -0
  156. package/src/locales/en.ts +4 -4
  157. package/src/locales/nl.ts +5 -5
  158. package/src/settings/SettingsDialog.tsx +1 -1
  159. package/src/tree/parts.tsx +5 -8
  160. package/src/useContentSize.ts +3 -3
  161. package/src/workspace/SplitView.tsx +2 -2
  162. package/src/workspace/TabStrip.tsx +2 -3
  163. package/src/workspace/Workspace.tsx +2 -5
package/dist/Waveform.js CHANGED
@@ -1,11 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, useRef } from 'react';
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useRef } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { formatClockDuration } from './format/duration.js';
6
6
  import { mergeRefs } from './merge-refs.js';
7
7
  import { useMeasuredWidth } from './useMeasuredWidth.js';
8
8
  /* About one bar per 3px, each 2px wide; a bar sits at its own time, so it lines up with the marks and the playhead. */
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const BAR_PITCH = 3;
10
11
  const BAR_WIDTH = 2;
11
12
  /* The height of a silent bar, so silence still reads as a line. */
@@ -14,110 +15,378 @@ const SILENCE = 0.04;
14
15
  const PAGE_STEPS = 10;
15
16
  /* The loudest sample under each bar, or null for a bar past either end of the audio. */
16
17
  const barsOf = (levels, duration, from, to, count) => {
17
- if (count <= 0 || levels.length === 0 || duration <= 0 || to <= from) {
18
- return [];
18
+ if (count <= 0 || levels.length === 0 || duration <= 0 || to <= from) {
19
+ return [];
20
+ }
21
+ const perSecond = levels.length / duration;
22
+ return Array.from({
23
+ length: count
24
+ }, (_, i) => {
25
+ const start = from + (to - from) * i / count;
26
+ const end = from + (to - from) * (i + 1) / count;
27
+ if (end <= 0 || start >= duration) {
28
+ return null;
19
29
  }
20
- const perSecond = levels.length / duration;
21
- return Array.from({ length: count }, (_, i) => {
22
- const start = from + ((to - from) * i) / count;
23
- const end = from + ((to - from) * (i + 1)) / count;
24
- if (end <= 0 || start >= duration) {
25
- return null;
26
- }
27
- const first = Math.max(0, Math.floor(start * perSecond));
28
- const last = Math.min(levels.length - 1, Math.max(first, Math.ceil(end * perSecond) - 1));
29
- let level = 0;
30
- for (let index = first; index <= last; index++) {
31
- level = Math.max(level, levels[index] ?? 0);
32
- }
33
- return Math.min(1, Math.max(SILENCE, level));
34
- });
30
+ const first = Math.max(0, Math.floor(start * perSecond));
31
+ const last = Math.min(levels.length - 1, Math.max(first, Math.ceil(end * perSecond) - 1));
32
+ let level = 0;
33
+ for (let index = first; index <= last; index++) {
34
+ level = Math.max(level, levels[index] ?? 0);
35
+ }
36
+ return Math.min(1, Math.max(SILENCE, level));
37
+ });
35
38
  };
36
39
  /* The loudness of a piece of audio over time, played up to the playhead, where a press or a drag seeks. */
37
- export function Waveform({ levels, duration, range, value, onValueChange, onValueCommitted, step = 1, onKeyDown, marks = [], label, className, ref }) {
38
- const { t } = useTranslation('ui');
39
- const [measure, width] = useMeasuredWidth();
40
- const rootRef = useMemo(() => mergeRefs(ref, measure), [ref, measure]);
41
- const dragged = useRef(0);
42
- const [from, to] = range ?? [0, duration];
43
- const span = to - from;
44
- const count = Math.floor(width / BAR_PITCH);
45
- const bars = useMemo(() => barsOf(levels, duration, from, to, count), [levels, duration, from, to, count]);
46
- const positionOf = (time) => (span > 0 ? (time - from) / span : 0);
47
- const inView = (time) => positionOf(time) >= 0 && positionOf(time) <= 1;
48
- const clamp = (time) => Math.min(duration, Math.max(0, time));
49
- const seekAt = (e) => {
40
+ export function Waveform(t0) {
41
+ const $ = _c(93);
42
+ const {
43
+ levels,
44
+ duration,
45
+ range,
46
+ value,
47
+ onValueChange,
48
+ onValueCommitted,
49
+ step: t1,
50
+ onKeyDown,
51
+ marks: t2,
52
+ label,
53
+ className,
54
+ ref
55
+ } = t0;
56
+ const step = t1 === undefined ? 1 : t1;
57
+ const marks = t2 === undefined ? [] : t2;
58
+ const {
59
+ t
60
+ } = useTranslation("ui");
61
+ const [measure, width] = useMeasuredWidth();
62
+ let t3;
63
+ if ($[0] !== measure || $[1] !== ref) {
64
+ t3 = mergeRefs(ref, measure);
65
+ $[0] = measure;
66
+ $[1] = ref;
67
+ $[2] = t3;
68
+ } else {
69
+ t3 = $[2];
70
+ }
71
+ const rootRef = t3;
72
+ const dragged = useRef(0);
73
+ let t4;
74
+ if ($[3] !== duration || $[4] !== range) {
75
+ t4 = range ?? [0, duration];
76
+ $[3] = duration;
77
+ $[4] = range;
78
+ $[5] = t4;
79
+ } else {
80
+ t4 = $[5];
81
+ }
82
+ const [from, to] = t4;
83
+ const span = to - from;
84
+ const count = Math.floor(width / BAR_PITCH);
85
+ let inView;
86
+ let positionOf;
87
+ let t10;
88
+ let t11;
89
+ let t12;
90
+ let t13;
91
+ let t5;
92
+ let t6;
93
+ let t7;
94
+ let t8;
95
+ let t9;
96
+ if ($[6] !== className || $[7] !== count || $[8] !== duration || $[9] !== from || $[10] !== label || $[11] !== levels || $[12] !== onKeyDown || $[13] !== onValueChange || $[14] !== onValueCommitted || $[15] !== rootRef || $[16] !== span || $[17] !== step || $[18] !== t || $[19] !== to || $[20] !== value || $[21] !== width) {
97
+ const bars = barsOf(levels, duration, from, to, count);
98
+ let t14;
99
+ if ($[33] !== from || $[34] !== span) {
100
+ t14 = time => span > 0 ? (time - from) / span : 0;
101
+ $[33] = from;
102
+ $[34] = span;
103
+ $[35] = t14;
104
+ } else {
105
+ t14 = $[35];
106
+ }
107
+ positionOf = t14;
108
+ let t15;
109
+ if ($[36] !== positionOf) {
110
+ t15 = time_0 => positionOf(time_0) >= 0 && positionOf(time_0) <= 1;
111
+ $[36] = positionOf;
112
+ $[37] = t15;
113
+ } else {
114
+ t15 = $[37];
115
+ }
116
+ inView = t15;
117
+ let t16;
118
+ if ($[38] !== duration) {
119
+ t16 = time_1 => Math.min(duration, Math.max(0, time_1));
120
+ $[38] = duration;
121
+ $[39] = t16;
122
+ } else {
123
+ t16 = $[39];
124
+ }
125
+ const clamp = t16;
126
+ let t17;
127
+ if ($[40] !== clamp || $[41] !== from || $[42] !== onValueChange || $[43] !== span) {
128
+ t17 = e => {
50
129
  const rect = e.currentTarget.getBoundingClientRect();
51
130
  if (rect.width > 0) {
52
- dragged.current = clamp(from + ((e.clientX - rect.left) / rect.width) * span);
53
- onValueChange?.(dragged.current);
131
+ dragged.current = clamp(from + (e.clientX - rect.left) / rect.width * span);
132
+ onValueChange?.(dragged.current);
54
133
  }
55
- };
56
- const letGo = (e) => {
57
- if (e.currentTarget.hasPointerCapture(e.pointerId)) {
58
- e.currentTarget.releasePointerCapture(e.pointerId);
59
- onValueCommitted?.(dragged.current);
134
+ };
135
+ $[40] = clamp;
136
+ $[41] = from;
137
+ $[42] = onValueChange;
138
+ $[43] = span;
139
+ $[44] = t17;
140
+ } else {
141
+ t17 = $[44];
142
+ }
143
+ const seekAt = t17;
144
+ let t18;
145
+ if ($[45] !== onValueCommitted) {
146
+ t18 = e_0 => {
147
+ if (e_0.currentTarget.hasPointerCapture(e_0.pointerId)) {
148
+ e_0.currentTarget.releasePointerCapture(e_0.pointerId);
149
+ onValueCommitted?.(dragged.current);
60
150
  }
61
- };
62
- const moveByKey = (e) => {
63
- onKeyDown?.(e);
64
- if (e.defaultPrevented) {
65
- return;
151
+ };
152
+ $[45] = onValueCommitted;
153
+ $[46] = t18;
154
+ } else {
155
+ t18 = $[46];
156
+ }
157
+ const letGo = t18;
158
+ let t19;
159
+ if ($[47] !== clamp || $[48] !== duration || $[49] !== onKeyDown || $[50] !== onValueChange || $[51] !== onValueCommitted || $[52] !== step || $[53] !== value) {
160
+ t19 = e_1 => {
161
+ onKeyDown?.(e_1);
162
+ if (e_1.defaultPrevented) {
163
+ return;
66
164
  }
67
165
  const at = value ?? 0;
68
166
  const moves = {
69
- ArrowLeft: at - step,
70
- ArrowDown: at - step,
71
- ArrowRight: at + step,
72
- ArrowUp: at + step,
73
- PageDown: at - step * PAGE_STEPS,
74
- PageUp: at + step * PAGE_STEPS,
75
- Home: 0,
76
- End: duration
167
+ ArrowLeft: at - step,
168
+ ArrowDown: at - step,
169
+ ArrowRight: at + step,
170
+ ArrowUp: at + step,
171
+ PageDown: at - step * PAGE_STEPS,
172
+ PageUp: at + step * PAGE_STEPS,
173
+ Home: 0,
174
+ End: duration
77
175
  };
78
- const next = moves[e.key];
176
+ const next = moves[e_1.key];
79
177
  if (next === undefined) {
80
- return;
178
+ return;
81
179
  }
82
- // The slider owns these keys; a transport listening higher up would move the playhead a second time.
83
- e.preventDefault();
84
- e.stopPropagation();
180
+ e_1.preventDefault();
181
+ e_1.stopPropagation();
85
182
  onValueChange?.(clamp(next));
86
183
  onValueCommitted?.(clamp(next));
184
+ };
185
+ $[47] = clamp;
186
+ $[48] = duration;
187
+ $[49] = onKeyDown;
188
+ $[50] = onValueChange;
189
+ $[51] = onValueCommitted;
190
+ $[52] = step;
191
+ $[53] = value;
192
+ $[54] = t19;
193
+ } else {
194
+ t19 = $[54];
195
+ }
196
+ const moveByKey = t19;
197
+ let t20;
198
+ if ($[55] !== duration || $[56] !== letGo || $[57] !== moveByKey || $[58] !== onValueChange || $[59] !== seekAt || $[60] !== t || $[61] !== value) {
199
+ t20 = onValueChange === undefined ? {
200
+ role: "img"
201
+ } : {
202
+ role: "slider",
203
+ tabIndex: 0,
204
+ "aria-valuemin": 0,
205
+ "aria-valuemax": duration,
206
+ "aria-valuenow": value ?? 0,
207
+ "aria-valuetext": t("waveform.position", {
208
+ time: formatClockDuration((value ?? 0) * 1000),
209
+ duration: formatClockDuration(duration * 1000)
210
+ }),
211
+ onPointerDown: e_2 => {
212
+ e_2.currentTarget.setPointerCapture(e_2.pointerId);
213
+ seekAt(e_2);
214
+ },
215
+ onPointerMove: e_3 => {
216
+ if (e_3.currentTarget.hasPointerCapture(e_3.pointerId)) {
217
+ seekAt(e_3);
218
+ }
219
+ },
220
+ onPointerUp: letGo,
221
+ onPointerCancel: letGo,
222
+ onKeyDown: moveByKey
223
+ };
224
+ $[55] = duration;
225
+ $[56] = letGo;
226
+ $[57] = moveByKey;
227
+ $[58] = onValueChange;
228
+ $[59] = seekAt;
229
+ $[60] = t;
230
+ $[61] = value;
231
+ $[62] = t20;
232
+ } else {
233
+ t20 = $[62];
234
+ }
235
+ const slider = t20;
236
+ t10 = rootRef;
237
+ t11 = label;
238
+ t12 = slider;
239
+ const t21 = onValueChange !== undefined && "focus-ring cursor-ew-resize touch-none";
240
+ if ($[63] !== className || $[64] !== t21) {
241
+ t13 = clsx("relative select-none", t21, className);
242
+ $[63] = className;
243
+ $[64] = t21;
244
+ $[65] = t13;
245
+ } else {
246
+ t13 = $[65];
247
+ }
248
+ t5 = "absolute inset-0 size-full";
249
+ t6 = `0 0 ${Math.max(1, width)} 100`;
250
+ t7 = "none";
251
+ t8 = true;
252
+ let t22;
253
+ if ($[66] !== count || $[67] !== from || $[68] !== span || $[69] !== value || $[70] !== width) {
254
+ t22 = (level, i) => {
255
+ if (level === null) {
256
+ return null;
257
+ }
258
+ const center = from + span * (i + 0.5) / count;
259
+ return /*#__PURE__*/_jsx("rect", {
260
+ x: Math.round(i * width / count),
261
+ y: (100 - level * 100) / 2,
262
+ width: BAR_WIDTH,
263
+ height: level * 100,
264
+ className: value !== undefined && center <= value ? "fill-accent" : "fill-text-faint"
265
+ }, i);
266
+ };
267
+ $[66] = count;
268
+ $[67] = from;
269
+ $[68] = span;
270
+ $[69] = value;
271
+ $[70] = width;
272
+ $[71] = t22;
273
+ } else {
274
+ t22 = $[71];
275
+ }
276
+ t9 = bars.map(t22);
277
+ $[6] = className;
278
+ $[7] = count;
279
+ $[8] = duration;
280
+ $[9] = from;
281
+ $[10] = label;
282
+ $[11] = levels;
283
+ $[12] = onKeyDown;
284
+ $[13] = onValueChange;
285
+ $[14] = onValueCommitted;
286
+ $[15] = rootRef;
287
+ $[16] = span;
288
+ $[17] = step;
289
+ $[18] = t;
290
+ $[19] = to;
291
+ $[20] = value;
292
+ $[21] = width;
293
+ $[22] = inView;
294
+ $[23] = positionOf;
295
+ $[24] = t10;
296
+ $[25] = t11;
297
+ $[26] = t12;
298
+ $[27] = t13;
299
+ $[28] = t5;
300
+ $[29] = t6;
301
+ $[30] = t7;
302
+ $[31] = t8;
303
+ $[32] = t9;
304
+ } else {
305
+ inView = $[22];
306
+ positionOf = $[23];
307
+ t10 = $[24];
308
+ t11 = $[25];
309
+ t12 = $[26];
310
+ t13 = $[27];
311
+ t5 = $[28];
312
+ t6 = $[29];
313
+ t7 = $[30];
314
+ t8 = $[31];
315
+ t9 = $[32];
316
+ }
317
+ let t14;
318
+ if ($[72] !== positionOf || $[73] !== width) {
319
+ t14 = mark => {
320
+ const x = Math.round(positionOf(mark) * width) + 0.5;
321
+ return /*#__PURE__*/_jsx("line", {
322
+ x1: x,
323
+ x2: x,
324
+ y1: 0,
325
+ y2: 100,
326
+ strokeWidth: 1,
327
+ vectorEffect: "non-scaling-stroke",
328
+ className: "stroke-accent opacity-60"
329
+ }, mark);
87
330
  };
88
- const slider = onValueChange === undefined
89
- ? { role: 'img' }
90
- : {
91
- role: 'slider',
92
- tabIndex: 0,
93
- 'aria-valuemin': 0,
94
- 'aria-valuemax': duration,
95
- 'aria-valuenow': value ?? 0,
96
- 'aria-valuetext': t('waveform.position', {
97
- time: formatClockDuration((value ?? 0) * 1000),
98
- duration: formatClockDuration(duration * 1000)
99
- }),
100
- onPointerDown: (e) => {
101
- e.currentTarget.setPointerCapture(e.pointerId);
102
- seekAt(e);
103
- },
104
- onPointerMove: (e) => {
105
- if (e.currentTarget.hasPointerCapture(e.pointerId)) {
106
- seekAt(e);
107
- }
108
- },
109
- onPointerUp: letGo,
110
- onPointerCancel: letGo,
111
- onKeyDown: moveByKey
112
- };
113
- return (_jsxs("div", { ref: rootRef, "aria-label": label, ...slider, className: clsx('relative select-none', onValueChange !== undefined && 'focus-ring cursor-ew-resize touch-none', className), children: [_jsxs("svg", { className: "absolute inset-0 size-full", viewBox: `0 0 ${Math.max(1, width)} 100`, preserveAspectRatio: "none", "aria-hidden": true, children: [bars.map((level, i) => {
114
- if (level === null) {
115
- return null;
116
- }
117
- const center = from + (span * (i + 0.5)) / count;
118
- return (_jsx("rect", { x: Math.round((i * width) / count), y: (100 - level * 100) / 2, width: BAR_WIDTH, height: level * 100, className: value !== undefined && center <= value ? 'fill-accent' : 'fill-text-faint' }, i));
119
- }), marks.filter(inView).map((mark) => {
120
- const x = Math.round(positionOf(mark) * width) + 0.5;
121
- return (_jsx("line", { x1: x, x2: x, y1: 0, y2: 100, strokeWidth: 1, vectorEffect: "non-scaling-stroke", className: "stroke-accent opacity-60" }, mark));
122
- })] }), value !== undefined && inView(value) && (_jsx("span", { className: "pointer-events-none absolute inset-y-0 w-px bg-accent", style: { left: `${positionOf(value) * 100}%` } }))] }));
123
- }
331
+ $[72] = positionOf;
332
+ $[73] = width;
333
+ $[74] = t14;
334
+ } else {
335
+ t14 = $[74];
336
+ }
337
+ const t15 = marks.filter(inView).map(t14);
338
+ let t16;
339
+ if ($[75] !== t15 || $[76] !== t5 || $[77] !== t6 || $[78] !== t7 || $[79] !== t8 || $[80] !== t9) {
340
+ t16 = /*#__PURE__*/_jsxs("svg", {
341
+ className: t5,
342
+ viewBox: t6,
343
+ preserveAspectRatio: t7,
344
+ "aria-hidden": t8,
345
+ children: [t9, t15]
346
+ });
347
+ $[75] = t15;
348
+ $[76] = t5;
349
+ $[77] = t6;
350
+ $[78] = t7;
351
+ $[79] = t8;
352
+ $[80] = t9;
353
+ $[81] = t16;
354
+ } else {
355
+ t16 = $[81];
356
+ }
357
+ let t17;
358
+ if ($[82] !== inView || $[83] !== positionOf || $[84] !== value) {
359
+ t17 = value !== undefined && inView(value) && /*#__PURE__*/_jsx("span", {
360
+ className: "pointer-events-none absolute inset-y-0 w-px bg-accent",
361
+ style: {
362
+ left: `${positionOf(value) * 100}%`
363
+ }
364
+ });
365
+ $[82] = inView;
366
+ $[83] = positionOf;
367
+ $[84] = value;
368
+ $[85] = t17;
369
+ } else {
370
+ t17 = $[85];
371
+ }
372
+ let t18;
373
+ if ($[86] !== t10 || $[87] !== t11 || $[88] !== t12 || $[89] !== t13 || $[90] !== t16 || $[91] !== t17) {
374
+ t18 = /*#__PURE__*/_jsxs("div", {
375
+ ref: t10,
376
+ "aria-label": t11,
377
+ ...t12,
378
+ className: t13,
379
+ children: [t16, t17]
380
+ });
381
+ $[86] = t10;
382
+ $[87] = t11;
383
+ $[88] = t12;
384
+ $[89] = t13;
385
+ $[90] = t16;
386
+ $[91] = t17;
387
+ $[92] = t18;
388
+ } else {
389
+ t18 = $[92];
390
+ }
391
+ return t18;
392
+ }