gridsmith-ui 0.19.0 → 0.20.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/{chunk-5PDTHKW3.js → chunk-6MXHGH3D.js} +40 -9
- package/dist/chunk-6MXHGH3D.js.map +1 -0
- package/dist/chunk-XVB55M3N.js +42 -0
- package/dist/chunk-XVB55M3N.js.map +1 -0
- package/dist/editor.d.ts +38 -2
- package/dist/editor.js +83 -7
- package/dist/editor.js.map +1 -1
- package/dist/index.d.ts +199 -52
- package/dist/index.js +1000 -419
- package/dist/index.js.map +1 -1
- package/dist/resizable.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5PDTHKW3.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -106,8 +106,19 @@ interface FieldControlWiring {
|
|
|
106
106
|
required?: boolean;
|
|
107
107
|
error?: boolean;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* A field's label: any text or element, never nothing. Sprint 25.12 A31 (R28-59): run 75 labelled only the first of its
|
|
111
|
+
* repeated rows (`label={index === 0 ? … : undefined}`), and every other row's fields had no name. A label that
|
|
112
|
+
* shouldn't show takes `hideLabel`; repeated rows use AddAnother, which shows each label once.
|
|
113
|
+
*/
|
|
114
|
+
type FieldLabel = Exclude<ReactNode, null | undefined | boolean>;
|
|
109
115
|
interface FieldProps {
|
|
110
|
-
label:
|
|
116
|
+
label: FieldLabel;
|
|
117
|
+
/**
|
|
118
|
+
* The label is read out but not shown (Sprint 25.12 A31): for a field whose purpose the page shows another way, such
|
|
119
|
+
* as a column heading above repeated rows. In an AddAnother group it shows again when the group stacks its rows.
|
|
120
|
+
*/
|
|
121
|
+
hideLabel?: boolean;
|
|
111
122
|
/** The single form control. Receives id, aria-describedby, aria-invalid/error and required automatically. */
|
|
112
123
|
children: ReactElement | ((props: FieldControlProps) => ReactNode);
|
|
113
124
|
/** Persistent help text (format requirements, why a field is disabled). Shown below the control, above any error. */
|
|
@@ -123,7 +134,8 @@ interface FieldProps {
|
|
|
123
134
|
* - `onSubmit`: on submit only.
|
|
124
135
|
*
|
|
125
136
|
* Whatever the timing, it runs on every submit, and FormWrapper's `onSubmit` gets its message under this Field's
|
|
126
|
-
* `id
|
|
137
|
+
* `id`, or no key at all when the value passes, so an empty `errors` means the form is valid. A message that shows is
|
|
138
|
+
* checked again as the value changes, so it goes as soon as the value is right. Focus
|
|
127
139
|
* moving into the control's own popup (a Dropdown's list, a DatePicker's calendar) is not leaving the field. Outside
|
|
128
140
|
* a FormWrapper it runs when the field is left (round 26, R26-2).
|
|
129
141
|
*/
|
|
@@ -145,7 +157,7 @@ interface FieldProps {
|
|
|
145
157
|
* In a SettingsLayout panel a Field keeps the narrow page's reading width however wide the page is (the panel's
|
|
146
158
|
* --ds-form-max, Sprint 25.9); a `max-w-*` class of your own wins.
|
|
147
159
|
*/
|
|
148
|
-
declare function Field({ label, children, hint, error, required, labelAction, id: idProp, validate, className }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
160
|
+
declare function Field({ label, children, hint, error, required, labelAction, hideLabel, id: idProp, validate, className }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
149
161
|
|
|
150
162
|
interface Option {
|
|
151
163
|
id: string;
|
|
@@ -172,7 +184,7 @@ interface DropdownProps extends FieldControlWiring {
|
|
|
172
184
|
/** Accessible name for the trigger, for when there is no visible `label` (e.g. in a toolbar). */
|
|
173
185
|
"aria-label"?: string;
|
|
174
186
|
}
|
|
175
|
-
declare function Dropdown({ options, value, onChange, label, disabled, placeholder, multiple, searchable, size: sizeProp, className, ref, container, error, showChips, "aria-label": ariaLabel, ...wiring }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare function Dropdown({ options, value, onChange: onChangeProp, label, disabled, placeholder, multiple, searchable, size: sizeProp, className, ref, container, error, showChips, "aria-label": ariaLabel, ...wiring }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
176
188
|
|
|
177
189
|
interface ComboboxOption {
|
|
178
190
|
value: string;
|
|
@@ -192,7 +204,7 @@ interface ComboboxProps extends FieldControlWiring {
|
|
|
192
204
|
error?: boolean;
|
|
193
205
|
size?: ControlSize;
|
|
194
206
|
}
|
|
195
|
-
declare function Combobox({ value, onChange, options, placeholder, disabled, loading, className, ref, container, error, size: sizeProp, ...wiring }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
207
|
+
declare function Combobox({ value, onChange: onChangeProp, options, placeholder, disabled, loading, className, ref, container, error, size: sizeProp, ...wiring }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
196
208
|
|
|
197
209
|
type CheckboxSize = "sm" | "md";
|
|
198
210
|
interface CheckboxProps {
|
|
@@ -205,7 +217,7 @@ interface CheckboxProps {
|
|
|
205
217
|
className?: string;
|
|
206
218
|
ref?: Ref<HTMLInputElement>;
|
|
207
219
|
}
|
|
208
|
-
declare function Checkbox({ checked, onChange, label, size, disabled, indeterminate, className, ref }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
declare function Checkbox({ checked, onChange: onChangeProp, label, size, disabled, indeterminate, className, ref }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
209
221
|
interface CheckboxGroupProps {
|
|
210
222
|
value: string[];
|
|
211
223
|
onChange: (value: string[]) => void;
|
|
@@ -237,7 +249,7 @@ interface RadioGroupProps {
|
|
|
237
249
|
className?: string;
|
|
238
250
|
label?: string;
|
|
239
251
|
}
|
|
240
|
-
declare function RadioGroup({ value, onChange, options, orientation, className, label }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
252
|
+
declare function RadioGroup({ value, onChange: onChangeProp, options, orientation, className, label }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
241
253
|
|
|
242
254
|
interface DatePickerProps extends Omit<FieldControlWiring, "id"> {
|
|
243
255
|
value: Date | null;
|
|
@@ -266,7 +278,7 @@ interface DatePickerProps extends Omit<FieldControlWiring, "id"> {
|
|
|
266
278
|
end?: Date | null;
|
|
267
279
|
};
|
|
268
280
|
}
|
|
269
|
-
declare function DatePicker({ value, onChange, placeholder, disabled, className, ref, container, error, label, id, size: sizeProp, min, max, range, ...wiring }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
281
|
+
declare function DatePicker({ value, onChange: onChangeProp, placeholder, disabled, className, ref, container, error, label, id, size: sizeProp, min, max, range, ...wiring }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
270
282
|
|
|
271
283
|
interface DateRange {
|
|
272
284
|
start: Date | null;
|
|
@@ -305,10 +317,55 @@ declare const DEFAULT_DATE_RANGE_PRESETS: DateRangePreset[];
|
|
|
305
317
|
* the end (clicking before the start restarts the selection). Closes on
|
|
306
318
|
* Escape or outside click. Pair with <Field> for label/hint/error wiring.
|
|
307
319
|
*/
|
|
308
|
-
declare function DateRangePicker({ value, onChange, placeholder, disabled, error, label, id, className, ref, container, min, max, presets, weekStartsOn, size: sizeProp, ...wiring }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
320
|
+
declare function DateRangePicker({ value, onChange: onChangeProp, placeholder, disabled, error, label, id, className, ref, container, min, max, presets, weekStartsOn, size: sizeProp, ...wiring }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
309
321
|
|
|
322
|
+
type FileUploadStatus = "added" | "queued" | "uploading" | "done" | "error";
|
|
323
|
+
/** One file in the list: the page's own (`files`), or FileUpload's (the file was picked here). */
|
|
324
|
+
interface FileUploadItem {
|
|
325
|
+
/** The page's id for the file (with `files`), or FileUpload's own. */
|
|
326
|
+
id: string;
|
|
327
|
+
name: string;
|
|
328
|
+
/** In bytes. */
|
|
329
|
+
size?: number;
|
|
330
|
+
/**
|
|
331
|
+
* "added": picked, with nothing uploading it (a FileUpload with only onFiles); "queued": waiting its turn;
|
|
332
|
+
* "uploading"; "done"; "error".
|
|
333
|
+
*/
|
|
334
|
+
status: FileUploadStatus;
|
|
335
|
+
/** 0–100 while uploading. */
|
|
336
|
+
progress?: number;
|
|
337
|
+
/** Why it failed, in words ("The file is over 10 MB"). */
|
|
338
|
+
error?: string;
|
|
339
|
+
/** The picked File, when FileUpload has it. */
|
|
340
|
+
file?: File;
|
|
341
|
+
}
|
|
342
|
+
interface FileUploadRequestOptions {
|
|
343
|
+
/** Report progress, 0–100. */
|
|
344
|
+
onProgress: (percent: number) => void;
|
|
345
|
+
/** Aborted when the user cancels, the FileUpload goes, or its overlay closes: stop the request. */
|
|
346
|
+
signal: AbortSignal;
|
|
347
|
+
}
|
|
310
348
|
interface FileUploadProps {
|
|
311
|
-
|
|
349
|
+
/** The files the user picked or dropped, after the accept and size checks. */
|
|
350
|
+
onFiles?: (files: File[]) => void;
|
|
351
|
+
/**
|
|
352
|
+
* The page's uploads as they really are (Sprint 25.12 A33, R28-63): each file's status, progress and error. The list
|
|
353
|
+
* shows exactly these; the page adds what onFiles gives it, and answers onCancel, onRetry and onRemove. Pass `files`
|
|
354
|
+
* or `upload`, not both.
|
|
355
|
+
*/
|
|
356
|
+
files?: FileUploadItem[];
|
|
357
|
+
/**
|
|
358
|
+
* Uploads one file. FileUpload runs it for each picked file, at most three at once while the rest wait, and keeps the
|
|
359
|
+
* list itself: report progress with onProgress, resolve when done, reject to fail (the error's message says why), and
|
|
360
|
+
* stop when the signal aborts. Cancel aborts; Retry runs it again with a fresh signal.
|
|
361
|
+
*/
|
|
362
|
+
upload?: (file: File, options: FileUploadRequestOptions) => Promise<unknown>;
|
|
363
|
+
/** A running upload's Cancel. With `upload`, FileUpload has already aborted it and taken it off the list. */
|
|
364
|
+
onCancel?: (item: FileUploadItem) => void;
|
|
365
|
+
/** A failed upload's Retry. With `upload`, FileUpload runs it again itself. */
|
|
366
|
+
onRetry?: (item: FileUploadItem) => void;
|
|
367
|
+
/** A file's Remove. With `files` the page takes it off its list; otherwise FileUpload does, and tells the page. */
|
|
368
|
+
onRemove?: (item: FileUploadItem) => void;
|
|
312
369
|
/**
|
|
313
370
|
* The types the zone takes, as for an `<input type="file">`: ".csv", "image/*", "application/pdf". The zone says them
|
|
314
371
|
* in words ("CSV files"), and a picked or dropped file that isn't one gets a message instead of reaching onFiles.
|
|
@@ -328,7 +385,7 @@ interface FileUploadProps {
|
|
|
328
385
|
/** The file input's id. A Field passes its own, so its label opens the picker. */
|
|
329
386
|
id?: string;
|
|
330
387
|
}
|
|
331
|
-
declare function FileUpload({ onFiles, accept, multiple, maxSize, className, error, label, id }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
388
|
+
declare function FileUpload({ onFiles, files, upload, onCancel, onRetry, onRemove, accept, multiple, maxSize, className, error, label, id }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
332
389
|
|
|
333
390
|
interface SliderRangeProps {
|
|
334
391
|
/**
|
|
@@ -362,7 +419,7 @@ interface SliderRangeProps {
|
|
|
362
419
|
*/
|
|
363
420
|
formatValue?: (value: number) => string;
|
|
364
421
|
}
|
|
365
|
-
declare function SliderRange({ value, onChange, min, max, step, disabled, showValue, className, ref, error, label, "aria-label": ariaLabel, "aria-describedby": describedByProp, trackStyle, formatValue }: SliderRangeProps): react_jsx_runtime.JSX.Element;
|
|
422
|
+
declare function SliderRange({ value, onChange: onChangeProp, min, max, step, disabled, showValue, className, ref, error, label, "aria-label": ariaLabel, "aria-describedby": describedByProp, trackStyle, formatValue }: SliderRangeProps): react_jsx_runtime.JSX.Element;
|
|
366
423
|
|
|
367
424
|
interface TimePickerProps extends Omit<FieldControlWiring, "id"> {
|
|
368
425
|
value: string;
|
|
@@ -378,7 +435,7 @@ interface TimePickerProps extends Omit<FieldControlWiring, "id"> {
|
|
|
378
435
|
id?: string;
|
|
379
436
|
size?: ControlSize;
|
|
380
437
|
}
|
|
381
|
-
declare function TimePicker({ value, onChange, use24Hour, minuteStep, disabled, className, ref, container, error, id, size: sizeProp, ...wiring }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
438
|
+
declare function TimePicker({ value, onChange: onChangeProp, use24Hour, minuteStep, disabled, className, ref, container, error, id, size: sizeProp, ...wiring }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
382
439
|
|
|
383
440
|
interface NumberInputProps {
|
|
384
441
|
value: number;
|
|
@@ -398,7 +455,7 @@ interface NumberInputProps {
|
|
|
398
455
|
/** Forwarded to the inner input element so a Label htmlFor can be associated. */
|
|
399
456
|
id?: string;
|
|
400
457
|
}
|
|
401
|
-
declare function NumberInput({ value, onChange, min, max, step, disabled, placeholder, prefix, suffix, size: sizeProp, className, error, allowDecimals, id, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function NumberInput({ value, onChange: onChangeProp, min, max, step, disabled, placeholder, prefix, suffix, size: sizeProp, className, error, allowDecimals, id, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
402
459
|
|
|
403
460
|
interface TagInputProps {
|
|
404
461
|
value: string[];
|
|
@@ -413,7 +470,7 @@ interface TagInputProps {
|
|
|
413
470
|
/** Accessible name for the input when no visible Label is associated via id. Default "Add tag". */
|
|
414
471
|
"aria-label"?: string;
|
|
415
472
|
}
|
|
416
|
-
declare function TagInput({ value, onChange, placeholder, maxTags, disabled, className, error, id, "aria-label": ariaLabel }: TagInputProps): react_jsx_runtime.JSX.Element;
|
|
473
|
+
declare function TagInput({ value, onChange: onChangeProp, placeholder, maxTags, disabled, className, error, id, "aria-label": ariaLabel }: TagInputProps): react_jsx_runtime.JSX.Element;
|
|
417
474
|
|
|
418
475
|
interface PinInputProps {
|
|
419
476
|
value: string;
|
|
@@ -427,7 +484,7 @@ interface PinInputProps {
|
|
|
427
484
|
/** Forwarded to the first pin box so a Label htmlFor can be associated. */
|
|
428
485
|
id?: string;
|
|
429
486
|
}
|
|
430
|
-
declare function PinInput({ value, onChange, length, mask, disabled, size: sizeProp, className, error, id, }: PinInputProps): react_jsx_runtime.JSX.Element;
|
|
487
|
+
declare function PinInput({ value, onChange: onChangeProp, length, mask, disabled, size: sizeProp, className, error, id, }: PinInputProps): react_jsx_runtime.JSX.Element;
|
|
431
488
|
|
|
432
489
|
interface RatingProps {
|
|
433
490
|
value: number;
|
|
@@ -439,7 +496,7 @@ interface RatingProps {
|
|
|
439
496
|
className?: string;
|
|
440
497
|
error?: boolean;
|
|
441
498
|
}
|
|
442
|
-
declare function Rating({ value, onChange, max, allowHalf, readOnly, size, className, error, }: RatingProps): react_jsx_runtime.JSX.Element;
|
|
499
|
+
declare function Rating({ value, onChange: onChangeProp, max, allowHalf, readOnly, size, className, error, }: RatingProps): react_jsx_runtime.JSX.Element;
|
|
443
500
|
|
|
444
501
|
interface ColorPickerProps {
|
|
445
502
|
value: string;
|
|
@@ -450,7 +507,7 @@ interface ColorPickerProps {
|
|
|
450
507
|
className?: string;
|
|
451
508
|
error?: boolean;
|
|
452
509
|
}
|
|
453
|
-
declare function ColorPicker({ value, onChange, showAlpha, swatches, disabled, className, error, }: ColorPickerProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
declare function ColorPicker({ value, onChange: onChangeProp, showAlpha, swatches, disabled, className, error, }: ColorPickerProps): react_jsx_runtime.JSX.Element;
|
|
454
511
|
|
|
455
512
|
interface InlineFieldErrorProps {
|
|
456
513
|
message: string;
|
|
@@ -489,11 +546,16 @@ interface FormFieldError {
|
|
|
489
546
|
}
|
|
490
547
|
interface FormWrapperProps {
|
|
491
548
|
/**
|
|
492
|
-
* Called on each submit with the fields
|
|
493
|
-
*
|
|
494
|
-
* still work, and the form reads
|
|
549
|
+
* Called on each submit, valid or not, with the fields that failed, by Field id: the message of every Field whose
|
|
550
|
+
* `validate` finds its value wrong. A field that passes has no key, so save when `errors` is empty
|
|
551
|
+
* (`Object.keys(errors).length === 0`). Checks of your own that set a Field's `error` still work, and the form reads
|
|
552
|
+
* them from the page as before.
|
|
553
|
+
*
|
|
554
|
+
* In a Drawer, Dialog or Sheet, return the save's promise: the overlay stops asking before discarding once it
|
|
555
|
+
* resolves, and keeps asking if it's rejected. Returning nothing works for a save that keeps the form on screen; a
|
|
556
|
+
* submit that moves on to another step keeps the overlay's changes until the flow saves (Sprint 25.12 A15).
|
|
495
557
|
*/
|
|
496
|
-
onSubmit: (errors: FormErrors) =>
|
|
558
|
+
onSubmit: (errors: FormErrors) => unknown;
|
|
497
559
|
validationMode?: ValidationMode;
|
|
498
560
|
children: ReactNode;
|
|
499
561
|
/**
|
|
@@ -503,8 +565,8 @@ interface FormWrapperProps {
|
|
|
503
565
|
actions?: ReactNode;
|
|
504
566
|
actionsAlign?: "start" | "end";
|
|
505
567
|
/**
|
|
506
|
-
* Renders a secondary Cancel before the actions. Inside a Drawer, a Dialog
|
|
507
|
-
*
|
|
568
|
+
* Renders a secondary Cancel before the actions. Inside a Drawer, a Dialog or a Sheet, it closes the overlay through
|
|
569
|
+
* its unsaved-changes check — the question Escape and the close control ask once the user has changed something —
|
|
508
570
|
* and then this function runs, unless it is the overlay's own onClose; it does not run when the user keeps editing.
|
|
509
571
|
* Anywhere else this function runs. Never hand-wire a Cancel to the overlay's close: it skips the question (round 21).
|
|
510
572
|
*/
|
|
@@ -530,6 +592,40 @@ interface FormWrapperProps {
|
|
|
530
592
|
}
|
|
531
593
|
declare function FormWrapper({ onSubmit, validationMode: validationModeProp, children, actions: actionsProp, actionsAlign: actionsAlignProp, onCancel, cancelLabel, focusFirstError, errorSummary, className, ref }: FormWrapperProps): react_jsx_runtime.JSX.Element;
|
|
532
594
|
|
|
595
|
+
interface AddAnotherProps<T> {
|
|
596
|
+
/** The rows. Each keeps its own id (`getId`), never its index, so its values, field ids and errors stay with it when another row goes. */
|
|
597
|
+
items: T[];
|
|
598
|
+
getId: (item: T) => string;
|
|
599
|
+
/** A row's name in words, from its position: `(i) => \`person ${i + 1}\``. It names every field in the row ("Email address, person 2") and the row's Remove button. */
|
|
600
|
+
itemName: (index: number) => string;
|
|
601
|
+
/** The fields' labels, in order. They show once, as the group's column headings; on a narrow group each field shows its own. */
|
|
602
|
+
columns: string[];
|
|
603
|
+
/**
|
|
604
|
+
* A row's fields. `label(column)` names a field for its row: wrap each control in
|
|
605
|
+
* `<Field hideLabel label={label("Email address")}>`, so it's read out in full while the heading shows it once.
|
|
606
|
+
*/
|
|
607
|
+
renderRow: (item: T, index: number, label: (column: string) => string) => ReactNode;
|
|
608
|
+
onAdd: () => void;
|
|
609
|
+
onRemove: (id: string) => void;
|
|
610
|
+
/** The Add button's text (default "Add another"). */
|
|
611
|
+
addLabel?: string;
|
|
612
|
+
/** The group's own label, as a legend above it (for example "Team members"). */
|
|
613
|
+
label?: string;
|
|
614
|
+
/** Fewest rows kept (default 1): a row can't be removed below it. */
|
|
615
|
+
minItems?: number;
|
|
616
|
+
/** Most rows allowed: Add goes once there are this many. */
|
|
617
|
+
maxItems?: number;
|
|
618
|
+
className?: string;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Repeated rows of fields: MOJ's "Add another" (Sprint 25.12 A31, R28-59; the owner's P24). Builders dropped the labels
|
|
622
|
+
* of every row but the first to avoid repeating them on screen, and those fields had no name. Here the labels show
|
|
623
|
+
* once, as column headings, while every field is named for its row; Add and Remove name the row they act on, and
|
|
624
|
+
* focus moves to the new row after an add, or to the previous row after a removal. On a narrow group the rows stack,
|
|
625
|
+
* the headings go, and each field shows its own label.
|
|
626
|
+
*/
|
|
627
|
+
declare function AddAnother<T>({ items, getId, itemName, columns, renderRow, onAdd, onRemove, addLabel, label, minItems, maxItems, className }: AddAnotherProps<T>): react_jsx_runtime.JSX.Element;
|
|
628
|
+
|
|
533
629
|
interface TransferItem {
|
|
534
630
|
id: string;
|
|
535
631
|
label: string;
|
|
@@ -545,7 +641,7 @@ interface TransferListProps {
|
|
|
545
641
|
className?: string;
|
|
546
642
|
ref?: Ref<HTMLDivElement>;
|
|
547
643
|
}
|
|
548
|
-
declare function TransferList({ available, selected, onChange, availableTitle, selectedTitle, searchable, className, ref, }: TransferListProps): react_jsx_runtime.JSX.Element;
|
|
644
|
+
declare function TransferList({ available, selected, onChange: onChangeProp, availableTitle, selectedTitle, searchable, className, ref, }: TransferListProps): react_jsx_runtime.JSX.Element;
|
|
549
645
|
|
|
550
646
|
interface MentionSuggestion {
|
|
551
647
|
id: string;
|
|
@@ -562,7 +658,7 @@ interface MentionInputProps {
|
|
|
562
658
|
disabled?: boolean;
|
|
563
659
|
className?: string;
|
|
564
660
|
}
|
|
565
|
-
declare function MentionInput({ value: controlledValue, onChange, suggestions, trigger, placeholder, disabled, className, }: MentionInputProps): react_jsx_runtime.JSX.Element;
|
|
661
|
+
declare function MentionInput({ value: controlledValue, onChange: onChangeProp, suggestions, trigger, placeholder, disabled, className, }: MentionInputProps): react_jsx_runtime.JSX.Element;
|
|
566
662
|
|
|
567
663
|
type CardVariant = "default" | "featured" | "interactive" | "outline" | "ghost";
|
|
568
664
|
type CardSelectType = "radio" | "checkbox" | "toggle";
|
|
@@ -697,7 +793,12 @@ declare const DescriptionList: react.ForwardRefExoticComponent<DescriptionListPr
|
|
|
697
793
|
type StatusDotVariant = "success" | "warning" | "error" | "info" | "neutral" | "offline";
|
|
698
794
|
interface StatusDotProps {
|
|
699
795
|
variant?: StatusDotVariant;
|
|
700
|
-
|
|
796
|
+
/**
|
|
797
|
+
* The status in words ("Online", "Healthy"), drawn beside the dot and read as the status. Required: a dot alone would
|
|
798
|
+
* show the status by colour only (WCAG 1.4.1). Words a page already writes beside a dot are its label: pass them here
|
|
799
|
+
* and never write them again (Sprint 25.12 A48, R28-87).
|
|
800
|
+
*/
|
|
801
|
+
label: string;
|
|
701
802
|
pulse?: boolean;
|
|
702
803
|
className?: string;
|
|
703
804
|
}
|
|
@@ -2260,7 +2361,7 @@ interface SegmentedControlProps extends FieldControlWiring {
|
|
|
2260
2361
|
*/
|
|
2261
2362
|
maxOptions?: number;
|
|
2262
2363
|
}
|
|
2263
|
-
declare function SegmentedControl({ value, onChange, options, size: sizeProp, variant, fullWidth, onHoverChange, className, "aria-label": ariaLabel, maxOptions, ...wiring }: SegmentedControlProps): react_jsx_runtime.JSX.Element;
|
|
2364
|
+
declare function SegmentedControl({ value, onChange: onChangeProp, options, size: sizeProp, variant, fullWidth, onHoverChange, className, "aria-label": ariaLabel, maxOptions, ...wiring }: SegmentedControlProps): react_jsx_runtime.JSX.Element;
|
|
2264
2365
|
|
|
2265
2366
|
interface BottomNavItem {
|
|
2266
2367
|
label: string;
|
|
@@ -2711,36 +2812,63 @@ type ToastVariant = "default" | "success" | "warning" | "error";
|
|
|
2711
2812
|
type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-center" | "bottom-center";
|
|
2712
2813
|
interface ToastAction {
|
|
2713
2814
|
label: string;
|
|
2714
|
-
|
|
2815
|
+
/** Runs once when pressed; the toast then closes. It may return a promise (useDestructiveAction's Undo confirms itself when it settles). */
|
|
2816
|
+
onClick: () => unknown;
|
|
2715
2817
|
}
|
|
2716
2818
|
interface ToastProps {
|
|
2717
2819
|
variant?: ToastVariant;
|
|
2718
2820
|
message: ReactNode;
|
|
2719
2821
|
visible: boolean;
|
|
2720
2822
|
onDismiss: () => void;
|
|
2823
|
+
/** Milliseconds a plain toast stays. 0 or Infinity keeps it until dismissed. */
|
|
2721
2824
|
duration?: number;
|
|
2722
2825
|
pauseOnHover?: boolean;
|
|
2826
|
+
/**
|
|
2827
|
+
* The toast's action. Sprint 25.12 A40 (the sourced overlays#18): a toast with an action never closes on a timer while
|
|
2828
|
+
* the action can still be taken. With `actionWindow` the action lapses after that long, and the toast stays as a plain
|
|
2829
|
+
* message for its `duration`; without one it stays until the user acts or dismisses it.
|
|
2830
|
+
*/
|
|
2723
2831
|
action?: ToastAction;
|
|
2832
|
+
/** How long the action is offered once the toast shows, in ms (an Undo's window). */
|
|
2833
|
+
actionWindow?: number;
|
|
2724
2834
|
position?: ToastPosition;
|
|
2725
2835
|
mode?: "light" | "dark";
|
|
2726
2836
|
container?: Element | DocumentFragment;
|
|
2727
2837
|
/**
|
|
2728
|
-
* Render only the toast card, without the portal
|
|
2729
|
-
*
|
|
2730
|
-
*
|
|
2838
|
+
* Render only the toast card, without the portal, the fixed position or a live region of its own. ToastProvider
|
|
2839
|
+
* renders cards this way: it owns their stacking, their timers' pause and their announcements. Standalone use
|
|
2840
|
+
* leaves this unset, and the toast announces itself.
|
|
2731
2841
|
*/
|
|
2732
2842
|
inline?: boolean;
|
|
2843
|
+
/** ToastProvider: every timer pauses while the stack is hovered or holds focus. */
|
|
2844
|
+
paused?: boolean;
|
|
2845
|
+
/** ToastProvider: the action's window ran out (the provider drops the action and the plain time starts). */
|
|
2846
|
+
onActionLapse?: () => void;
|
|
2847
|
+
/** ToastProvider: the action was pressed (the provider runs it once and closes the toast). */
|
|
2848
|
+
onAction?: () => void;
|
|
2849
|
+
/** ToastProvider: a new value restarts the toast's time (a toast for the same item replaced this one). */
|
|
2850
|
+
restartKey?: number;
|
|
2733
2851
|
}
|
|
2734
|
-
declare function Toast({ variant, message, visible, onDismiss, duration, pauseOnHover, action, position, mode, container, inline }: ToastProps): react_jsx_runtime.JSX.Element | null;
|
|
2852
|
+
declare function Toast({ variant, message, visible, onDismiss, duration, pauseOnHover, action, actionWindow, position, mode, container, inline, paused, onActionLapse, onAction, restartKey }: ToastProps): react_jsx_runtime.JSX.Element | null;
|
|
2735
2853
|
|
|
2736
2854
|
interface ToastOptions {
|
|
2737
2855
|
variant?: ToastVariant;
|
|
2738
|
-
/** Milliseconds
|
|
2856
|
+
/** Milliseconds a plain toast stays once shown. 0 or Infinity keeps it until dismissed. */
|
|
2739
2857
|
duration?: number;
|
|
2858
|
+
/**
|
|
2859
|
+
* An action (Undo, Retry). A toast with an action stays until the user acts or dismisses it, or until its action
|
|
2860
|
+
* lapses (`actionWindow`); pressing it runs it once and closes the toast (Sprint 25.12 A40, A41).
|
|
2861
|
+
*/
|
|
2740
2862
|
action?: ToastAction;
|
|
2863
|
+
/** How long the action is offered once the toast shows, in ms (an Undo's window); the toast then stays as a plain message for its `duration`. */
|
|
2864
|
+
actionWindow?: number;
|
|
2741
2865
|
/** Supply to update an existing toast in place instead of adding a new one. */
|
|
2742
2866
|
id?: string;
|
|
2743
|
-
/**
|
|
2867
|
+
/**
|
|
2868
|
+
* The item this toast is about (Sprint 25.12 A7, D28): a new toast with the same key takes the place of the one on
|
|
2869
|
+
* screen, or the one waiting, and its time starts again — six flips of one switch give one toast. Toasts without a
|
|
2870
|
+
* key never merge, whatever their wording; toasts with an action, and errors, never merge.
|
|
2871
|
+
*/
|
|
2744
2872
|
key?: string;
|
|
2745
2873
|
}
|
|
2746
2874
|
interface PromiseToastMessages<T> {
|
|
@@ -2749,7 +2877,7 @@ interface PromiseToastMessages<T> {
|
|
|
2749
2877
|
error: ReactNode | ((error: unknown) => ReactNode);
|
|
2750
2878
|
}
|
|
2751
2879
|
interface ToastApi {
|
|
2752
|
-
/**
|
|
2880
|
+
/** Show a toast (it waits behind the stack when the stack is full). Returns its id. */
|
|
2753
2881
|
toast: (message: ReactNode, options?: ToastOptions) => string;
|
|
2754
2882
|
success: (message: ReactNode, options?: Omit<ToastOptions, "variant">) => string;
|
|
2755
2883
|
warning: (message: ReactNode, options?: Omit<ToastOptions, "variant">) => string;
|
|
@@ -2763,31 +2891,38 @@ interface ToastApi {
|
|
|
2763
2891
|
}
|
|
2764
2892
|
interface ToastProviderProps {
|
|
2765
2893
|
children: ReactNode;
|
|
2766
|
-
/**
|
|
2894
|
+
/**
|
|
2895
|
+
* Most toasts shown at once (the project's notifications.toastMaxVisible). The rest wait behind a "+N" count, their
|
|
2896
|
+
* time starting only when shown. Default 3 (Sprint 25.12 A40, the owner's R28-81: every deletion's confirmation
|
|
2897
|
+
* shows); 1 is the least.
|
|
2898
|
+
*/
|
|
2767
2899
|
maxVisible?: number;
|
|
2768
2900
|
/** Where the stack is anchored. Default "bottom-right". */
|
|
2769
2901
|
position?: ToastPosition;
|
|
2770
|
-
/** Default
|
|
2902
|
+
/** Default time a plain toast stays, in ms. Default 5000. */
|
|
2771
2903
|
duration?: number;
|
|
2772
|
-
/**
|
|
2773
|
-
* Round 15 (the owner's 52.4): ten toggle flips queued ten toasts, each waiting its full duration. While the visible
|
|
2774
|
-
* slots are full, a new toast replaces the queued toast that shares its key (the variant by default) — the user sees
|
|
2775
|
-
* the current one and the latest, never a backlog. Default true.
|
|
2776
|
-
*/
|
|
2904
|
+
/** Toasts with the same explicit `key` replace each other (D28). Default true. */
|
|
2777
2905
|
coalesce?: boolean;
|
|
2778
2906
|
/** Independent colour mode for toasts, when the theme configures one. */
|
|
2779
2907
|
mode?: "light" | "dark";
|
|
2780
|
-
/** Pause
|
|
2908
|
+
/** Pause every toast's time while the stack is hovered (focus inside it always pauses). Default true. */
|
|
2781
2909
|
pauseOnHover?: boolean;
|
|
2782
2910
|
}
|
|
2783
2911
|
declare function useToast(): ToastApi;
|
|
2784
2912
|
/** The toast API when a ToastProvider is above, else null — for components that can do without one (useDestructiveAction in dialog mode). */
|
|
2785
2913
|
declare function useToastOptional(): ToastApi | null;
|
|
2786
2914
|
/**
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2789
|
-
*
|
|
2790
|
-
*
|
|
2915
|
+
* Toasts for the whole app. Wrap it once (get_app_shell does), then call useToast() anywhere (Sprint 25.12 A40):
|
|
2916
|
+
* - up to `maxVisible` show at once; the rest wait behind a "+N" count, their time starting only when shown, with
|
|
2917
|
+
* toasts that carry an action and errors ahead of plain confirmations; "Clear all" empties the stack;
|
|
2918
|
+
* - only toasts for the same item (the same `key`) replace each other (D28);
|
|
2919
|
+
* - hovering the stack, or focus inside it, pauses every toast's time, an Undo's window included;
|
|
2920
|
+
* - two live regions, polite and assertive, present from the start, announce each toast once as it comes; the cards
|
|
2921
|
+
* themselves stay quiet;
|
|
2922
|
+
* - F8 moves focus to the stack (a region named "Notifications"), and a toast with an action says so as it's announced;
|
|
2923
|
+
* when an action or the dismiss button closes a toast, focus returns where it was, else to the next toast, else
|
|
2924
|
+
* to the page's main content;
|
|
2925
|
+
* - on a phone the stack sits above the bottom tab bar.
|
|
2791
2926
|
*/
|
|
2792
2927
|
declare function ToastProvider({ children, maxVisible, position, duration, mode, pauseOnHover, coalesce }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
2793
2928
|
|
|
@@ -3109,10 +3244,22 @@ interface DestructiveActionOptions {
|
|
|
3109
3244
|
typeToConfirm?: string;
|
|
3110
3245
|
/** Performs the action. In undo mode it runs at once. */
|
|
3111
3246
|
onConfirm: () => void | Promise<void>;
|
|
3112
|
-
/**
|
|
3113
|
-
|
|
3114
|
-
|
|
3247
|
+
/**
|
|
3248
|
+
* Restores what the action removed; the Undo toast's action in undo mode. Without it the toast has no Undo. It may
|
|
3249
|
+
* return a promise: once it resolves the hook confirms with a toast (`restoredMessage`), and a rejection shows an
|
|
3250
|
+
* error toast (Sprint 25.12 A41).
|
|
3251
|
+
*/
|
|
3252
|
+
onUndo?: () => unknown;
|
|
3253
|
+
/**
|
|
3254
|
+
* The completed action's message, in both modes ("Office removed"): the confirmation toast in dialog mode, and the
|
|
3255
|
+
* text beside Undo in undo mode. Without it the hook says the action's verb in the past tense ("Removed"). A page
|
|
3256
|
+
* that shows its own toast during `onConfirm` isn't given a second one (Sprint 25.12 A34).
|
|
3257
|
+
*/
|
|
3258
|
+
doneMessage?: ReactNode;
|
|
3259
|
+
/** The older name of `doneMessage`, for undo mode. */
|
|
3115
3260
|
undoMessage?: ReactNode;
|
|
3261
|
+
/** The toast once an Undo has worked ("Office restored"); "Restored" without one. */
|
|
3262
|
+
restoredMessage?: ReactNode;
|
|
3116
3263
|
/** `high` always confirms in a dialog, even in undo mode; the preference's high-severity list does the same by key. */
|
|
3117
3264
|
severity?: "low" | "high";
|
|
3118
3265
|
}
|
|
@@ -3275,4 +3422,4 @@ interface UseTextOverflowResult {
|
|
|
3275
3422
|
*/
|
|
3276
3423
|
declare function useTextOverflow(options?: UseTextOverflowOptions): UseTextOverflowResult;
|
|
3277
3424
|
|
|
3278
|
-
export { Accordion, ActionPanel, ActionPanelGroup, Alert, type AlertPlacement, AppShell, type AppShellContextValue, type AppShellFocus, type AppShellPreferences, type AppShellTheme, AsidePanel, type AsidePanelProps, type AsidePanelSide, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarStatus, Badge, type BadgePaletteColor, type BadgeSeverity, type BadgeSize, type BadgeVariant, BottomNav, type BottomNavItem, type BreadcrumbItem$1 as BreadcrumbItem, Breadcrumbs, type BreadcrumbsSeparator, type BreadcrumbsSize, type BreadcrumbsVariant, BreakpointKey, BulkActionBar, Button, ButtonSizeContext, Calendar, type CalendarDay, Card, CardContent, CardDescription, CardFooter, CardGrid, type CardGridProps, CardHeader, type CardSelectType, CardTitle, type CardVariant, Carousel, type ChatMessage, type ChatMessageAction, type ChatMessageLayout, ChatMessageList, type ChatMessageSender, type ChatMessageSource, type ChatMessageStatus, ChatPanel, type ChatPanelProps, type ChatPanelStatusTone, Checkbox, CheckboxGroup, CheckboxGroupItem, CodeBlock, Collapsible, ColorPicker, type Column, Combobox, CommandPalette, ContextMenu, type ControlSize, ControlSizeContext, CornerPanel, type CornerPanelEdge, type CornerPanelProps, DEFAULT_DATE_RANGE_PRESETS, DataList, type DateInput, DatePicker, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangeWords, type DescriptionItem, DescriptionList, type DescriptionListOrientation, type DescriptionListSize, type DestructiveActionHandle, type DestructiveActionOptions, Dialog, Divider, Dock, Drawer, Dropdown, DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, EmptyState, EntityCell, Field, type FieldControlProps, type FieldProps, FileUpload, type FitLabelsOptions, type FittedLabel, FormWrapper, Gantt, type GanttGroup, type GanttItem, type GanttProps, type GanttStatus, type GanttTone, type GridKeyboard, type GridKeyboardOptions, HoverCard, InlineFieldError, Input, Kbd, Label, type LabelBox, Launcher, type LauncherEdge, type LauncherProps, type LauncherVariant, type LauncherWhenOpen, Link, type LinkProps, MentionInput, MobileHeaderMenu, type MobileHeaderMenuItemData, type MobileHeaderMenuType, NavItem, type NavItemProps, type NavItemType, NavMenu, type NavMenuItem, Navbar, type NavbarSize, type NavbarType, type NavbarVariant, NotificationCenter, NumberInput, PageContainer, type PageContainerWidth, PageHeader, type PageHeaderBehavior, type PageHeaderIntensity, type PageHeaderProps, type PageHeaderVariant, type Pager, Pagination, type PaginationOptions, PinInput, Popover, PreferencesContext, Progress, type PromiseToastMessages, RadioGroup, Rating, type ResolvedPreferences, ScrollArea, SectionHeading, type SectionHeadingProps, SegmentedControl, SettingsLayout, type SettingsLayoutProps, type SettingsSection, Sheet, Sidebar, type SidebarContextValue, type SidebarItem, SidebarNav, type SidebarNavSize, type SidebarPosition, type SidebarSection, type SidebarType, Skeleton, SkipLink, SliderRange, Spinner, StackedList, type StackedListVariant, StatsCard, StatusDot, type StatusDotVariant, Stepper, TIME_ZOOMS, type Tab, Table, type TableDensity, type TableProps, TableToolbar, type TableToolbarActiveFilter, type TableToolbarFilterOption, Tabs, Tag, TagInput, type TagPaletteColor, type TagVariant, TextOverflow, type TextOverflowProps, Textarea, TimeBar, type TimeBarProps, TimePicker, TimeRow, type TimeRowProps, type TimeScale, TimeScaleHeader, type TimeScaleHeaderProps, type TimeScaleOptions, type TimeTick, TimeViewport, type TimeViewportHandle, type TimeViewportLayout, type TimeViewportProps, type TimeViewportState, type TimeZoom, Timeline, Toast, type ToastAction, type ToastApi, type ToastOptions, type ToastPosition, ToastProvider, type ToastVariant, Toggle, Tooltip, Tour, TransferList, TreeView, type Trend, type UseTextOverflowOptions, type UseTextOverflowResult, dateOfDay, dayOf, endDayOf, fitLabel, fitLabels, formatDateRange, preferenceActionKey, timeExtent, useAppShell, useContentWidth, useDestructiveAction, useFittedLabels, useFormContext, useGridKeyboard, usePagination, usePreferences, useSidebar, useTextMeasure, useTextOverflow, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional, useUnsavedChanges };
|
|
3425
|
+
export { Accordion, ActionPanel, ActionPanelGroup, AddAnother, type AddAnotherProps, Alert, type AlertPlacement, AppShell, type AppShellContextValue, type AppShellFocus, type AppShellPreferences, type AppShellTheme, AsidePanel, type AsidePanelProps, type AsidePanelSide, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarStatus, Badge, type BadgePaletteColor, type BadgeSeverity, type BadgeSize, type BadgeVariant, BottomNav, type BottomNavItem, type BreadcrumbItem$1 as BreadcrumbItem, Breadcrumbs, type BreadcrumbsSeparator, type BreadcrumbsSize, type BreadcrumbsVariant, BreakpointKey, BulkActionBar, Button, ButtonSizeContext, Calendar, type CalendarDay, Card, CardContent, CardDescription, CardFooter, CardGrid, type CardGridProps, CardHeader, type CardSelectType, CardTitle, type CardVariant, Carousel, type ChatMessage, type ChatMessageAction, type ChatMessageLayout, ChatMessageList, type ChatMessageSender, type ChatMessageSource, type ChatMessageStatus, ChatPanel, type ChatPanelProps, type ChatPanelStatusTone, Checkbox, CheckboxGroup, CheckboxGroupItem, CodeBlock, Collapsible, ColorPicker, type Column, Combobox, CommandPalette, ContextMenu, type ControlSize, ControlSizeContext, CornerPanel, type CornerPanelEdge, type CornerPanelProps, DEFAULT_DATE_RANGE_PRESETS, DataList, type DateInput, DatePicker, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangeWords, type DescriptionItem, DescriptionList, type DescriptionListOrientation, type DescriptionListSize, type DestructiveActionHandle, type DestructiveActionOptions, Dialog, Divider, Dock, Drawer, Dropdown, DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, EmptyState, EntityCell, Field, type FieldControlProps, type FieldLabel, type FieldProps, FileUpload, type FileUploadItem, type FileUploadRequestOptions, type FileUploadStatus, type FitLabelsOptions, type FittedLabel, FormWrapper, Gantt, type GanttGroup, type GanttItem, type GanttProps, type GanttStatus, type GanttTone, type GridKeyboard, type GridKeyboardOptions, HoverCard, InlineFieldError, Input, Kbd, Label, type LabelBox, Launcher, type LauncherEdge, type LauncherProps, type LauncherVariant, type LauncherWhenOpen, Link, type LinkProps, MentionInput, MobileHeaderMenu, type MobileHeaderMenuItemData, type MobileHeaderMenuType, NavItem, type NavItemProps, type NavItemType, NavMenu, type NavMenuItem, Navbar, type NavbarSize, type NavbarType, type NavbarVariant, NotificationCenter, NumberInput, PageContainer, type PageContainerWidth, PageHeader, type PageHeaderBehavior, type PageHeaderIntensity, type PageHeaderProps, type PageHeaderVariant, type Pager, Pagination, type PaginationOptions, PinInput, Popover, PreferencesContext, Progress, type PromiseToastMessages, RadioGroup, Rating, type ResolvedPreferences, ScrollArea, SectionHeading, type SectionHeadingProps, SegmentedControl, SettingsLayout, type SettingsLayoutProps, type SettingsSection, Sheet, Sidebar, type SidebarContextValue, type SidebarItem, SidebarNav, type SidebarNavSize, type SidebarPosition, type SidebarSection, type SidebarType, Skeleton, SkipLink, SliderRange, Spinner, StackedList, type StackedListVariant, StatsCard, StatusDot, type StatusDotVariant, Stepper, TIME_ZOOMS, type Tab, Table, type TableDensity, type TableProps, TableToolbar, type TableToolbarActiveFilter, type TableToolbarFilterOption, Tabs, Tag, TagInput, type TagPaletteColor, type TagVariant, TextOverflow, type TextOverflowProps, Textarea, TimeBar, type TimeBarProps, TimePicker, TimeRow, type TimeRowProps, type TimeScale, TimeScaleHeader, type TimeScaleHeaderProps, type TimeScaleOptions, type TimeTick, TimeViewport, type TimeViewportHandle, type TimeViewportLayout, type TimeViewportProps, type TimeViewportState, type TimeZoom, Timeline, Toast, type ToastAction, type ToastApi, type ToastOptions, type ToastPosition, ToastProvider, type ToastVariant, Toggle, Tooltip, Tour, TransferList, TreeView, type Trend, type UseTextOverflowOptions, type UseTextOverflowResult, dateOfDay, dayOf, endDayOf, fitLabel, fitLabels, formatDateRange, preferenceActionKey, timeExtent, useAppShell, useContentWidth, useDestructiveAction, useFittedLabels, useFormContext, useGridKeyboard, usePagination, usePreferences, useSidebar, useTextMeasure, useTextOverflow, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional, useUnsavedChanges };
|