@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,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async actions (Part 1): ONE core for every ready-made action component.
|
|
3
|
+
* useAsyncAction = the state machine (idle → loading → success | error → idle), min loading time, double-submit guard,
|
|
4
|
+
* interruption, controlled mode, timers cleared on unmount. ULActionButton = ULButton + the animated icon / label swap,
|
|
5
|
+
* width morph, success ring, error shake, tooltip feedback (createAnchoredTooltip) and a polite live region.
|
|
6
|
+
* No new overlay or animation system: tooltips are the shared anchored tooltip, the check is ULCheckMark, motion values
|
|
7
|
+
* come from --ul-action-* tokens.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { type ULButtonProps } from '../ULButton/ULButton.js';
|
|
11
|
+
import './actions.css';
|
|
12
|
+
declare const DICT: {
|
|
13
|
+
en: {
|
|
14
|
+
working: string;
|
|
15
|
+
done: string;
|
|
16
|
+
failed: string;
|
|
17
|
+
retry: string;
|
|
18
|
+
copy: string;
|
|
19
|
+
copied: string;
|
|
20
|
+
copiedLong: string;
|
|
21
|
+
copyFailed: string;
|
|
22
|
+
save: string;
|
|
23
|
+
saving: string;
|
|
24
|
+
saved: string;
|
|
25
|
+
saveFailed: string;
|
|
26
|
+
unsaved: string;
|
|
27
|
+
savedNow: string;
|
|
28
|
+
savedAgo: string;
|
|
29
|
+
submit: string;
|
|
30
|
+
submitting: string;
|
|
31
|
+
submitted: string;
|
|
32
|
+
submitFailed: string;
|
|
33
|
+
confirm: string;
|
|
34
|
+
hold: string;
|
|
35
|
+
typeToConfirm: string;
|
|
36
|
+
cancel: string;
|
|
37
|
+
delete: string;
|
|
38
|
+
download: string;
|
|
39
|
+
exporting: string;
|
|
40
|
+
downloading: string;
|
|
41
|
+
downloaded: string;
|
|
42
|
+
downloadFailed: string;
|
|
43
|
+
export: string;
|
|
44
|
+
format: string;
|
|
45
|
+
refresh: string;
|
|
46
|
+
refreshing: string;
|
|
47
|
+
updatedNow: string;
|
|
48
|
+
updatedAgo: string;
|
|
49
|
+
refreshFailed: string;
|
|
50
|
+
share: string;
|
|
51
|
+
shared: string;
|
|
52
|
+
linkCopied: string;
|
|
53
|
+
undo: string;
|
|
54
|
+
undone: string;
|
|
55
|
+
on: string;
|
|
56
|
+
off: string;
|
|
57
|
+
changeFailed: string;
|
|
58
|
+
publish: string;
|
|
59
|
+
publishing: string;
|
|
60
|
+
published: string;
|
|
61
|
+
unpublish: string;
|
|
62
|
+
publishFailed: string;
|
|
63
|
+
};
|
|
64
|
+
sk: {
|
|
65
|
+
working: string;
|
|
66
|
+
done: string;
|
|
67
|
+
failed: string;
|
|
68
|
+
retry: string;
|
|
69
|
+
copy: string;
|
|
70
|
+
copied: string;
|
|
71
|
+
copiedLong: string;
|
|
72
|
+
copyFailed: string;
|
|
73
|
+
save: string;
|
|
74
|
+
saving: string;
|
|
75
|
+
saved: string;
|
|
76
|
+
saveFailed: string;
|
|
77
|
+
unsaved: string;
|
|
78
|
+
savedNow: string;
|
|
79
|
+
savedAgo: string;
|
|
80
|
+
submit: string;
|
|
81
|
+
submitting: string;
|
|
82
|
+
submitted: string;
|
|
83
|
+
submitFailed: string;
|
|
84
|
+
confirm: string;
|
|
85
|
+
hold: string;
|
|
86
|
+
typeToConfirm: string;
|
|
87
|
+
cancel: string;
|
|
88
|
+
delete: string;
|
|
89
|
+
download: string;
|
|
90
|
+
exporting: string;
|
|
91
|
+
downloading: string;
|
|
92
|
+
downloaded: string;
|
|
93
|
+
downloadFailed: string;
|
|
94
|
+
export: string;
|
|
95
|
+
format: string;
|
|
96
|
+
refresh: string;
|
|
97
|
+
refreshing: string;
|
|
98
|
+
updatedNow: string;
|
|
99
|
+
updatedAgo: string;
|
|
100
|
+
refreshFailed: string;
|
|
101
|
+
share: string;
|
|
102
|
+
shared: string;
|
|
103
|
+
linkCopied: string;
|
|
104
|
+
undo: string;
|
|
105
|
+
undone: string;
|
|
106
|
+
on: string;
|
|
107
|
+
off: string;
|
|
108
|
+
changeFailed: string;
|
|
109
|
+
publish: string;
|
|
110
|
+
publishing: string;
|
|
111
|
+
published: string;
|
|
112
|
+
unpublish: string;
|
|
113
|
+
publishFailed: string;
|
|
114
|
+
};
|
|
115
|
+
de: {
|
|
116
|
+
working: string;
|
|
117
|
+
done: string;
|
|
118
|
+
failed: string;
|
|
119
|
+
retry: string;
|
|
120
|
+
copy: string;
|
|
121
|
+
copied: string;
|
|
122
|
+
copiedLong: string;
|
|
123
|
+
copyFailed: string;
|
|
124
|
+
save: string;
|
|
125
|
+
saving: string;
|
|
126
|
+
saved: string;
|
|
127
|
+
saveFailed: string;
|
|
128
|
+
unsaved: string;
|
|
129
|
+
savedNow: string;
|
|
130
|
+
savedAgo: string;
|
|
131
|
+
submit: string;
|
|
132
|
+
submitting: string;
|
|
133
|
+
submitted: string;
|
|
134
|
+
submitFailed: string;
|
|
135
|
+
confirm: string;
|
|
136
|
+
hold: string;
|
|
137
|
+
typeToConfirm: string;
|
|
138
|
+
cancel: string;
|
|
139
|
+
delete: string;
|
|
140
|
+
download: string;
|
|
141
|
+
exporting: string;
|
|
142
|
+
downloading: string;
|
|
143
|
+
downloaded: string;
|
|
144
|
+
downloadFailed: string;
|
|
145
|
+
export: string;
|
|
146
|
+
format: string;
|
|
147
|
+
refresh: string;
|
|
148
|
+
refreshing: string;
|
|
149
|
+
updatedNow: string;
|
|
150
|
+
updatedAgo: string;
|
|
151
|
+
refreshFailed: string;
|
|
152
|
+
share: string;
|
|
153
|
+
shared: string;
|
|
154
|
+
linkCopied: string;
|
|
155
|
+
undo: string;
|
|
156
|
+
undone: string;
|
|
157
|
+
on: string;
|
|
158
|
+
off: string;
|
|
159
|
+
changeFailed: string;
|
|
160
|
+
publish: string;
|
|
161
|
+
publishing: string;
|
|
162
|
+
published: string;
|
|
163
|
+
unpublish: string;
|
|
164
|
+
publishFailed: string;
|
|
165
|
+
};
|
|
166
|
+
cs: {
|
|
167
|
+
working: string;
|
|
168
|
+
done: string;
|
|
169
|
+
failed: string;
|
|
170
|
+
retry: string;
|
|
171
|
+
copy: string;
|
|
172
|
+
copied: string;
|
|
173
|
+
copiedLong: string;
|
|
174
|
+
copyFailed: string;
|
|
175
|
+
save: string;
|
|
176
|
+
saving: string;
|
|
177
|
+
saved: string;
|
|
178
|
+
saveFailed: string;
|
|
179
|
+
unsaved: string;
|
|
180
|
+
savedNow: string;
|
|
181
|
+
savedAgo: string;
|
|
182
|
+
submit: string;
|
|
183
|
+
submitting: string;
|
|
184
|
+
submitted: string;
|
|
185
|
+
submitFailed: string;
|
|
186
|
+
confirm: string;
|
|
187
|
+
hold: string;
|
|
188
|
+
typeToConfirm: string;
|
|
189
|
+
cancel: string;
|
|
190
|
+
delete: string;
|
|
191
|
+
download: string;
|
|
192
|
+
exporting: string;
|
|
193
|
+
downloading: string;
|
|
194
|
+
downloaded: string;
|
|
195
|
+
downloadFailed: string;
|
|
196
|
+
export: string;
|
|
197
|
+
format: string;
|
|
198
|
+
refresh: string;
|
|
199
|
+
refreshing: string;
|
|
200
|
+
updatedNow: string;
|
|
201
|
+
updatedAgo: string;
|
|
202
|
+
refreshFailed: string;
|
|
203
|
+
share: string;
|
|
204
|
+
shared: string;
|
|
205
|
+
linkCopied: string;
|
|
206
|
+
undo: string;
|
|
207
|
+
undone: string;
|
|
208
|
+
on: string;
|
|
209
|
+
off: string;
|
|
210
|
+
changeFailed: string;
|
|
211
|
+
publish: string;
|
|
212
|
+
publishing: string;
|
|
213
|
+
published: string;
|
|
214
|
+
unpublish: string;
|
|
215
|
+
publishFailed: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
export type ActionLocale = keyof typeof DICT;
|
|
219
|
+
export type ActionStringKey = keyof typeof DICT.en;
|
|
220
|
+
/** Localised action string (EN / SK / DE / CS), {n} / {text} replaced. */
|
|
221
|
+
export declare function actionText(key: ActionStringKey, locale?: string, vars?: Record<string, string | number>): string;
|
|
222
|
+
/** "just now" / "n min ago" from a timestamp (min resolution; the components tick every 15s). */
|
|
223
|
+
export declare function agoText(t: number | null | undefined, now: (k: 'savedNow' | 'updatedNow') => string, ago: (n: number) => string, nowKey: 'savedNow' | 'updatedNow'): string;
|
|
224
|
+
export declare function useTicker(ms: number, on?: boolean): void;
|
|
225
|
+
export declare function announce(msg: string): void;
|
|
226
|
+
export type ActionStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
227
|
+
/** Throw / return this from an action to go back to idle without an error (validation failed, share sheet dismissed). */
|
|
228
|
+
export declare const ACTION_CANCEL: unique symbol;
|
|
229
|
+
export type CoalesceMode = 'none' | 'trailing' | 'leading-trailing';
|
|
230
|
+
export interface AsyncActionOptions<R = unknown> {
|
|
231
|
+
successDuration?: number;
|
|
232
|
+
errorDuration?: number;
|
|
233
|
+
minLoadingMs?: number;
|
|
234
|
+
/** A second run while loading is ignored. Default true. */
|
|
235
|
+
preventDoubleSubmit?: boolean;
|
|
236
|
+
/** none (default): one run per trigger (preventDoubleSubmit applies) · leading-trailing: the first trigger runs at once,
|
|
237
|
+
* triggers during the run collapse into ONE follow-up run · trailing: runs once after --ul-action-debounce-ms of quiet
|
|
238
|
+
* (or at --ul-action-debounce-max-wait-ms). */
|
|
239
|
+
coalesce?: CoalesceMode;
|
|
240
|
+
debounceMs?: number;
|
|
241
|
+
maxWaitMs?: number;
|
|
242
|
+
disabled?: boolean;
|
|
243
|
+
/** Controlled status (the app owns the state). */
|
|
244
|
+
status?: ActionStatus;
|
|
245
|
+
onStatusChange?: (s: ActionStatus) => void;
|
|
246
|
+
onSuccess?: (result: R) => void;
|
|
247
|
+
onError?: (error: unknown) => void;
|
|
248
|
+
/** Clear timers on unmount (no state updates after unmount). Default true. */
|
|
249
|
+
resetOnUnmount?: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface AsyncAction<A extends unknown[]> {
|
|
252
|
+
status: ActionStatus;
|
|
253
|
+
error: unknown;
|
|
254
|
+
/** Resolves to true (success), false (error), null (ignored / cancelled). */
|
|
255
|
+
run: (...args: A) => Promise<boolean | null>;
|
|
256
|
+
reset: () => void;
|
|
257
|
+
}
|
|
258
|
+
export declare function useAsyncAction<A extends unknown[] = unknown[], R = unknown>(fn: ((...args: A) => R | Promise<R>) | undefined, o?: AsyncActionOptions<R>): AsyncAction<A>;
|
|
259
|
+
export type CoalescedStatus = 'idle' | 'pending' | 'saving' | 'error';
|
|
260
|
+
export interface CoalescedOptions<T> {
|
|
261
|
+
value?: T;
|
|
262
|
+
defaultValue: T;
|
|
263
|
+
commit: (v: T) => Promise<unknown> | unknown;
|
|
264
|
+
mode?: CoalesceMode;
|
|
265
|
+
debounceMs?: number;
|
|
266
|
+
maxWaitMs?: number;
|
|
267
|
+
equals?: (a: T, b: T) => boolean;
|
|
268
|
+
onCommitted?: (v: T) => void;
|
|
269
|
+
onError?: (e: unknown, rolledBackTo: T) => void;
|
|
270
|
+
onStatusChange?: (s: CoalescedStatus) => void;
|
|
271
|
+
errorDuration?: number;
|
|
272
|
+
}
|
|
273
|
+
export interface CoalescedAction<T> {
|
|
274
|
+
value: T;
|
|
275
|
+
committed: T;
|
|
276
|
+
status: CoalescedStatus;
|
|
277
|
+
error: unknown;
|
|
278
|
+
set: (v: T) => void;
|
|
279
|
+
flush: () => void;
|
|
280
|
+
}
|
|
281
|
+
export declare function useCoalescedAction<T>(o: CoalescedOptions<T>): CoalescedAction<T>;
|
|
282
|
+
export declare function useActionTooltip(btn: React.RefObject<HTMLElement | null>, hoverText?: string): (msg: string, ms?: number) => void;
|
|
283
|
+
export declare function SwapText({ value, k, dir }: {
|
|
284
|
+
value: React.ReactNode;
|
|
285
|
+
k: string;
|
|
286
|
+
dir?: 1 | -1;
|
|
287
|
+
}): React.JSX.Element;
|
|
288
|
+
export declare function setActionTimeScale(s: number): void;
|
|
289
|
+
export declare const getActionTimeScale: () => number;
|
|
290
|
+
export declare const actMs: (ms: number) => number;
|
|
291
|
+
/** CSS transitions / animations inside the action layers (body, fx, ring); never the button's own press / glass animations. */
|
|
292
|
+
export declare function scaleActionAnims(b: HTMLElement): void;
|
|
293
|
+
export declare function clearWaves(host: HTMLElement): void;
|
|
294
|
+
export declare function playWave(btn: HTMLElement, host: HTMLElement, reduced: boolean, at?: {
|
|
295
|
+
x: number;
|
|
296
|
+
y: number;
|
|
297
|
+
} | null): void;
|
|
298
|
+
export interface ActionSlots<T = React.ReactNode> {
|
|
299
|
+
idle?: T;
|
|
300
|
+
loading?: T;
|
|
301
|
+
success?: T;
|
|
302
|
+
error?: T;
|
|
303
|
+
}
|
|
304
|
+
export interface ULActionButtonProps extends Omit<ULButtonProps, 'onClick' | 'loading' | 'icon' | 'children' | 'onError'>, AsyncActionOptions {
|
|
305
|
+
/** Sync or async; a throw / rejection is the error state. Receives the click event. */
|
|
306
|
+
onAction?: (e: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
307
|
+
/** Visible label per state. Default: children for idle, localised Working… / Done / Retry. */
|
|
308
|
+
labels?: ActionSlots;
|
|
309
|
+
/** Icon per state ({ idle, loading, success, error }); the icon cell swaps them (exit / enter). */ icons?: ActionSlots;
|
|
310
|
+
/** Icon-only button (aria-label required). */
|
|
311
|
+
iconOnly?: boolean;
|
|
312
|
+
/** Idle label (the state labels come from `labels`). */ children?: React.ReactNode;
|
|
313
|
+
/** inline = label + icon swap · tooltip = the anchored tooltip shows the message · both. Default inline. */
|
|
314
|
+
feedback?: 'inline' | 'tooltip' | 'both';
|
|
315
|
+
/** Tooltip / live-region message per state (string or from the error). Default: the state label as text. */
|
|
316
|
+
messages?: {
|
|
317
|
+
success?: string | ((r: unknown) => string);
|
|
318
|
+
error?: string | ((e: unknown) => string);
|
|
319
|
+
loading?: string;
|
|
320
|
+
};
|
|
321
|
+
/** Hover / focus tooltip in idle (a hint, e.g. the shortcut). */
|
|
322
|
+
tooltip?: string;
|
|
323
|
+
/** Visual-only loading / success (optimistic toggles). */
|
|
324
|
+
quiet?: boolean;
|
|
325
|
+
/** morph (default): width springs to the new content · reserve: min-width of the widest label, neighbours never move. */
|
|
326
|
+
widthMode?: 'morph' | 'reserve';
|
|
327
|
+
/** Never put the value into any tooltip, title or announcement (copy). Messages stay generic. */
|
|
328
|
+
sensitive?: boolean;
|
|
329
|
+
/** "en" | "sk" | "de" | "cs" for the default state labels. Default "en". */ locale?: string;
|
|
330
|
+
/** @internal tests / showcase: force a visual state. */
|
|
331
|
+
forceStatus?: ActionStatus;
|
|
332
|
+
/** Extra layers across the WHOLE button (inset 0, clipped to its radius, under the content): hold fill. */
|
|
333
|
+
before?: React.ReactNode;
|
|
334
|
+
/** success: the independent --ul-success tone (default) · accent: the button's accent. */
|
|
335
|
+
successTone?: 'success' | 'accent';
|
|
336
|
+
/** ripple: a band from the centre across the whole button · ring: one pulse outside the rim · none. Default "ripple" ("ring" when icon-only). */
|
|
337
|
+
successEffect?: 'ripple' | 'ring' | 'none';
|
|
338
|
+
/** Where the success wave starts: the button centre (default) or the click point (keyboard falls back to the centre). */
|
|
339
|
+
successOrigin?: 'center' | 'pointer';
|
|
340
|
+
/** Bypass the state machine (coalesced toggles drive their own state). */
|
|
341
|
+
onPress?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
342
|
+
/** Escape hatch for wrappers that run the action themselves. */
|
|
343
|
+
actionRef?: React.MutableRefObject<AsyncAction<[React.MouseEvent<HTMLButtonElement>]> | null>;
|
|
344
|
+
}
|
|
345
|
+
export declare const ULActionButton: React.ForwardRefExoticComponent<ULActionButtonProps & React.RefAttributes<HTMLElement>>;
|
|
346
|
+
export {};
|