@ultralabs/glass 0.0.0-stage → 0.1.1
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/CHANGELOG.md +326 -0
- package/DESIGN.md +682 -0
- package/LICENSE +21 -0
- package/README.md +690 -2
- package/dist/esm/index.js +20991 -0
- package/dist/types/src/charts/ULCartesianChart.d.ts +177 -0
- package/dist/types/src/charts/ULDonutChart.d.ts +65 -0
- package/dist/types/src/charts/ULFunnelChart.d.ts +64 -0
- package/dist/types/src/charts/ULHeatmapChart.d.ts +40 -0
- package/dist/types/src/charts/ULRadarChart.d.ts +19 -0
- package/dist/types/src/charts/ULRadialChart.d.ts +48 -0
- package/dist/types/src/charts/ULScatterChart.d.ts +49 -0
- package/dist/types/src/charts/core.d.ts +287 -0
- package/dist/types/src/charts/decimate.d.ts +8 -0
- package/dist/types/src/charts/nav.d.ts +368 -0
- package/dist/types/src/charts/quadtree.d.ts +9 -0
- package/dist/types/src/charts/scales.d.ts +59 -0
- package/dist/types/src/charts/timeseries.d.ts +56 -0
- package/dist/types/src/components/ULAnchoredSurface/ULAnchoredSurface.d.ts +72 -0
- package/dist/types/src/components/ULBatch2/carousel.d.ts +31 -0
- package/dist/types/src/components/ULBatch2/hovercard.d.ts +40 -0
- package/dist/types/src/components/ULBatch2/layout.d.ts +16 -0
- package/dist/types/src/components/ULBatch2/menubar.d.ts +29 -0
- package/dist/types/src/components/ULBatch2/navmenu.d.ts +51 -0
- package/dist/types/src/components/ULBatch2/resizable.d.ts +48 -0
- package/dist/types/src/components/ULBatch2/typography.d.ts +55 -0
- package/dist/types/src/components/ULButton/ULButton.d.ts +87 -0
- package/dist/types/src/components/ULContainers/ULCard.d.ts +54 -0
- package/dist/types/src/components/ULContainers/ULDialog.d.ts +57 -0
- package/dist/types/src/components/ULContainers/ULLayout.d.ts +81 -0
- package/dist/types/src/components/ULContainers/ULMenu.d.ts +99 -0
- package/dist/types/src/components/ULContainers/ULOverlays.d.ts +113 -0
- package/dist/types/src/components/ULContainers/contextTarget.d.ts +91 -0
- package/dist/types/src/components/ULData/ULData.d.ts +225 -0
- package/dist/types/src/components/ULData/ULKpi.d.ts +159 -0
- package/dist/types/src/components/ULField/ULField.d.ts +93 -0
- package/dist/types/src/components/ULForms/fieldContext.d.ts +39 -0
- package/dist/types/src/components/ULForms/forms.d.ts +143 -0
- package/dist/types/src/components/ULIsland/ULIsland.d.ts +39 -0
- package/dist/types/src/components/ULIsland/headerConfig.d.ts +43 -0
- package/dist/types/src/components/ULIsland/navIndicator.d.ts +26 -0
- package/dist/types/src/components/ULListbox/ULListbox.d.ts +75 -0
- package/dist/types/src/components/ULPickers/ULPickers.d.ts +141 -0
- package/dist/types/src/components/ULSegmented/ULSegmented.d.ts +50 -0
- package/dist/types/src/components/ULSelection/ULSelection.d.ts +71 -0
- package/dist/types/src/components/ULSlider/ULSlider.d.ts +43 -0
- package/dist/types/src/components/ULSpinner/ULSpinner.d.ts +8 -0
- package/dist/types/src/components/ULStructure/kbd.d.ts +22 -0
- package/dist/types/src/components/ULStructure/structure.d.ts +154 -0
- package/dist/types/src/components/ULTabs/ULTabs.d.ts +28 -0
- package/dist/types/src/components/ULTooltip/anchoredTooltip.d.ts +22 -0
- package/dist/types/src/components/actions/actions.d.ts +175 -0
- package/dist/types/src/components/actions/core.d.ts +346 -0
- package/dist/types/src/components/dashboard/blocks.d.ts +583 -0
- package/dist/types/src/components/dashboard/blocks2.d.ts +297 -0
- package/dist/types/src/components/dashboard/columnsDrag.d.ts +27 -0
- package/dist/types/src/components/shared/ULCheckMark.d.ts +9 -0
- package/dist/types/src/components/shared/dev.d.ts +13 -0
- package/dist/types/src/components/shared/icons.d.ts +23 -0
- package/dist/types/src/glass/ULGlass.d.ts +78 -0
- package/dist/types/src/glass/ULGlassGroup.d.ts +16 -0
- package/dist/types/src/glass/accent.d.ts +31 -0
- package/dist/types/src/glass/contrast.d.ts +78 -0
- package/dist/types/src/glass/engine.d.ts +177 -0
- package/dist/types/src/glass/glassDebug.d.ts +27 -0
- package/dist/types/src/glass/material.d.ts +49 -0
- package/dist/types/src/glass/radius.d.ts +2 -0
- package/dist/types/src/hooks/useAnchoredMorph.d.ts +20 -0
- package/dist/types/src/hooks/usePointerLight.d.ts +6 -0
- package/dist/types/src/hooks/useReducedMotion.d.ts +3 -0
- package/dist/types/src/index.d.ts +150 -0
- package/dist/types/src/island/sectionAccent.d.ts +18 -0
- package/dist/types/src/live/ULLiveStatus.d.ts +18 -0
- package/dist/types/src/live/liveQueue.d.ts +13 -0
- package/dist/types/src/live/liveSource.d.ts +149 -0
- package/dist/types/src/live/liveStore.d.ts +72 -0
- package/dist/types/src/motion/anchoredMorph.d.ts +175 -0
- package/dist/types/src/motion/goo.d.ts +3 -0
- package/dist/types/src/motion/lensBubble.d.ts +143 -0
- package/dist/types/src/motion/lensSelect.d.ts +31 -0
- package/dist/types/src/motion/overlayStack.d.ts +13 -0
- package/dist/types/src/motion/placement.d.ts +18 -0
- package/dist/types/src/motion/spring.d.ts +20 -0
- package/dist/types/src/motion/topLayer.d.ts +13 -0
- package/dist/types/src/motion/viewSwap.d.ts +33 -0
- package/dist/types/src/motion/virtualAnchor.d.ts +28 -0
- package/dist/ul-glass.css +10519 -0
- package/dist/ul-glass.js +21034 -0
- package/dist/ul-glass.min.js +14 -0
- package/dist/ul-glass.min.js.map +7 -0
- package/icons/arrow-up-down.svg +5 -0
- package/icons/bell.svg +3 -0
- package/icons/bold.svg +2 -0
- package/icons/calendar.svg +5 -0
- package/icons/check.svg +2 -0
- package/icons/chevron-down.svg +2 -0
- package/icons/chevron-left.svg +2 -0
- package/icons/chevron-right.svg +2 -0
- package/icons/chevrons-right.svg +3 -0
- package/icons/circle-check.svg +3 -0
- package/icons/circle-x.svg +4 -0
- package/icons/circle.svg +2 -0
- package/icons/copy.svg +3 -0
- package/icons/ellipsis.svg +4 -0
- package/icons/eye.svg +3 -0
- package/icons/filter.svg +2 -0
- package/icons/flags/LICENSE.md +2 -0
- package/icons/flags/cs.svg +1 -0
- package/icons/flags/de.svg +1 -0
- package/icons/flags/en.svg +1 -0
- package/icons/flags/sk.svg +1 -0
- package/icons/folder-kanban.svg +5 -0
- package/icons/icons.json +1 -0
- package/icons/inbox.svg +3 -0
- package/icons/info.svg +4 -0
- package/icons/layout-dashboard.svg +5 -0
- package/icons/layout-grid.svg +5 -0
- package/icons/loader-circle.svg +2 -0
- package/icons/lock.svg +3 -0
- package/icons/mail.svg +3 -0
- package/icons/menu.svg +4 -0
- package/icons/minus.svg +2 -0
- package/icons/panel-left-close.svg +4 -0
- package/icons/plus.svg +3 -0
- package/icons/refresh-cw.svg +5 -0
- package/icons/search.svg +3 -0
- package/icons/shield-check.svg +3 -0
- package/icons/shopping-bag.svg +4 -0
- package/icons/sparkles.svg +6 -0
- package/icons/trash-2.svg +6 -0
- package/icons/triangle-alert.svg +4 -0
- package/icons/upload.svg +4 -0
- package/icons/users.svg +5 -0
- package/icons/x.svg +3 -0
- package/package.json +65 -4
- package/tokens/tokens.css +799 -0
- package/tokens/tokens.json +1017 -0
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard building blocks (Part 2). Composition only: ULAnchoredSurface (bulk bar), ULMenu / ULMenuButton, ULPopover,
|
|
3
|
+
* ULSelect / fields / pickers, ULCheckMark (via ULMenu), ULRollingNumber, the async action core (ULCopyButton,
|
|
4
|
+
* ULRefreshButton), the shared anchored tooltip (useActionTooltip). No new overlay or animation code, no backend, no URLs.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type MenuItem } from '../ULContainers/ULMenu.js';
|
|
8
|
+
import { type TableColumn } from '../ULData/ULData.js';
|
|
9
|
+
import { type Material } from '../../glass/material.js';
|
|
10
|
+
import './blocks.css';
|
|
11
|
+
declare const T: {
|
|
12
|
+
en: {
|
|
13
|
+
selected: string;
|
|
14
|
+
clear: string;
|
|
15
|
+
selectAll: string;
|
|
16
|
+
columns: string;
|
|
17
|
+
show: string;
|
|
18
|
+
pin: string;
|
|
19
|
+
pinLeft: string;
|
|
20
|
+
pinRight: string;
|
|
21
|
+
unpin: string;
|
|
22
|
+
moveLeft: string;
|
|
23
|
+
moveRight: string;
|
|
24
|
+
density: string;
|
|
25
|
+
compact: string;
|
|
26
|
+
cozy: string;
|
|
27
|
+
comfortable: string;
|
|
28
|
+
reset: string;
|
|
29
|
+
addFilter: string;
|
|
30
|
+
field: string;
|
|
31
|
+
operator: string;
|
|
32
|
+
value: string;
|
|
33
|
+
apply: string;
|
|
34
|
+
clearAll: string;
|
|
35
|
+
views: string;
|
|
36
|
+
saveView: string;
|
|
37
|
+
results: string;
|
|
38
|
+
is: string;
|
|
39
|
+
isNot: string;
|
|
40
|
+
contains: string;
|
|
41
|
+
gt: string;
|
|
42
|
+
lt: string;
|
|
43
|
+
between: string;
|
|
44
|
+
in: string;
|
|
45
|
+
empty: string;
|
|
46
|
+
remove: string;
|
|
47
|
+
edit: string;
|
|
48
|
+
range: string;
|
|
49
|
+
last15m: string;
|
|
50
|
+
last1h: string;
|
|
51
|
+
last24h: string;
|
|
52
|
+
last7d: string;
|
|
53
|
+
last30d: string;
|
|
54
|
+
custom: string;
|
|
55
|
+
auto: string;
|
|
56
|
+
off: string;
|
|
57
|
+
pause: string;
|
|
58
|
+
resume: string;
|
|
59
|
+
reveal: string;
|
|
60
|
+
hide: string;
|
|
61
|
+
copy: string;
|
|
62
|
+
dismiss: string;
|
|
63
|
+
of: string;
|
|
64
|
+
next: string;
|
|
65
|
+
operational: string;
|
|
66
|
+
degraded: string;
|
|
67
|
+
outage: string;
|
|
68
|
+
maintenance: string;
|
|
69
|
+
unknown: string;
|
|
70
|
+
retry: string;
|
|
71
|
+
details: string;
|
|
72
|
+
copyDiag: string;
|
|
73
|
+
loadFailed: string;
|
|
74
|
+
used: string;
|
|
75
|
+
depletes: string;
|
|
76
|
+
perDay: string;
|
|
77
|
+
none: string;
|
|
78
|
+
moved: string;
|
|
79
|
+
dragCancel: string;
|
|
80
|
+
};
|
|
81
|
+
sk: {
|
|
82
|
+
selected: string;
|
|
83
|
+
clear: string;
|
|
84
|
+
selectAll: string;
|
|
85
|
+
columns: string;
|
|
86
|
+
show: string;
|
|
87
|
+
pin: string;
|
|
88
|
+
pinLeft: string;
|
|
89
|
+
pinRight: string;
|
|
90
|
+
unpin: string;
|
|
91
|
+
moveLeft: string;
|
|
92
|
+
moveRight: string;
|
|
93
|
+
density: string;
|
|
94
|
+
compact: string;
|
|
95
|
+
cozy: string;
|
|
96
|
+
comfortable: string;
|
|
97
|
+
reset: string;
|
|
98
|
+
addFilter: string;
|
|
99
|
+
field: string;
|
|
100
|
+
operator: string;
|
|
101
|
+
value: string;
|
|
102
|
+
apply: string;
|
|
103
|
+
clearAll: string;
|
|
104
|
+
views: string;
|
|
105
|
+
saveView: string;
|
|
106
|
+
results: string;
|
|
107
|
+
is: string;
|
|
108
|
+
isNot: string;
|
|
109
|
+
contains: string;
|
|
110
|
+
gt: string;
|
|
111
|
+
lt: string;
|
|
112
|
+
between: string;
|
|
113
|
+
in: string;
|
|
114
|
+
empty: string;
|
|
115
|
+
remove: string;
|
|
116
|
+
edit: string;
|
|
117
|
+
range: string;
|
|
118
|
+
last15m: string;
|
|
119
|
+
last1h: string;
|
|
120
|
+
last24h: string;
|
|
121
|
+
last7d: string;
|
|
122
|
+
last30d: string;
|
|
123
|
+
custom: string;
|
|
124
|
+
auto: string;
|
|
125
|
+
off: string;
|
|
126
|
+
pause: string;
|
|
127
|
+
resume: string;
|
|
128
|
+
reveal: string;
|
|
129
|
+
hide: string;
|
|
130
|
+
copy: string;
|
|
131
|
+
dismiss: string;
|
|
132
|
+
of: string;
|
|
133
|
+
next: string;
|
|
134
|
+
operational: string;
|
|
135
|
+
degraded: string;
|
|
136
|
+
outage: string;
|
|
137
|
+
maintenance: string;
|
|
138
|
+
unknown: string;
|
|
139
|
+
retry: string;
|
|
140
|
+
details: string;
|
|
141
|
+
copyDiag: string;
|
|
142
|
+
loadFailed: string;
|
|
143
|
+
used: string;
|
|
144
|
+
depletes: string;
|
|
145
|
+
perDay: string;
|
|
146
|
+
none: string;
|
|
147
|
+
moved: string;
|
|
148
|
+
dragCancel: string;
|
|
149
|
+
};
|
|
150
|
+
de: {
|
|
151
|
+
selected: string;
|
|
152
|
+
clear: string;
|
|
153
|
+
selectAll: string;
|
|
154
|
+
columns: string;
|
|
155
|
+
show: string;
|
|
156
|
+
pin: string;
|
|
157
|
+
pinLeft: string;
|
|
158
|
+
pinRight: string;
|
|
159
|
+
unpin: string;
|
|
160
|
+
moveLeft: string;
|
|
161
|
+
moveRight: string;
|
|
162
|
+
density: string;
|
|
163
|
+
compact: string;
|
|
164
|
+
cozy: string;
|
|
165
|
+
comfortable: string;
|
|
166
|
+
reset: string;
|
|
167
|
+
addFilter: string;
|
|
168
|
+
field: string;
|
|
169
|
+
operator: string;
|
|
170
|
+
value: string;
|
|
171
|
+
apply: string;
|
|
172
|
+
clearAll: string;
|
|
173
|
+
views: string;
|
|
174
|
+
saveView: string;
|
|
175
|
+
results: string;
|
|
176
|
+
is: string;
|
|
177
|
+
isNot: string;
|
|
178
|
+
contains: string;
|
|
179
|
+
gt: string;
|
|
180
|
+
lt: string;
|
|
181
|
+
between: string;
|
|
182
|
+
in: string;
|
|
183
|
+
empty: string;
|
|
184
|
+
remove: string;
|
|
185
|
+
edit: string;
|
|
186
|
+
range: string;
|
|
187
|
+
last15m: string;
|
|
188
|
+
last1h: string;
|
|
189
|
+
last24h: string;
|
|
190
|
+
last7d: string;
|
|
191
|
+
last30d: string;
|
|
192
|
+
custom: string;
|
|
193
|
+
auto: string;
|
|
194
|
+
off: string;
|
|
195
|
+
pause: string;
|
|
196
|
+
resume: string;
|
|
197
|
+
reveal: string;
|
|
198
|
+
hide: string;
|
|
199
|
+
copy: string;
|
|
200
|
+
dismiss: string;
|
|
201
|
+
of: string;
|
|
202
|
+
next: string;
|
|
203
|
+
operational: string;
|
|
204
|
+
degraded: string;
|
|
205
|
+
outage: string;
|
|
206
|
+
maintenance: string;
|
|
207
|
+
unknown: string;
|
|
208
|
+
retry: string;
|
|
209
|
+
details: string;
|
|
210
|
+
copyDiag: string;
|
|
211
|
+
loadFailed: string;
|
|
212
|
+
used: string;
|
|
213
|
+
depletes: string;
|
|
214
|
+
perDay: string;
|
|
215
|
+
none: string;
|
|
216
|
+
moved: string;
|
|
217
|
+
dragCancel: string;
|
|
218
|
+
};
|
|
219
|
+
cs: {
|
|
220
|
+
selected: string;
|
|
221
|
+
clear: string;
|
|
222
|
+
selectAll: string;
|
|
223
|
+
columns: string;
|
|
224
|
+
show: string;
|
|
225
|
+
pin: string;
|
|
226
|
+
pinLeft: string;
|
|
227
|
+
pinRight: string;
|
|
228
|
+
unpin: string;
|
|
229
|
+
moveLeft: string;
|
|
230
|
+
moveRight: string;
|
|
231
|
+
density: string;
|
|
232
|
+
compact: string;
|
|
233
|
+
cozy: string;
|
|
234
|
+
comfortable: string;
|
|
235
|
+
reset: string;
|
|
236
|
+
addFilter: string;
|
|
237
|
+
field: string;
|
|
238
|
+
operator: string;
|
|
239
|
+
value: string;
|
|
240
|
+
apply: string;
|
|
241
|
+
clearAll: string;
|
|
242
|
+
views: string;
|
|
243
|
+
saveView: string;
|
|
244
|
+
results: string;
|
|
245
|
+
is: string;
|
|
246
|
+
isNot: string;
|
|
247
|
+
contains: string;
|
|
248
|
+
gt: string;
|
|
249
|
+
lt: string;
|
|
250
|
+
between: string;
|
|
251
|
+
in: string;
|
|
252
|
+
empty: string;
|
|
253
|
+
remove: string;
|
|
254
|
+
edit: string;
|
|
255
|
+
range: string;
|
|
256
|
+
last15m: string;
|
|
257
|
+
last1h: string;
|
|
258
|
+
last24h: string;
|
|
259
|
+
last7d: string;
|
|
260
|
+
last30d: string;
|
|
261
|
+
custom: string;
|
|
262
|
+
auto: string;
|
|
263
|
+
off: string;
|
|
264
|
+
pause: string;
|
|
265
|
+
resume: string;
|
|
266
|
+
reveal: string;
|
|
267
|
+
hide: string;
|
|
268
|
+
copy: string;
|
|
269
|
+
dismiss: string;
|
|
270
|
+
of: string;
|
|
271
|
+
next: string;
|
|
272
|
+
operational: string;
|
|
273
|
+
degraded: string;
|
|
274
|
+
outage: string;
|
|
275
|
+
maintenance: string;
|
|
276
|
+
unknown: string;
|
|
277
|
+
retry: string;
|
|
278
|
+
details: string;
|
|
279
|
+
copyDiag: string;
|
|
280
|
+
loadFailed: string;
|
|
281
|
+
used: string;
|
|
282
|
+
depletes: string;
|
|
283
|
+
perDay: string;
|
|
284
|
+
none: string;
|
|
285
|
+
moved: string;
|
|
286
|
+
dragCancel: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
type Key = keyof typeof T.en;
|
|
290
|
+
export declare const blockText: (k: Key, locale?: string, vars?: Record<string, string | number>) => string;
|
|
291
|
+
export interface BulkAction {
|
|
292
|
+
id: string;
|
|
293
|
+
label: string;
|
|
294
|
+
icon?: React.ReactNode;
|
|
295
|
+
destructive?: boolean;
|
|
296
|
+
onAction: (selected: string[]) => unknown;
|
|
297
|
+
disabled?: boolean;
|
|
298
|
+
}
|
|
299
|
+
export interface ULBulkActionBarProps {
|
|
300
|
+
selected: string[]; /** Total rows (enables "Select all n"). */
|
|
301
|
+
total?: number; /** Clears the selection. */
|
|
302
|
+
onClear: () => void; /** Selects all rows. */
|
|
303
|
+
onSelectAll?: () => void; /** Primary actions ({ id, label, icon?, tone?, onAction }). */
|
|
304
|
+
actions: BulkAction[]; /** Extra actions in a menu. */
|
|
305
|
+
more?: MenuItem[]; /** Called with (item id, selected keys) from the overflow menu. */
|
|
306
|
+
onMore?: (id: string, selected: string[]) => void; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
307
|
+
locale?: string; /** Visible label / accessible name. */
|
|
308
|
+
label?: string;
|
|
309
|
+
}
|
|
310
|
+
/** Floating glass bar that pours in from the bottom edge (anchored morph on a viewport-edge anchor) while rows are selected. */
|
|
311
|
+
export declare function ULBulkActionBar({ selected, total, onClear, onSelectAll, actions, more, onMore, locale, label }: ULBulkActionBarProps): React.JSX.Element;
|
|
312
|
+
export interface ColumnsState {
|
|
313
|
+
order: string[];
|
|
314
|
+
hidden: string[];
|
|
315
|
+
pinned: Record<string, 'left' | 'right'>;
|
|
316
|
+
density?: 'compact' | 'cozy' | 'comfortable';
|
|
317
|
+
}
|
|
318
|
+
export declare const defaultColumnsState: (cols: {
|
|
319
|
+
key: string;
|
|
320
|
+
}[]) => ColumnsState;
|
|
321
|
+
/** Columns for ULTable from a state (visibility, order, pin; pinned-left first, pinned-right last). */
|
|
322
|
+
export declare function applyColumns<R>(cols: TableColumn<R>[], s: ColumnsState): TableColumn<R>[];
|
|
323
|
+
/** Per-viewer persistence (localStorage, try / catch; never shared). */
|
|
324
|
+
export declare function useColumnsState(cols: {
|
|
325
|
+
key: string;
|
|
326
|
+
}[], o?: {
|
|
327
|
+
storageKey?: string; /** Called with every committed state. */
|
|
328
|
+
onValueChange?: (s: ColumnsState) => void;
|
|
329
|
+
}): [ColumnsState, (s: ColumnsState) => void];
|
|
330
|
+
/** One item definition for the toolbar button AND the table's header context menu (contextMenuHeader). */
|
|
331
|
+
export declare function columnsMenuItems(cols: {
|
|
332
|
+
key: string;
|
|
333
|
+
header: React.ReactNode;
|
|
334
|
+
}[], s: ColumnsState, set: (s: ColumnsState) => void, o?: {
|
|
335
|
+
locale?: string;
|
|
336
|
+
column?: string;
|
|
337
|
+
defaults?: ColumnsState;
|
|
338
|
+
}): MenuItem[];
|
|
339
|
+
export interface ULColumnsMenuProps {
|
|
340
|
+
columns: {
|
|
341
|
+
key: string;
|
|
342
|
+
header: React.ReactNode;
|
|
343
|
+
}[]; /** Visible / order / pinned state (controlled; see useColumnsState). */
|
|
344
|
+
value: ColumnsState; /** Called with the next state after each change (one commit per drag). */
|
|
345
|
+
onValueChange: (s: ColumnsState) => void; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
346
|
+
locale?: string; /** State restored by "Reset". Default: all visible, default order. */
|
|
347
|
+
defaults?: ColumnsState;
|
|
348
|
+
}
|
|
349
|
+
export declare function ULColumnsMenu({ columns, value, onValueChange, locale, defaults }: ULColumnsMenuProps): React.JSX.Element;
|
|
350
|
+
export type FilterType = 'text' | 'number' | 'date' | 'select' | 'tags';
|
|
351
|
+
export type FilterOp = 'is' | 'isNot' | 'contains' | 'gt' | 'lt' | 'between' | 'in' | 'empty';
|
|
352
|
+
export interface FilterField {
|
|
353
|
+
key: string;
|
|
354
|
+
label: string;
|
|
355
|
+
type: FilterType;
|
|
356
|
+
options?: {
|
|
357
|
+
value: string;
|
|
358
|
+
label: string;
|
|
359
|
+
}[];
|
|
360
|
+
}
|
|
361
|
+
export interface Filter {
|
|
362
|
+
id: string;
|
|
363
|
+
field: string;
|
|
364
|
+
op: FilterOp;
|
|
365
|
+
value?: string | number | string[] | [number, number] | {
|
|
366
|
+
start: string;
|
|
367
|
+
end: string;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
export declare const OPS: Record<FilterType, FilterOp[]>;
|
|
371
|
+
/** URL query (filter=field:op:value; arrays joined with |). */
|
|
372
|
+
export declare function filtersToQuery(fs: Filter[]): string;
|
|
373
|
+
export declare function filtersFromQuery(q: string, fields: FilterField[]): Filter[];
|
|
374
|
+
export declare function applyFilters<R>(rows: R[], fs: Filter[], get?: (r: R, field: string) => unknown): R[];
|
|
375
|
+
export interface SavedView {
|
|
376
|
+
id: string;
|
|
377
|
+
name: string;
|
|
378
|
+
filters: Filter[];
|
|
379
|
+
}
|
|
380
|
+
export interface ULFilterBarProps {
|
|
381
|
+
/** Filterable fields ({ key, label, type: "text" | "number" | "select" | "tags" | "date", options? }). */ fields: FilterField[]; /** Current filters ({ id, field, op, value }). */
|
|
382
|
+
value: Filter[]; /** Called with the next filter list (add, edit, remove, clear all). */
|
|
383
|
+
onValueChange: (f: Filter[]) => void;
|
|
384
|
+
/** Result count shown with a rolling number. */ count?: number;
|
|
385
|
+
/** Saved views shown in the Views menu. */ views?: SavedView[]; /** Called with the chosen saved view. */
|
|
386
|
+
onApplyView?: (v: SavedView) => void; /** Adds "Save view"; called with the current filters. */
|
|
387
|
+
onSaveView?: (filters: Filter[]) => void;
|
|
388
|
+
/** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */ locale?: string; /** Visible label / accessible name. */
|
|
389
|
+
label?: string;
|
|
390
|
+
}
|
|
391
|
+
export declare function ULFilterBar({ fields, value, onValueChange, count, views, onApplyView, onSaveView, locale, label }: ULFilterBarProps): React.JSX.Element;
|
|
392
|
+
/** For tests / HUD: number of live subscribers and whether the one interval runs. */
|
|
393
|
+
export declare const timeAgoStats: () => {
|
|
394
|
+
subscribers: number;
|
|
395
|
+
running: boolean;
|
|
396
|
+
};
|
|
397
|
+
export declare function useSharedNow(): number;
|
|
398
|
+
export declare function relTime(t: number, now: number, locale?: string): string;
|
|
399
|
+
export interface ULTimeAgoProps {
|
|
400
|
+
value: Date | number | string; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
401
|
+
locale?: string; /** IANA time zone for the full date in the title tooltip. */
|
|
402
|
+
timeZone?: string; /** Extra class on the root element. */
|
|
403
|
+
className?: string;
|
|
404
|
+
}
|
|
405
|
+
export declare function ULTimeAgo({ value, locale, timeZone, className }: ULTimeAgoProps): React.JSX.Element;
|
|
406
|
+
export declare function ULTimestamp({ value, locale, timeZone, className, format }: ULTimeAgoProps & {
|
|
407
|
+
format?: Intl.DateTimeFormatOptions;
|
|
408
|
+
}): React.JSX.Element;
|
|
409
|
+
interface CellBase {
|
|
410
|
+
loading?: boolean;
|
|
411
|
+
locale?: string;
|
|
412
|
+
}
|
|
413
|
+
export declare const ULCellStatus: ({ value, tone, loading, locale }: CellBase & {
|
|
414
|
+
value?: string | null;
|
|
415
|
+
tone?: "neutral" | "accent" | "success" | "warning" | "danger";
|
|
416
|
+
}) => React.JSX.Element;
|
|
417
|
+
export declare const ULCellProgress: ({ value, max, label, loading, locale }: CellBase & {
|
|
418
|
+
value?: number | null;
|
|
419
|
+
max?: number;
|
|
420
|
+
label?: string;
|
|
421
|
+
}) => React.JSX.Element;
|
|
422
|
+
export declare const ULCellPerson: ({ name, subtitle, src, loading, locale }: CellBase & {
|
|
423
|
+
name?: string | null;
|
|
424
|
+
subtitle?: string;
|
|
425
|
+
src?: string;
|
|
426
|
+
}) => React.JSX.Element;
|
|
427
|
+
export declare function ULCellNumber({ value, delta, format, compact, loading, locale }: CellBase & {
|
|
428
|
+
value?: number | null;
|
|
429
|
+
delta?: number | null;
|
|
430
|
+
format?: Intl.NumberFormatOptions;
|
|
431
|
+
compact?: boolean;
|
|
432
|
+
}): React.JSX.Element;
|
|
433
|
+
export declare const ULCellTime: ({ value, loading, locale }: CellBase & {
|
|
434
|
+
value?: Date | number | string | null;
|
|
435
|
+
}) => React.JSX.Element;
|
|
436
|
+
export declare const ULCellSparkline: ({ data, loading, locale }: CellBase & {
|
|
437
|
+
data?: number[] | null;
|
|
438
|
+
}) => React.JSX.Element;
|
|
439
|
+
export declare function ULCellTags({ tags, max, loading, locale }: CellBase & {
|
|
440
|
+
tags?: string[] | null;
|
|
441
|
+
max?: number;
|
|
442
|
+
}): React.JSX.Element;
|
|
443
|
+
export declare function ULCellId({ value, loading, locale, copyLabel }: CellBase & {
|
|
444
|
+
value?: string | null;
|
|
445
|
+
copyLabel?: string;
|
|
446
|
+
}): React.JSX.Element;
|
|
447
|
+
export declare const ULCellActions: ({ items, onAction, label, loading }: CellBase & {
|
|
448
|
+
items: MenuItem[];
|
|
449
|
+
onAction?: (id: string) => void;
|
|
450
|
+
label?: string;
|
|
451
|
+
}) => React.JSX.Element;
|
|
452
|
+
export declare const ULCellBool: ({ value, loading, locale, labels }: CellBase & {
|
|
453
|
+
value?: boolean | null;
|
|
454
|
+
labels?: [string, string];
|
|
455
|
+
}) => React.JSX.Element;
|
|
456
|
+
export declare const ULCellLink: ({ href, children, loading, locale }: CellBase & {
|
|
457
|
+
href?: string | null;
|
|
458
|
+
children?: React.ReactNode;
|
|
459
|
+
}) => React.JSX.Element;
|
|
460
|
+
export type RangePreset = '15m' | '1h' | '24h' | '7d' | '30d' | 'custom';
|
|
461
|
+
export interface TimeRangeValue {
|
|
462
|
+
preset: RangePreset;
|
|
463
|
+
from: Date;
|
|
464
|
+
to: Date;
|
|
465
|
+
interval: number;
|
|
466
|
+
}
|
|
467
|
+
export declare const resolveRange: (preset: RangePreset, custom?: {
|
|
468
|
+
start: Date;
|
|
469
|
+
end: Date;
|
|
470
|
+
} | null, now?: number) => {
|
|
471
|
+
from: Date;
|
|
472
|
+
to: Date;
|
|
473
|
+
};
|
|
474
|
+
export interface ULTimeRangeProps {
|
|
475
|
+
value?: RangePreset; /** Called with { preset, from, to, interval } on every change. */
|
|
476
|
+
onValueChange?: (v: TimeRangeValue) => void; /** Auto-refresh interval in ms (0 = off). */
|
|
477
|
+
interval?: number; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
478
|
+
locale?: string; /** Custom range { start, end } for value="custom". */
|
|
479
|
+
custom?: {
|
|
480
|
+
start: Date;
|
|
481
|
+
end: Date;
|
|
482
|
+
} | null; /** "flat" | "glass" for both triggers (inputs category). @default undefined (resolved: "flat") */
|
|
483
|
+
material?: Material;
|
|
484
|
+
}
|
|
485
|
+
export declare function ULTimeRange({ value, onValueChange, interval, locale, custom, material }: ULTimeRangeProps): React.JSX.Element;
|
|
486
|
+
export interface ULRefreshControlProps {
|
|
487
|
+
onRefresh: () => Promise<unknown> | unknown; /** Auto-refresh interval in ms (0 = off). */
|
|
488
|
+
interval?: number; /** Called with the chosen auto-refresh interval. */
|
|
489
|
+
onIntervalChange?: (ms: number) => void; /** Offered intervals in ms (0 = off). */
|
|
490
|
+
intervals?: number[]; /** Last update time (ms epoch). */
|
|
491
|
+
updatedAt?: number | null; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
492
|
+
locale?: string;
|
|
493
|
+
}
|
|
494
|
+
/** Refresh button (leading-trailing coalescing, countdown ring, hidden-tab pause) + interval menu + pause / resume. */
|
|
495
|
+
export declare function ULRefreshControl({ onRefresh, interval: ctl, onIntervalChange, intervals, updatedAt, locale }: ULRefreshControlProps): React.JSX.Element;
|
|
496
|
+
export interface ULCopyFieldProps {
|
|
497
|
+
label: string; /** Value shown and copied (monospace, truncated in the middle of the well). */
|
|
498
|
+
value: string; /** Mask the value with a reveal toggle (re-masks after revealTimeout); never announced. Default false. */
|
|
499
|
+
masked?: boolean; /** Auto-hide the revealed value after ms. Default 15000. */
|
|
500
|
+
revealTimeout?: number; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
501
|
+
locale?: string; /** Extra class on the root element. */
|
|
502
|
+
className?: string; /** "flat" | "glass" (inputs category). @default undefined (resolved: "flat") */
|
|
503
|
+
material?: Material;
|
|
504
|
+
}
|
|
505
|
+
export declare function ULCopyField({ label, value, masked, revealTimeout, locale, className, material }: ULCopyFieldProps): React.JSX.Element;
|
|
506
|
+
export type OpStatus = 'operational' | 'degraded' | 'outage' | 'maintenance' | 'unknown';
|
|
507
|
+
export declare const ULStatusDot: ({ status, live, label, locale }: {
|
|
508
|
+
status: OpStatus;
|
|
509
|
+
live?: boolean;
|
|
510
|
+
label?: string;
|
|
511
|
+
locale?: string;
|
|
512
|
+
}) => React.JSX.Element;
|
|
513
|
+
export declare const ULStatusPill: ({ status, live, label, locale }: {
|
|
514
|
+
status: OpStatus;
|
|
515
|
+
live?: boolean;
|
|
516
|
+
label?: string;
|
|
517
|
+
locale?: string;
|
|
518
|
+
}) => React.JSX.Element;
|
|
519
|
+
export type BannerTone = 'info' | 'success' | 'warning' | 'danger' | 'maintenance';
|
|
520
|
+
export interface BannerItem {
|
|
521
|
+
id: string;
|
|
522
|
+
tone?: BannerTone;
|
|
523
|
+
title: React.ReactNode;
|
|
524
|
+
description?: React.ReactNode;
|
|
525
|
+
action?: React.ReactNode;
|
|
526
|
+
dismissible?: boolean;
|
|
527
|
+
}
|
|
528
|
+
export interface ULBannerProps extends Omit<BannerItem, 'id'> {
|
|
529
|
+
onDismiss?: () => void; /** Stick to the top of the scroll container. Default false. */
|
|
530
|
+
sticky?: boolean; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
531
|
+
locale?: string; /** Extra row under the text. */
|
|
532
|
+
footer?: React.ReactNode;
|
|
533
|
+
}
|
|
534
|
+
export declare function ULBanner({ tone, title, description, action, dismissible, onDismiss, sticky, locale, footer }: ULBannerProps): React.JSX.Element;
|
|
535
|
+
/** One banner at a time; the rest wait in order ("1 of 3 · Next"). */
|
|
536
|
+
export declare function ULBannerQueue({ items, onDismiss, sticky, locale }: {
|
|
537
|
+
items: BannerItem[];
|
|
538
|
+
onDismiss: (id: string) => void;
|
|
539
|
+
sticky?: boolean;
|
|
540
|
+
locale?: string;
|
|
541
|
+
}): React.JSX.Element | null;
|
|
542
|
+
export interface ULUsageMeterProps {
|
|
543
|
+
label: string; /** Value to display. */
|
|
544
|
+
value: number; /** Plan limit; usage = value / limit. */
|
|
545
|
+
limit: number; /** Unit after the numbers (e.g. "GB"). */
|
|
546
|
+
unit?: string; /** per day, for the burn rate and the projected depletion date */
|
|
547
|
+
burnRate?: number; /** Recent values for the inline sparkline. */
|
|
548
|
+
history?: number[]; /** Warning threshold as a fraction of the limit (e.g. .8). */
|
|
549
|
+
warning?: number; /** Critical threshold as a fraction of the limit (e.g. .95). */
|
|
550
|
+
critical?: number; /** Action (e.g. upgrade link) shown past the warning threshold. */
|
|
551
|
+
action?: React.ReactNode; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
552
|
+
locale?: string;
|
|
553
|
+
}
|
|
554
|
+
export declare function ULUsageMeter({ label, value, limit, unit, burnRate, history, warning, critical, action, locale }: ULUsageMeterProps): React.JSX.Element;
|
|
555
|
+
export interface ULErrorStateProps {
|
|
556
|
+
title?: React.ReactNode; /** What went wrong, in plain words. */
|
|
557
|
+
message?: React.ReactNode; /** Shows a Retry action; called when it is pressed. */
|
|
558
|
+
onRetry?: () => Promise<unknown> | unknown; /** Key / value details in a disclosure (copyable; never put secrets here). */
|
|
559
|
+
diagnostics?: Record<string, string | number>; /** Support hint or link. */
|
|
560
|
+
support?: React.ReactNode; /** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default "en". */
|
|
561
|
+
locale?: string;
|
|
562
|
+
/** Inside a popover / drawer / card: no own card, border or glass (no glass inside glass). */
|
|
563
|
+
embedded?: boolean;
|
|
564
|
+
}
|
|
565
|
+
export declare function ULErrorState({ title, message, onRetry, diagnostics, support, locale, embedded }: ULErrorStateProps): React.JSX.Element;
|
|
566
|
+
export interface KeyValueItem {
|
|
567
|
+
label: React.ReactNode;
|
|
568
|
+
value: React.ReactNode;
|
|
569
|
+
copy?: string;
|
|
570
|
+
truncate?: boolean;
|
|
571
|
+
}
|
|
572
|
+
export declare function ULDescriptionList({ items, layout, locale }: {
|
|
573
|
+
items: KeyValueItem[];
|
|
574
|
+
layout?: 'grid' | 'stacked';
|
|
575
|
+
locale?: string;
|
|
576
|
+
}): React.JSX.Element;
|
|
577
|
+
export declare const ULKeyValue: typeof ULDescriptionList;
|
|
578
|
+
export declare function ULTruncatedText({ text, lines, className }: {
|
|
579
|
+
text: string;
|
|
580
|
+
lines?: number;
|
|
581
|
+
className?: string;
|
|
582
|
+
}): React.JSX.Element;
|
|
583
|
+
export {};
|