@adecore/ui 0.31.11 → 0.32.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/Skeleton.js CHANGED
@@ -1,6 +1,33 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import clsx from 'clsx';
3
3
  /* A bar where a value will be, while the answer is still on its way. */
4
- export function Skeleton({ className, ref }) {
5
- return _jsx("span", { ref: ref, className: clsx('block h-4 animate-pulse rounded bg-surface-sunken', className), "aria-hidden": true });
6
- }
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export function Skeleton(t0) {
6
+ const $ = _c(5);
7
+ const {
8
+ className,
9
+ ref
10
+ } = t0;
11
+ let t1;
12
+ if ($[0] !== className) {
13
+ t1 = clsx("block h-4 animate-pulse rounded bg-surface-sunken", className);
14
+ $[0] = className;
15
+ $[1] = t1;
16
+ } else {
17
+ t1 = $[1];
18
+ }
19
+ let t2;
20
+ if ($[2] !== ref || $[3] !== t1) {
21
+ t2 = /*#__PURE__*/_jsx("span", {
22
+ ref: ref,
23
+ className: t1,
24
+ "aria-hidden": true
25
+ });
26
+ $[2] = ref;
27
+ $[3] = t1;
28
+ $[4] = t2;
29
+ } else {
30
+ t2 = $[4];
31
+ }
32
+ return t2;
33
+ }
package/dist/Slider.js CHANGED
@@ -1,16 +1,178 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { useId } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { Slider as BaseSlider } from '@base-ui/react/slider';
5
5
  import { formatFixed } from './format/number.js';
6
6
  import { placesOf } from './step-places.js';
7
7
  /* A number picked along a range: the label and the value on one line, the track under them. */
8
- export function Slider({ value, onValueChange, min, max, step = 1, decimals = placesOf(step), unit, label, disabled, className, ref }) {
9
- const labelId = useId();
10
- const reading = formatFixed(value, decimals);
11
- // Base UI adds steps in floating point, so 0.2 plus 0.1 would arrive as 0.30000000000000004.
12
- const places = Math.max(placesOf(step), placesOf(min));
13
- // Base UI's Page Up jumps 10 whatever the range; a tenth of the range suits 0 to 1 as well as 0 to 1000.
14
- const largeStep = Math.max(step, Math.round((max - min) / 10 / step) * step);
15
- return (_jsxs(BaseSlider.Root, { ref: ref, value: value, onValueChange: (next) => onValueChange(Number(next.toFixed(places))), min: min, max: max, step: step, largeStep: largeStep, disabled: disabled, "aria-labelledby": labelId, className: clsx('flex flex-col gap-1 data-disabled:opacity-50', className), children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3 text-xs", children: [_jsx("span", { id: labelId, className: "min-w-0 truncate text-text", children: label }), _jsxs("span", { "aria-hidden": true, className: "shrink-0 text-text-muted tabular-nums", children: [reading, unit] })] }), _jsx(BaseSlider.Control, { className: "flex h-5 touch-none items-center px-2 select-none", children: _jsxs(BaseSlider.Track, { className: "relative h-1 w-full rounded-full bg-border-strong", children: [_jsx(BaseSlider.Indicator, { className: "rounded-full bg-accent" }), _jsx(BaseSlider.Thumb, { getAriaValueText: () => `${reading}${unit ?? ''}`, className: "block size-4 rounded-full bg-surface-raised shadow-raised outline-offset-2 outline-accent has-focus-visible:outline-2" })] }) })] }));
16
- }
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export function Slider(t0) {
10
+ const $ = _c(41);
11
+ const {
12
+ value,
13
+ onValueChange,
14
+ min,
15
+ max,
16
+ step: t1,
17
+ decimals: t2,
18
+ unit,
19
+ label,
20
+ disabled,
21
+ className,
22
+ ref
23
+ } = t0;
24
+ const step = t1 === undefined ? 1 : t1;
25
+ let t3;
26
+ if ($[0] !== step || $[1] !== t2) {
27
+ t3 = t2 === undefined ? placesOf(step) : t2;
28
+ $[0] = step;
29
+ $[1] = t2;
30
+ $[2] = t3;
31
+ } else {
32
+ t3 = $[2];
33
+ }
34
+ const decimals = t3;
35
+ const labelId = useId();
36
+ let t4;
37
+ if ($[3] !== decimals || $[4] !== value) {
38
+ t4 = formatFixed(value, decimals);
39
+ $[3] = decimals;
40
+ $[4] = value;
41
+ $[5] = t4;
42
+ } else {
43
+ t4 = $[5];
44
+ }
45
+ const reading = t4;
46
+ let t5;
47
+ if ($[6] !== step) {
48
+ t5 = placesOf(step);
49
+ $[6] = step;
50
+ $[7] = t5;
51
+ } else {
52
+ t5 = $[7];
53
+ }
54
+ let t6;
55
+ if ($[8] !== min) {
56
+ t6 = placesOf(min);
57
+ $[8] = min;
58
+ $[9] = t6;
59
+ } else {
60
+ t6 = $[9];
61
+ }
62
+ const places = Math.max(t5, t6);
63
+ const largeStep = Math.max(step, Math.round((max - min) / 10 / step) * step);
64
+ let t7;
65
+ if ($[10] !== onValueChange || $[11] !== places) {
66
+ t7 = next => onValueChange(Number(next.toFixed(places)));
67
+ $[10] = onValueChange;
68
+ $[11] = places;
69
+ $[12] = t7;
70
+ } else {
71
+ t7 = $[12];
72
+ }
73
+ let t8;
74
+ if ($[13] !== className) {
75
+ t8 = clsx("flex flex-col gap-1 data-disabled:opacity-50", className);
76
+ $[13] = className;
77
+ $[14] = t8;
78
+ } else {
79
+ t8 = $[14];
80
+ }
81
+ let t9;
82
+ if ($[15] !== label || $[16] !== labelId) {
83
+ t9 = /*#__PURE__*/_jsx("span", {
84
+ id: labelId,
85
+ className: "min-w-0 truncate text-text",
86
+ children: label
87
+ });
88
+ $[15] = label;
89
+ $[16] = labelId;
90
+ $[17] = t9;
91
+ } else {
92
+ t9 = $[17];
93
+ }
94
+ let t10;
95
+ if ($[18] !== reading || $[19] !== unit) {
96
+ t10 = /*#__PURE__*/_jsxs("span", {
97
+ "aria-hidden": true,
98
+ className: "shrink-0 text-text-muted tabular-nums",
99
+ children: [reading, unit]
100
+ });
101
+ $[18] = reading;
102
+ $[19] = unit;
103
+ $[20] = t10;
104
+ } else {
105
+ t10 = $[20];
106
+ }
107
+ let t11;
108
+ if ($[21] !== t10 || $[22] !== t9) {
109
+ t11 = /*#__PURE__*/_jsxs("div", {
110
+ className: "flex items-baseline justify-between gap-3 text-xs",
111
+ children: [t9, t10]
112
+ });
113
+ $[21] = t10;
114
+ $[22] = t9;
115
+ $[23] = t11;
116
+ } else {
117
+ t11 = $[23];
118
+ }
119
+ let t12;
120
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
121
+ t12 = /*#__PURE__*/_jsx(BaseSlider.Indicator, {
122
+ className: "rounded-full bg-accent"
123
+ });
124
+ $[24] = t12;
125
+ } else {
126
+ t12 = $[24];
127
+ }
128
+ let t13;
129
+ if ($[25] !== reading || $[26] !== unit) {
130
+ t13 = /*#__PURE__*/_jsx(BaseSlider.Control, {
131
+ className: "flex h-5 touch-none items-center px-2 select-none",
132
+ children: /*#__PURE__*/_jsxs(BaseSlider.Track, {
133
+ className: "relative h-1 w-full rounded-full bg-border-strong",
134
+ children: [t12, /*#__PURE__*/_jsx(BaseSlider.Thumb, {
135
+ getAriaValueText: () => `${reading}${unit ?? ""}`,
136
+ className: "block size-4 rounded-full bg-surface-raised shadow-raised outline-offset-2 outline-accent has-focus-visible:outline-2"
137
+ })]
138
+ })
139
+ });
140
+ $[25] = reading;
141
+ $[26] = unit;
142
+ $[27] = t13;
143
+ } else {
144
+ t13 = $[27];
145
+ }
146
+ let t14;
147
+ if ($[28] !== disabled || $[29] !== labelId || $[30] !== largeStep || $[31] !== max || $[32] !== min || $[33] !== ref || $[34] !== step || $[35] !== t11 || $[36] !== t13 || $[37] !== t7 || $[38] !== t8 || $[39] !== value) {
148
+ t14 = /*#__PURE__*/_jsxs(BaseSlider.Root, {
149
+ ref: ref,
150
+ value: value,
151
+ onValueChange: t7,
152
+ min: min,
153
+ max: max,
154
+ step: step,
155
+ largeStep: largeStep,
156
+ disabled: disabled,
157
+ "aria-labelledby": labelId,
158
+ className: t8,
159
+ children: [t11, t13]
160
+ });
161
+ $[28] = disabled;
162
+ $[29] = labelId;
163
+ $[30] = largeStep;
164
+ $[31] = max;
165
+ $[32] = min;
166
+ $[33] = ref;
167
+ $[34] = step;
168
+ $[35] = t11;
169
+ $[36] = t13;
170
+ $[37] = t7;
171
+ $[38] = t8;
172
+ $[39] = value;
173
+ $[40] = t14;
174
+ } else {
175
+ t14 = $[40];
176
+ }
177
+ return t14;
178
+ }
@@ -1,10 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import clsx from 'clsx';
4
- import { ColumnResizeHandle } from './ColumnResizeHandle.js';
4
+ import { ColumnResizeHandle } from "./ColumnResizeHandle.js";
5
5
  import { mergeRefs } from './merge-refs.js';
6
6
  import { useColumnResize } from './useColumnResize.js';
7
7
  // How long the open and close motion takes; the same number as `.sliding-column` in `theme.css`.
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  const TRANSITION_MS = 200;
9
10
  /*
10
11
  * A panel that slides in and out along the right edge. The outer column is 0 wide and inert while
@@ -12,37 +13,196 @@ const TRANSITION_MS = 200;
12
13
  * moves, and they stay mounted until the slide is over, so a close plays out. The left edge is the
13
14
  * drag handle.
14
15
  */
15
- export function SlidingColumn({ open, width, gap = 0, bounds, onWidthChange, instant = false, body, className, ref, children }) {
16
- /* Closed and done animating. */
17
- const [settled, setSettled] = useState(!open);
18
- /* A width that lands without a transition fires no `transitionend`, so the motion it would have
19
- ended is over in the same commit that starts it. */
20
- if (instant && settled !== !open) {
16
+ export function SlidingColumn(t0) {
17
+ const $ = _c(42);
18
+ const {
19
+ open,
20
+ width,
21
+ gap: t1,
22
+ bounds,
23
+ onWidthChange,
24
+ instant: t2,
25
+ body,
26
+ className,
27
+ ref,
28
+ children
29
+ } = t0;
30
+ const gap = t1 === undefined ? 0 : t1;
31
+ const instant = t2 === undefined ? false : t2;
32
+ const [settled, setSettled] = useState(!open);
33
+ if (instant && settled !== !open) {
34
+ setSettled(!open);
35
+ }
36
+ const present = open || !settled;
37
+ const column = useRef(null);
38
+ let t3;
39
+ if ($[0] !== gap) {
40
+ t3 = Math.round(gap);
41
+ $[0] = gap;
42
+ $[1] = t3;
43
+ } else {
44
+ t3 = $[1];
45
+ }
46
+ const spacing = Math.max(0, t3);
47
+ const t4 = bounds.min + spacing;
48
+ let t5;
49
+ if ($[2] !== bounds || $[3] !== spacing) {
50
+ t5 = () => bounds.max() + spacing;
51
+ $[2] = bounds;
52
+ $[3] = spacing;
53
+ $[4] = t5;
54
+ } else {
55
+ t5 = $[4];
56
+ }
57
+ const t6 = width + spacing;
58
+ let t7;
59
+ if ($[5] !== onWidthChange || $[6] !== spacing) {
60
+ t7 = next => onWidthChange(next - spacing);
61
+ $[5] = onWidthChange;
62
+ $[6] = spacing;
63
+ $[7] = t7;
64
+ } else {
65
+ t7 = $[7];
66
+ }
67
+ let t8;
68
+ if ($[8] !== t4 || $[9] !== t5 || $[10] !== t6 || $[11] !== t7) {
69
+ t8 = {
70
+ min: t4,
71
+ max: t5,
72
+ size: t6,
73
+ from: "right",
74
+ onSize: t7
75
+ };
76
+ $[8] = t4;
77
+ $[9] = t5;
78
+ $[10] = t6;
79
+ $[11] = t7;
80
+ $[12] = t8;
81
+ } else {
82
+ t8 = $[12];
83
+ }
84
+ const {
85
+ startResize
86
+ } = useColumnResize(column, t8);
87
+ let t10;
88
+ let t9;
89
+ if ($[13] !== open || $[14] !== settled) {
90
+ t9 = () => {
91
+ if (open || settled) {
92
+ return;
93
+ }
94
+ const timer = window.setTimeout(() => setSettled(true), TRANSITION_MS + 50);
95
+ return () => {
96
+ window.clearTimeout(timer);
97
+ };
98
+ };
99
+ t10 = [open, settled];
100
+ $[13] = open;
101
+ $[14] = settled;
102
+ $[15] = t10;
103
+ $[16] = t9;
104
+ } else {
105
+ t10 = $[15];
106
+ t9 = $[16];
107
+ }
108
+ useEffect(t9, t10);
109
+ let t11;
110
+ if ($[17] !== ref) {
111
+ t11 = mergeRefs(column, ref);
112
+ $[17] = ref;
113
+ $[18] = t11;
114
+ } else {
115
+ t11 = $[18];
116
+ }
117
+ const t12 = !open;
118
+ const t13 = instant ? "" : undefined;
119
+ const t14 = spacing > 0 ? "" : undefined;
120
+ let t15;
121
+ if ($[19] !== className) {
122
+ t15 = clsx("sliding-column flex h-full shrink-0 justify-end overflow-hidden", className);
123
+ $[19] = className;
124
+ $[20] = t15;
125
+ } else {
126
+ t15 = $[20];
127
+ }
128
+ const t16 = open ? width + spacing : 0;
129
+ let t17;
130
+ if ($[21] !== t16) {
131
+ t17 = {
132
+ width: t16
133
+ };
134
+ $[21] = t16;
135
+ $[22] = t17;
136
+ } else {
137
+ t17 = $[22];
138
+ }
139
+ let t18;
140
+ if ($[23] !== open) {
141
+ t18 = event => {
142
+ if (event.propertyName === "width" && event.target === event.currentTarget) {
21
143
  setSettled(!open);
22
- }
23
- const present = open || !settled;
24
- const column = useRef(null);
25
- const spacing = Math.max(0, Math.round(gap));
26
- const { startResize } = useColumnResize(column, {
27
- min: bounds.min + spacing,
28
- max: () => bounds.max() + spacing,
29
- size: width + spacing,
30
- from: 'right',
31
- onSize: (next) => onWidthChange(next - spacing)
144
+ }
145
+ };
146
+ $[23] = open;
147
+ $[24] = t18;
148
+ } else {
149
+ t18 = $[24];
150
+ }
151
+ let t19;
152
+ if ($[25] !== body || $[26] !== children || $[27] !== open || $[28] !== present || $[29] !== spacing || $[30] !== startResize || $[31] !== width) {
153
+ t19 = present && /*#__PURE__*/_jsxs("div", {
154
+ ref: body?.ref,
155
+ tabIndex: body ? -1 : undefined,
156
+ className: clsx("relative flex h-full shrink-0 flex-col bg-surface outline-none", spacing === 0 && "border-l border-border"),
157
+ style: {
158
+ width,
159
+ marginLeft: spacing
160
+ },
161
+ onKeyDown: body?.onKeyDown,
162
+ children: [open && /*#__PURE__*/_jsx(ColumnResizeHandle, {
163
+ from: "right",
164
+ className: "sliding-column-resize",
165
+ style: spacing > 0 ? {
166
+ left: -spacing,
167
+ width: spacing
168
+ } : undefined,
169
+ onPointerDown: startResize
170
+ }), children]
171
+ });
172
+ $[25] = body;
173
+ $[26] = children;
174
+ $[27] = open;
175
+ $[28] = present;
176
+ $[29] = spacing;
177
+ $[30] = startResize;
178
+ $[31] = width;
179
+ $[32] = t19;
180
+ } else {
181
+ t19 = $[32];
182
+ }
183
+ let t20;
184
+ if ($[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t17 || $[39] !== t18 || $[40] !== t19) {
185
+ t20 = /*#__PURE__*/_jsx("aside", {
186
+ ref: t11,
187
+ inert: t12,
188
+ "data-instant": t13,
189
+ "data-gap": t14,
190
+ className: t15,
191
+ style: t17,
192
+ onTransitionEnd: t18,
193
+ children: t19
32
194
  });
33
- useEffect(() => {
34
- if (open || settled) {
35
- return;
36
- }
37
- // Reduced motion and a hidden tab paint no width change, so no `transitionend` arrives.
38
- const timer = window.setTimeout(() => setSettled(true), TRANSITION_MS + 50);
39
- return () => {
40
- window.clearTimeout(timer);
41
- };
42
- }, [open, settled]);
43
- return (_jsx("aside", { ref: mergeRefs(column, ref), inert: !open, "data-instant": instant ? '' : undefined, "data-gap": spacing > 0 ? '' : undefined, className: clsx('sliding-column flex h-full shrink-0 justify-end overflow-hidden', className), style: { width: open ? width + spacing : 0 }, onTransitionEnd: (event) => {
44
- if (event.propertyName === 'width' && event.target === event.currentTarget) {
45
- setSettled(!open);
46
- }
47
- }, children: present && (_jsxs("div", { ref: body?.ref, tabIndex: body ? -1 : undefined, className: clsx('relative flex h-full shrink-0 flex-col bg-surface outline-none', spacing === 0 && 'border-l border-border'), style: { width, marginLeft: spacing }, onKeyDown: body?.onKeyDown, children: [open && (_jsx(ColumnResizeHandle, { from: "right", className: "sliding-column-resize", style: spacing > 0 ? { left: -spacing, width: spacing } : undefined, onPointerDown: startResize })), children] })) }));
48
- }
195
+ $[33] = t11;
196
+ $[34] = t12;
197
+ $[35] = t13;
198
+ $[36] = t14;
199
+ $[37] = t15;
200
+ $[38] = t17;
201
+ $[39] = t18;
202
+ $[40] = t19;
203
+ $[41] = t20;
204
+ } else {
205
+ t20 = $[41];
206
+ }
207
+ return t20;
208
+ }
package/dist/Spinner.js CHANGED
@@ -1,7 +1,104 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import clsx from 'clsx';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
3
4
  const DOTS = [0, 1, 2];
4
5
  /* Work in progress: three dots that leap over each other in the color of the text around them. With reduced motion they stand still. */
5
- export function Spinner({ size = 16, label, className, style, ref, ...props }) {
6
- return (_jsx("span", { ref: ref, role: label === undefined ? undefined : 'img', "aria-label": label, "aria-hidden": label === undefined ? true : undefined, ...props, className: clsx('spinner', className), style: { ...style, '--spinner-size': `${size}px` }, children: DOTS.map((dot) => (_jsx("span", { className: "spinner-hop", style: { '--spinner-step': dot }, children: _jsx("span", { className: "spinner-dot" }) }, dot))) }));
6
+ export function Spinner(t0) {
7
+ const $ = _c(21);
8
+ let className;
9
+ let label;
10
+ let props;
11
+ let ref;
12
+ let style;
13
+ let t1;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ size: t1,
17
+ label,
18
+ className,
19
+ style,
20
+ ref,
21
+ ...props
22
+ } = t0);
23
+ $[0] = t0;
24
+ $[1] = className;
25
+ $[2] = label;
26
+ $[3] = props;
27
+ $[4] = ref;
28
+ $[5] = style;
29
+ $[6] = t1;
30
+ } else {
31
+ className = $[1];
32
+ label = $[2];
33
+ props = $[3];
34
+ ref = $[4];
35
+ style = $[5];
36
+ t1 = $[6];
37
+ }
38
+ const size = t1 === undefined ? 16 : t1;
39
+ const t2 = label === undefined ? undefined : "img";
40
+ const t3 = label === undefined ? true : undefined;
41
+ let t4;
42
+ if ($[7] !== className) {
43
+ t4 = clsx("spinner", className);
44
+ $[7] = className;
45
+ $[8] = t4;
46
+ } else {
47
+ t4 = $[8];
48
+ }
49
+ const t5 = `${size}px`;
50
+ let t6;
51
+ if ($[9] !== style || $[10] !== t5) {
52
+ t6 = {
53
+ ...style,
54
+ "--spinner-size": t5
55
+ };
56
+ $[9] = style;
57
+ $[10] = t5;
58
+ $[11] = t6;
59
+ } else {
60
+ t6 = $[11];
61
+ }
62
+ let t7;
63
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
64
+ t7 = DOTS.map(_temp);
65
+ $[12] = t7;
66
+ } else {
67
+ t7 = $[12];
68
+ }
69
+ let t8;
70
+ if ($[13] !== label || $[14] !== props || $[15] !== ref || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t6) {
71
+ t8 = /*#__PURE__*/_jsx("span", {
72
+ ref: ref,
73
+ role: t2,
74
+ "aria-label": label,
75
+ "aria-hidden": t3,
76
+ ...props,
77
+ className: t4,
78
+ style: t6,
79
+ children: t7
80
+ });
81
+ $[13] = label;
82
+ $[14] = props;
83
+ $[15] = ref;
84
+ $[16] = t2;
85
+ $[17] = t3;
86
+ $[18] = t4;
87
+ $[19] = t6;
88
+ $[20] = t8;
89
+ } else {
90
+ t8 = $[20];
91
+ }
92
+ return t8;
7
93
  }
94
+ function _temp(dot) {
95
+ return /*#__PURE__*/_jsx("span", {
96
+ className: "spinner-hop",
97
+ style: {
98
+ "--spinner-step": dot
99
+ },
100
+ children: /*#__PURE__*/_jsx("span", {
101
+ className: "spinner-dot"
102
+ })
103
+ }, dot);
104
+ }