@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.
- package/dist/AccentSwatches.js +290 -13
- package/dist/Banner.js +90 -9
- package/dist/Button.js +114 -22
- package/dist/ButtonGroup.js +62 -8
- package/dist/Checkbox.js +73 -4
- package/dist/ChoiceCards.js +205 -11
- package/dist/CloseButton.js +87 -7
- package/dist/ColorSwatch.js +132 -15
- package/dist/ColorWheelPicker.js +305 -71
- package/dist/ColumnResizeHandle.js +43 -8
- package/dist/DisabledReason.js +27 -8
- package/dist/DockShell.js +144 -37
- package/dist/EmptyState.js +95 -6
- package/dist/ErrorBoundary.js +254 -31
- package/dist/Field.js +349 -31
- package/dist/FileIcon.js +67 -6
- package/dist/Icon.js +38 -6
- package/dist/IconButton.js +176 -20
- package/dist/IconPicker.js +344 -73
- package/dist/Input.js +233 -14
- package/dist/Kbd.js +150 -10
- package/dist/LazyBoundary.js +14 -5
- package/dist/ListRow.js +75 -15
- package/dist/Meter.js +108 -5
- package/dist/MiddleTruncate.js +126 -45
- package/dist/PanelEmpty.js +64 -5
- package/dist/PanelHeader.js +95 -13
- package/dist/Pill.js +114 -19
- package/dist/ProjectSwitcher.js +225 -12
- package/dist/PromptDialog.js +352 -37
- package/dist/SectionLabel.js +62 -8
- package/dist/SegmentBar.js +197 -36
- package/dist/Segmented.js +130 -23
- package/dist/Select.js +310 -19
- package/dist/SelectSearch.js +344 -29
- package/dist/Separator.js +35 -4
- package/dist/ShortcutHints.js +146 -76
- package/dist/Skeleton.js +31 -4
- package/dist/Slider.js +172 -10
- package/dist/SlidingColumn.js +194 -34
- package/dist/Spinner.js +100 -3
- package/dist/Stepper.js +232 -11
- package/dist/Surface.js +62 -8
- package/dist/Switch.js +60 -6
- package/dist/TextMenu.js +212 -17
- package/dist/Tile.js +149 -5
- package/dist/Toasts.js +391 -33
- package/dist/Tooltip.js +153 -16
- package/dist/UIProvider.js +62 -15
- package/dist/Waveform.js +362 -93
- package/dist/Wipe.js +259 -34
- package/dist/ZoomControls.js +356 -14
- package/dist/class-name.js +1 -1
- package/dist/clipboard.js +15 -17
- package/dist/context-menu/index.parts.js +1 -1
- package/dist/dialog/index.parts.js +1 -1
- package/dist/dialog/parts.js +378 -29
- package/dist/dialog-layer.js +51 -18
- package/dist/error-boundary.js +19 -19
- package/dist/error-message.js +1 -1
- package/dist/field-context.js +7 -5
- package/dist/file-icon.js +23 -21
- package/dist/file-tree/helpers.js +133 -119
- package/dist/file-tree/index.parts.js +3 -3
- package/dist/file-tree/parts.js +418 -127
- package/dist/file-tree/style.js +1 -1
- package/dist/file-tree/use-file-tree-shift.js +43 -30
- package/dist/file-tree/use-file-tree.js +60 -18
- package/dist/file-tree/use-slots.js +220 -192
- package/dist/floating.js +2 -2
- package/dist/format/datetime.js +88 -38
- package/dist/format/duration.js +59 -53
- package/dist/format/index.js +1 -1
- package/dist/format/locale.js +76 -56
- package/dist/format/number.js +77 -61
- package/dist/format/regions.js +4 -2
- package/dist/format/time-zone.js +1 -1
- package/dist/icon-button-size.js +12 -2
- package/dist/icon-picker.js +70 -61
- package/dist/index.js +57 -57
- package/dist/key-value-list/index.parts.js +1 -1
- package/dist/key-value-list/parts.js +256 -22
- package/dist/lazy-landings.js +10 -10
- package/dist/lazy.js +84 -71
- package/dist/locales/en.js +80 -80
- package/dist/locales/nl.js +80 -80
- package/dist/locales.js +10 -7
- package/dist/menu/index.parts.js +1 -1
- package/dist/menu/parts.js +882 -44
- package/dist/merge-refs.js +8 -9
- package/dist/middle-truncate.js +24 -25
- package/dist/modality.js +27 -19
- package/dist/placement.js +11 -20
- package/dist/platform.js +6 -6
- package/dist/popover/index.parts.js +1 -1
- package/dist/popover/parts.js +173 -11
- package/dist/popup-layer.js +38 -17
- package/dist/prefetch.js +78 -79
- package/dist/preview-card/index.parts.js +1 -1
- package/dist/project-switcher-row.js +153 -12
- package/dist/select-row.js +69 -5
- package/dist/select-shared.js +6 -6
- package/dist/selection.js +16 -16
- package/dist/seti-icons.js +413 -413
- package/dist/settings/ConfirmDialog.js +55 -8
- package/dist/settings/DetailHeader.js +72 -4
- package/dist/settings/MasterDetail.js +119 -7
- package/dist/settings/SettingsDialog.js +820 -80
- package/dist/settings/SettingsRow.js +205 -18
- package/dist/settings/SettingsSection.js +96 -6
- package/dist/settings/index.js +7 -7
- package/dist/settings/target.js +7 -2
- package/dist/shortcut-hints.js +73 -55
- package/dist/shortcut.js +140 -104
- package/dist/step-places.js +1 -1
- package/dist/tabs/index.parts.js +1 -1
- package/dist/tabs/overflow.js +18 -18
- package/dist/tabs/parts.js +780 -166
- package/dist/testing/dedupe.js +82 -75
- package/dist/testing/fake-source.js +12 -12
- package/dist/testing/index.js +1 -1
- package/dist/toast-store.js +65 -46
- package/dist/tree/index.parts.js +1 -1
- package/dist/tree/parts.js +721 -94
- package/dist/tree/shift.js +28 -22
- package/dist/tree/style.js +2 -2
- package/dist/tree/use-tree-shift.js +178 -117
- package/dist/useAsyncAction.js +23 -19
- package/dist/useColumnResize.js +36 -34
- package/dist/useContentSize.js +62 -18
- package/dist/useMeasuredWidth.js +14 -3
- package/dist/useNow.js +73 -30
- package/dist/wipe-split.js +14 -14
- package/dist/workspace/DropPreview.js +60 -7
- package/dist/workspace/SplitView.js +1025 -441
- package/dist/workspace/TabStrip.js +810 -191
- package/dist/workspace/Workspace.js +276 -26
- package/dist/workspace/context.js +8 -3
- package/dist/workspace/geometry.js +173 -150
- package/dist/workspace/model.js +313 -250
- package/dist/workspace/preview.js +61 -61
- package/dist/zoom.js +2 -2
- package/package.json +1 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/Field.tsx +4 -3
- package/src/IconPicker.tsx +3 -3
- package/src/LazyBoundary.tsx +2 -0
- package/src/MiddleTruncate.tsx +2 -2
- package/src/SegmentBar.tsx +2 -2
- package/src/Toasts.tsx +3 -1
- package/src/Tooltip.tsx +7 -10
- package/src/Waveform.tsx +3 -3
- package/src/file-tree/parts.tsx +6 -9
- package/src/file-tree/use-file-tree-shift.tsx +6 -9
- package/src/lazy.tsx +4 -0
- package/src/locales/en.ts +4 -4
- package/src/locales/nl.ts +5 -5
- package/src/settings/SettingsDialog.tsx +1 -1
- package/src/tree/parts.tsx +5 -8
- package/src/useContentSize.ts +3 -3
- package/src/workspace/SplitView.tsx +2 -2
- package/src/workspace/TabStrip.tsx +2 -3
- package/src/workspace/Workspace.tsx +2 -5
package/dist/AccentSwatches.js
CHANGED
|
@@ -1,21 +1,298 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Ellipsis } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { ColorSwatch } from
|
|
6
|
-
import { Icon } from
|
|
7
|
-
import { MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuTrigger } from
|
|
8
|
-
import { Tooltip } from
|
|
5
|
+
import { ColorSwatch } from "./ColorSwatch.js";
|
|
6
|
+
import { Icon } from "./Icon.js";
|
|
7
|
+
import { MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuTrigger } from "./menu/parts.js";
|
|
8
|
+
import { Tooltip } from "./Tooltip.js";
|
|
9
9
|
/*
|
|
10
10
|
* An accent, a few colors at a time. A palette is more than a settings row can carry, so the list
|
|
11
11
|
* behind them holds all of them, the featured ones included; the trigger wears the chosen color
|
|
12
12
|
* itself whenever that color is not one of the few. A value that is no accent at all picks nothing.
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
export function AccentSwatches(t0) {
|
|
16
|
+
const $ = _c(73);
|
|
17
|
+
const {
|
|
18
|
+
value,
|
|
19
|
+
onValueChange,
|
|
20
|
+
label,
|
|
21
|
+
accents,
|
|
22
|
+
featured,
|
|
23
|
+
labelOf,
|
|
24
|
+
className,
|
|
25
|
+
ref
|
|
26
|
+
} = t0;
|
|
27
|
+
const {
|
|
28
|
+
t
|
|
29
|
+
} = useTranslation("ui");
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[0] !== featured) {
|
|
32
|
+
t1 = id => featured.some(entry => entry === id);
|
|
33
|
+
$[0] = featured;
|
|
34
|
+
$[1] = t1;
|
|
35
|
+
} else {
|
|
36
|
+
t1 = $[1];
|
|
37
|
+
}
|
|
38
|
+
const isFeatured = t1;
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[2] !== accents) {
|
|
41
|
+
t2 = id_0 => accents.find(entry_0 => entry_0.id === id_0)?.color;
|
|
42
|
+
$[2] = accents;
|
|
43
|
+
$[3] = t2;
|
|
44
|
+
} else {
|
|
45
|
+
t2 = $[3];
|
|
46
|
+
}
|
|
47
|
+
const colorOf = t2;
|
|
48
|
+
let hidden;
|
|
49
|
+
let t3;
|
|
50
|
+
let t4;
|
|
51
|
+
let t5;
|
|
52
|
+
let t6;
|
|
53
|
+
let t7;
|
|
54
|
+
if ($[4] !== accents || $[5] !== className || $[6] !== colorOf || $[7] !== featured || $[8] !== isFeatured || $[9] !== label || $[10] !== labelOf || $[11] !== onValueChange || $[12] !== ref || $[13] !== value) {
|
|
55
|
+
let t8;
|
|
56
|
+
if ($[20] !== isFeatured) {
|
|
57
|
+
t8 = entry_1 => isFeatured(entry_1.id);
|
|
58
|
+
$[20] = isFeatured;
|
|
59
|
+
$[21] = t8;
|
|
60
|
+
} else {
|
|
61
|
+
t8 = $[21];
|
|
62
|
+
}
|
|
63
|
+
let t9;
|
|
64
|
+
if ($[22] !== featured) {
|
|
65
|
+
t9 = (a, b) => featured.indexOf(a.id) - featured.indexOf(b.id);
|
|
66
|
+
$[22] = featured;
|
|
67
|
+
$[23] = t9;
|
|
68
|
+
} else {
|
|
69
|
+
t9 = $[23];
|
|
70
|
+
}
|
|
71
|
+
const shown = accents.filter(t8).sort(t9);
|
|
72
|
+
let t10;
|
|
73
|
+
if ($[24] !== colorOf || $[25] !== isFeatured || $[26] !== value) {
|
|
74
|
+
t10 = value !== undefined && !isFeatured(value) && colorOf(value) !== undefined ? value : null;
|
|
75
|
+
$[24] = colorOf;
|
|
76
|
+
$[25] = isFeatured;
|
|
77
|
+
$[26] = value;
|
|
78
|
+
$[27] = t10;
|
|
79
|
+
} else {
|
|
80
|
+
t10 = $[27];
|
|
81
|
+
}
|
|
82
|
+
hidden = t10;
|
|
83
|
+
t3 = ref;
|
|
84
|
+
if ($[28] !== className) {
|
|
85
|
+
t4 = clsx("flex items-center gap-2", className);
|
|
86
|
+
$[28] = className;
|
|
87
|
+
$[29] = t4;
|
|
88
|
+
} else {
|
|
89
|
+
t4 = $[29];
|
|
90
|
+
}
|
|
91
|
+
t5 = "radiogroup";
|
|
92
|
+
t6 = label;
|
|
93
|
+
let t11;
|
|
94
|
+
if ($[30] !== labelOf || $[31] !== onValueChange || $[32] !== value) {
|
|
95
|
+
t11 = entry_2 => /*#__PURE__*/_jsx(Tooltip, {
|
|
96
|
+
label: labelOf(entry_2.id),
|
|
97
|
+
children: /*#__PURE__*/_jsx(ColorSwatch, {
|
|
98
|
+
role: "radio",
|
|
99
|
+
"aria-checked": value === entry_2.id,
|
|
100
|
+
"aria-label": labelOf(entry_2.id),
|
|
101
|
+
color: entry_2.color,
|
|
102
|
+
picked: value === entry_2.id,
|
|
103
|
+
onClick: () => onValueChange(entry_2.id)
|
|
104
|
+
})
|
|
105
|
+
}, entry_2.id);
|
|
106
|
+
$[30] = labelOf;
|
|
107
|
+
$[31] = onValueChange;
|
|
108
|
+
$[32] = value;
|
|
109
|
+
$[33] = t11;
|
|
110
|
+
} else {
|
|
111
|
+
t11 = $[33];
|
|
112
|
+
}
|
|
113
|
+
t7 = shown.map(t11);
|
|
114
|
+
$[4] = accents;
|
|
115
|
+
$[5] = className;
|
|
116
|
+
$[6] = colorOf;
|
|
117
|
+
$[7] = featured;
|
|
118
|
+
$[8] = isFeatured;
|
|
119
|
+
$[9] = label;
|
|
120
|
+
$[10] = labelOf;
|
|
121
|
+
$[11] = onValueChange;
|
|
122
|
+
$[12] = ref;
|
|
123
|
+
$[13] = value;
|
|
124
|
+
$[14] = hidden;
|
|
125
|
+
$[15] = t3;
|
|
126
|
+
$[16] = t4;
|
|
127
|
+
$[17] = t5;
|
|
128
|
+
$[18] = t6;
|
|
129
|
+
$[19] = t7;
|
|
130
|
+
} else {
|
|
131
|
+
hidden = $[14];
|
|
132
|
+
t3 = $[15];
|
|
133
|
+
t4 = $[16];
|
|
134
|
+
t5 = $[17];
|
|
135
|
+
t6 = $[18];
|
|
136
|
+
t7 = $[19];
|
|
137
|
+
}
|
|
138
|
+
let t8;
|
|
139
|
+
if ($[34] !== t) {
|
|
140
|
+
t8 = t("accent.more");
|
|
141
|
+
$[34] = t;
|
|
142
|
+
$[35] = t8;
|
|
143
|
+
} else {
|
|
144
|
+
t8 = $[35];
|
|
145
|
+
}
|
|
146
|
+
let t9;
|
|
147
|
+
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
148
|
+
t9 = /*#__PURE__*/_jsx(MenuTrigger, {});
|
|
149
|
+
$[36] = t9;
|
|
150
|
+
} else {
|
|
151
|
+
t9 = $[36];
|
|
152
|
+
}
|
|
153
|
+
let t10;
|
|
154
|
+
if ($[37] !== t) {
|
|
155
|
+
t10 = t("accent.more");
|
|
156
|
+
$[37] = t;
|
|
157
|
+
$[38] = t10;
|
|
158
|
+
} else {
|
|
159
|
+
t10 = $[38];
|
|
160
|
+
}
|
|
161
|
+
let t11;
|
|
162
|
+
if ($[39] !== colorOf || $[40] !== hidden) {
|
|
163
|
+
t11 = hidden === null ? undefined : colorOf(hidden);
|
|
164
|
+
$[39] = colorOf;
|
|
165
|
+
$[40] = hidden;
|
|
166
|
+
$[41] = t11;
|
|
167
|
+
} else {
|
|
168
|
+
t11 = $[41];
|
|
169
|
+
}
|
|
170
|
+
const t12 = hidden !== null;
|
|
171
|
+
let t13;
|
|
172
|
+
if ($[42] !== hidden) {
|
|
173
|
+
t13 = hidden === null ? /*#__PURE__*/_jsx(Icon, {
|
|
174
|
+
icon: Ellipsis,
|
|
175
|
+
size: 12
|
|
176
|
+
}) : undefined;
|
|
177
|
+
$[42] = hidden;
|
|
178
|
+
$[43] = t13;
|
|
179
|
+
} else {
|
|
180
|
+
t13 = $[43];
|
|
181
|
+
}
|
|
182
|
+
let t14;
|
|
183
|
+
if ($[44] !== t10 || $[45] !== t11 || $[46] !== t12 || $[47] !== t13) {
|
|
184
|
+
t14 = /*#__PURE__*/_jsx(ColorSwatch, {
|
|
185
|
+
render: t9,
|
|
186
|
+
"aria-label": t10,
|
|
187
|
+
color: t11,
|
|
188
|
+
picked: t12,
|
|
189
|
+
children: t13
|
|
190
|
+
});
|
|
191
|
+
$[44] = t10;
|
|
192
|
+
$[45] = t11;
|
|
193
|
+
$[46] = t12;
|
|
194
|
+
$[47] = t13;
|
|
195
|
+
$[48] = t14;
|
|
196
|
+
} else {
|
|
197
|
+
t14 = $[48];
|
|
198
|
+
}
|
|
199
|
+
let t15;
|
|
200
|
+
if ($[49] !== t14 || $[50] !== t8) {
|
|
201
|
+
t15 = /*#__PURE__*/_jsx(Tooltip, {
|
|
202
|
+
label: t8,
|
|
203
|
+
children: t14
|
|
204
|
+
});
|
|
205
|
+
$[49] = t14;
|
|
206
|
+
$[50] = t8;
|
|
207
|
+
$[51] = t15;
|
|
208
|
+
} else {
|
|
209
|
+
t15 = $[51];
|
|
210
|
+
}
|
|
211
|
+
const t16 = value ?? null;
|
|
212
|
+
let t17;
|
|
213
|
+
if ($[52] !== onValueChange) {
|
|
214
|
+
t17 = id_1 => onValueChange(id_1);
|
|
215
|
+
$[52] = onValueChange;
|
|
216
|
+
$[53] = t17;
|
|
217
|
+
} else {
|
|
218
|
+
t17 = $[53];
|
|
219
|
+
}
|
|
220
|
+
let t18;
|
|
221
|
+
if ($[54] !== accents || $[55] !== labelOf) {
|
|
222
|
+
let t19;
|
|
223
|
+
if ($[57] !== labelOf) {
|
|
224
|
+
t19 = entry_3 => /*#__PURE__*/_jsxs(MenuRadioItem, {
|
|
225
|
+
value: entry_3.id,
|
|
226
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
227
|
+
className: "h-3 w-3 shrink-0 rounded-full",
|
|
228
|
+
style: {
|
|
229
|
+
background: entry_3.color
|
|
230
|
+
},
|
|
231
|
+
"aria-hidden": true
|
|
232
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
233
|
+
className: "grow",
|
|
234
|
+
children: labelOf(entry_3.id)
|
|
235
|
+
})]
|
|
236
|
+
}, entry_3.id);
|
|
237
|
+
$[57] = labelOf;
|
|
238
|
+
$[58] = t19;
|
|
239
|
+
} else {
|
|
240
|
+
t19 = $[58];
|
|
241
|
+
}
|
|
242
|
+
t18 = accents.map(t19);
|
|
243
|
+
$[54] = accents;
|
|
244
|
+
$[55] = labelOf;
|
|
245
|
+
$[56] = t18;
|
|
246
|
+
} else {
|
|
247
|
+
t18 = $[56];
|
|
248
|
+
}
|
|
249
|
+
let t19;
|
|
250
|
+
if ($[59] !== t16 || $[60] !== t17 || $[61] !== t18) {
|
|
251
|
+
t19 = /*#__PURE__*/_jsx(MenuPopup, {
|
|
252
|
+
align: "end",
|
|
253
|
+
className: "max-h-96 overflow-y-auto",
|
|
254
|
+
children: /*#__PURE__*/_jsx(MenuRadioGroup, {
|
|
255
|
+
value: t16,
|
|
256
|
+
onValueChange: t17,
|
|
257
|
+
children: t18
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
$[59] = t16;
|
|
261
|
+
$[60] = t17;
|
|
262
|
+
$[61] = t18;
|
|
263
|
+
$[62] = t19;
|
|
264
|
+
} else {
|
|
265
|
+
t19 = $[62];
|
|
266
|
+
}
|
|
267
|
+
let t20;
|
|
268
|
+
if ($[63] !== t15 || $[64] !== t19) {
|
|
269
|
+
t20 = /*#__PURE__*/_jsxs(MenuRoot, {
|
|
270
|
+
children: [t15, t19]
|
|
271
|
+
});
|
|
272
|
+
$[63] = t15;
|
|
273
|
+
$[64] = t19;
|
|
274
|
+
$[65] = t20;
|
|
275
|
+
} else {
|
|
276
|
+
t20 = $[65];
|
|
277
|
+
}
|
|
278
|
+
let t21;
|
|
279
|
+
if ($[66] !== t20 || $[67] !== t3 || $[68] !== t4 || $[69] !== t5 || $[70] !== t6 || $[71] !== t7) {
|
|
280
|
+
t21 = /*#__PURE__*/_jsxs("div", {
|
|
281
|
+
ref: t3,
|
|
282
|
+
className: t4,
|
|
283
|
+
role: t5,
|
|
284
|
+
"aria-label": t6,
|
|
285
|
+
children: [t7, t20]
|
|
286
|
+
});
|
|
287
|
+
$[66] = t20;
|
|
288
|
+
$[67] = t3;
|
|
289
|
+
$[68] = t4;
|
|
290
|
+
$[69] = t5;
|
|
291
|
+
$[70] = t6;
|
|
292
|
+
$[71] = t7;
|
|
293
|
+
$[72] = t21;
|
|
294
|
+
} else {
|
|
295
|
+
t21 = $[72];
|
|
296
|
+
}
|
|
297
|
+
return t21;
|
|
298
|
+
}
|
package/dist/Banner.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { Icon } from
|
|
4
|
-
import { Surface } from
|
|
3
|
+
import { Icon } from "./Icon.js";
|
|
4
|
+
import { Surface } from "./Surface.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
const TONE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
attention: 'text-status-needs-you',
|
|
8
|
+
error: 'text-status-error',
|
|
9
|
+
neutral: 'text-text-muted'
|
|
9
10
|
};
|
|
10
11
|
/*
|
|
11
12
|
* The strip over a view: one line and the buttons that answer it. It is where anything that waits
|
|
@@ -13,6 +14,86 @@ const TONE = {
|
|
|
13
14
|
* and a decision has to be where the eyes already are. One at a time: the slot is one row and the
|
|
14
15
|
* caller picks what stands in it.
|
|
15
16
|
*/
|
|
16
|
-
export function Banner(
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
export function Banner(t0) {
|
|
18
|
+
const $ = _c(17);
|
|
19
|
+
const {
|
|
20
|
+
icon,
|
|
21
|
+
tone,
|
|
22
|
+
message,
|
|
23
|
+
children,
|
|
24
|
+
className: t1,
|
|
25
|
+
ref
|
|
26
|
+
} = t0;
|
|
27
|
+
const className = t1 === undefined ? "absolute inset-x-0 top-3 z-20" : t1;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[0] !== className) {
|
|
30
|
+
t2 = clsx("pointer-events-auto flex justify-center px-4", className);
|
|
31
|
+
$[0] = className;
|
|
32
|
+
$[1] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t2 = $[1];
|
|
35
|
+
}
|
|
36
|
+
const t3 = TONE[tone];
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[2] !== t3) {
|
|
39
|
+
t4 = clsx("shrink-0", t3);
|
|
40
|
+
$[2] = t3;
|
|
41
|
+
$[3] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t4 = $[3];
|
|
44
|
+
}
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[4] !== icon || $[5] !== t4) {
|
|
47
|
+
t5 = /*#__PURE__*/_jsx(Icon, {
|
|
48
|
+
icon: icon,
|
|
49
|
+
size: 16,
|
|
50
|
+
className: t4
|
|
51
|
+
});
|
|
52
|
+
$[4] = icon;
|
|
53
|
+
$[5] = t4;
|
|
54
|
+
$[6] = t5;
|
|
55
|
+
} else {
|
|
56
|
+
t5 = $[6];
|
|
57
|
+
}
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[7] !== message) {
|
|
60
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
61
|
+
className: "grow",
|
|
62
|
+
children: message
|
|
63
|
+
});
|
|
64
|
+
$[7] = message;
|
|
65
|
+
$[8] = t6;
|
|
66
|
+
} else {
|
|
67
|
+
t6 = $[8];
|
|
68
|
+
}
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[9] !== children || $[10] !== t5 || $[11] !== t6) {
|
|
71
|
+
t7 = /*#__PURE__*/_jsxs(Surface, {
|
|
72
|
+
className: "flex max-w-[640px] items-center gap-3 rounded-lg px-3 py-2 text-sm text-text",
|
|
73
|
+
children: [t5, t6, children]
|
|
74
|
+
});
|
|
75
|
+
$[9] = children;
|
|
76
|
+
$[10] = t5;
|
|
77
|
+
$[11] = t6;
|
|
78
|
+
$[12] = t7;
|
|
79
|
+
} else {
|
|
80
|
+
t7 = $[12];
|
|
81
|
+
}
|
|
82
|
+
let t8;
|
|
83
|
+
if ($[13] !== ref || $[14] !== t2 || $[15] !== t7) {
|
|
84
|
+
t8 = /*#__PURE__*/_jsx("div", {
|
|
85
|
+
ref: ref,
|
|
86
|
+
className: t2,
|
|
87
|
+
role: "status",
|
|
88
|
+
"aria-live": "polite",
|
|
89
|
+
children: t7
|
|
90
|
+
});
|
|
91
|
+
$[13] = ref;
|
|
92
|
+
$[14] = t2;
|
|
93
|
+
$[15] = t7;
|
|
94
|
+
$[16] = t8;
|
|
95
|
+
} else {
|
|
96
|
+
t8 = $[16];
|
|
97
|
+
}
|
|
98
|
+
return t8;
|
|
99
|
+
}
|
package/dist/Button.js
CHANGED
|
@@ -1,33 +1,125 @@
|
|
|
1
|
-
import {
|
|
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 VARIANT = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
// A filled button darkens under the pointer. Its color is the meaning, so no token of its own for hover.
|
|
6
|
+
primary: 'bg-accent text-accent-text hover:brightness-90 disabled:hover:brightness-100',
|
|
7
|
+
secondary: 'border border-border bg-surface-raised text-text hover:bg-surface-hover disabled:hover:bg-surface-raised',
|
|
8
|
+
ghost: 'text-text-muted hover:bg-surface-hover hover:text-text',
|
|
9
|
+
danger: 'bg-status-error text-accent-text hover:brightness-90 disabled:hover:brightness-100',
|
|
10
|
+
// A step that forgets something rather than destroys it: softer than the filled button of a deletion that cannot come back.
|
|
11
|
+
'danger-outline': 'border border-status-error/35 text-status-error hover:bg-status-error/10 disabled:hover:bg-transparent',
|
|
12
|
+
positive: 'bg-positive text-positive-text hover:brightness-90 disabled:hover:brightness-100',
|
|
13
|
+
// Dark on a light theme, light on a dark one, matching what Apple's and GitHub's sign-in buttons ask for.
|
|
14
|
+
inverse: 'bg-text text-bg hover:opacity-90 disabled:hover:opacity-100'
|
|
14
15
|
};
|
|
15
16
|
/* 28 and 32 pixels are the compact and the normal control; 24 fits a header of 32. */
|
|
16
17
|
const SIZE = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
xs: 'h-6 px-2',
|
|
19
|
+
sm: 'h-7 px-2.5',
|
|
20
|
+
md: 'h-8 px-3'
|
|
20
21
|
};
|
|
21
22
|
/* A pill is one size of its own, for a control that sits in a round row, so it takes the place of `size`. */
|
|
22
23
|
const SHAPE = {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
default: 'rounded-md text-xs',
|
|
25
|
+
pill: 'h-9 rounded-full px-3.5 text-sm'
|
|
25
26
|
};
|
|
26
27
|
/* Every button with a word in it. A button that is only an icon is an `IconButton`, which is a square, not a label. */
|
|
27
|
-
export function Button(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export function Button(t0) {
|
|
29
|
+
const $ = _c(24);
|
|
30
|
+
let className;
|
|
31
|
+
let href;
|
|
32
|
+
let ref;
|
|
33
|
+
let rest;
|
|
34
|
+
let t1;
|
|
35
|
+
let t2;
|
|
36
|
+
let t3;
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[0] !== t0) {
|
|
39
|
+
({
|
|
40
|
+
variant: t1,
|
|
41
|
+
size: t2,
|
|
42
|
+
shape: t3,
|
|
43
|
+
className,
|
|
44
|
+
href,
|
|
45
|
+
type: t4,
|
|
46
|
+
ref,
|
|
47
|
+
...rest
|
|
48
|
+
} = t0);
|
|
49
|
+
$[0] = t0;
|
|
50
|
+
$[1] = className;
|
|
51
|
+
$[2] = href;
|
|
52
|
+
$[3] = ref;
|
|
53
|
+
$[4] = rest;
|
|
54
|
+
$[5] = t1;
|
|
55
|
+
$[6] = t2;
|
|
56
|
+
$[7] = t3;
|
|
57
|
+
$[8] = t4;
|
|
58
|
+
} else {
|
|
59
|
+
className = $[1];
|
|
60
|
+
href = $[2];
|
|
61
|
+
ref = $[3];
|
|
62
|
+
rest = $[4];
|
|
63
|
+
t1 = $[5];
|
|
64
|
+
t2 = $[6];
|
|
65
|
+
t3 = $[7];
|
|
66
|
+
t4 = $[8];
|
|
67
|
+
}
|
|
68
|
+
const variant = t1 === undefined ? "ghost" : t1;
|
|
69
|
+
const size = t2 === undefined ? "md" : t2;
|
|
70
|
+
const shape = t3 === undefined ? "default" : t3;
|
|
71
|
+
const type = t4 === undefined ? "button" : t4;
|
|
72
|
+
const t5 = SHAPE[shape];
|
|
73
|
+
const t6 = VARIANT[variant];
|
|
74
|
+
const t7 = shape === "default" && SIZE[size];
|
|
75
|
+
let t8;
|
|
76
|
+
if ($[9] !== className || $[10] !== t5 || $[11] !== t6 || $[12] !== t7) {
|
|
77
|
+
t8 = clsx("inline-flex shrink-0 items-center justify-center gap-1.5 font-medium disabled:opacity-50", t5, t6, t7, className);
|
|
78
|
+
$[9] = className;
|
|
79
|
+
$[10] = t5;
|
|
80
|
+
$[11] = t6;
|
|
81
|
+
$[12] = t7;
|
|
82
|
+
$[13] = t8;
|
|
83
|
+
} else {
|
|
84
|
+
t8 = $[13];
|
|
85
|
+
}
|
|
86
|
+
const classes = t8;
|
|
87
|
+
if (href) {
|
|
88
|
+
let t9;
|
|
89
|
+
if ($[14] !== classes || $[15] !== href || $[16] !== ref || $[17] !== rest) {
|
|
90
|
+
t9 = /*#__PURE__*/_jsx("a", {
|
|
91
|
+
ref: ref,
|
|
92
|
+
className: classes,
|
|
93
|
+
href: href,
|
|
94
|
+
target: "_blank",
|
|
95
|
+
rel: "noreferrer",
|
|
96
|
+
...rest
|
|
97
|
+
});
|
|
98
|
+
$[14] = classes;
|
|
99
|
+
$[15] = href;
|
|
100
|
+
$[16] = ref;
|
|
101
|
+
$[17] = rest;
|
|
102
|
+
$[18] = t9;
|
|
103
|
+
} else {
|
|
104
|
+
t9 = $[18];
|
|
31
105
|
}
|
|
32
|
-
return
|
|
33
|
-
}
|
|
106
|
+
return t9;
|
|
107
|
+
}
|
|
108
|
+
let t9;
|
|
109
|
+
if ($[19] !== classes || $[20] !== ref || $[21] !== rest || $[22] !== type) {
|
|
110
|
+
t9 = /*#__PURE__*/_jsx("button", {
|
|
111
|
+
ref: ref,
|
|
112
|
+
type: type,
|
|
113
|
+
className: classes,
|
|
114
|
+
...rest
|
|
115
|
+
});
|
|
116
|
+
$[19] = classes;
|
|
117
|
+
$[20] = ref;
|
|
118
|
+
$[21] = rest;
|
|
119
|
+
$[22] = type;
|
|
120
|
+
$[23] = t9;
|
|
121
|
+
} else {
|
|
122
|
+
t9 = $[23];
|
|
123
|
+
}
|
|
124
|
+
return t9;
|
|
125
|
+
}
|
package/dist/ButtonGroup.js
CHANGED
|
@@ -1,11 +1,65 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
4
|
/* Icon buttons that belong together sit 1px apart; groups keep the wider gap of their container. */
|
|
4
|
-
export function ButtonGroup(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export function ButtonGroup(t0) {
|
|
6
|
+
const $ = _c(14);
|
|
7
|
+
let className;
|
|
8
|
+
let props;
|
|
9
|
+
let ref;
|
|
10
|
+
let render;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({
|
|
13
|
+
render,
|
|
14
|
+
className,
|
|
15
|
+
ref,
|
|
16
|
+
...props
|
|
17
|
+
} = t0);
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
$[1] = className;
|
|
20
|
+
$[2] = props;
|
|
21
|
+
$[3] = ref;
|
|
22
|
+
$[4] = render;
|
|
23
|
+
} else {
|
|
24
|
+
className = $[1];
|
|
25
|
+
props = $[2];
|
|
26
|
+
ref = $[3];
|
|
27
|
+
render = $[4];
|
|
28
|
+
}
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[5] !== className) {
|
|
31
|
+
t1 = clsx("inline-flex items-center gap-px", className);
|
|
32
|
+
$[5] = className;
|
|
33
|
+
$[6] = t1;
|
|
34
|
+
} else {
|
|
35
|
+
t1 = $[6];
|
|
36
|
+
}
|
|
37
|
+
let t2;
|
|
38
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
39
|
+
t2 = {
|
|
40
|
+
...props,
|
|
41
|
+
className: t1
|
|
42
|
+
};
|
|
43
|
+
$[7] = props;
|
|
44
|
+
$[8] = t1;
|
|
45
|
+
$[9] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[9];
|
|
48
|
+
}
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
51
|
+
t3 = {
|
|
52
|
+
render,
|
|
53
|
+
ref,
|
|
54
|
+
defaultTagName: "div",
|
|
55
|
+
props: t2
|
|
56
|
+
};
|
|
57
|
+
$[10] = ref;
|
|
58
|
+
$[11] = render;
|
|
59
|
+
$[12] = t2;
|
|
60
|
+
$[13] = t3;
|
|
61
|
+
} else {
|
|
62
|
+
t3 = $[13];
|
|
63
|
+
}
|
|
64
|
+
return useRender(t3);
|
|
65
|
+
}
|