@hussmartinez/ui 0.1.1 → 0.3.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.
@@ -0,0 +1,1347 @@
1
+ /**
2
+ * Accessible React components of the `@hussmartinez` design system.
3
+ *
4
+ * @remarks
5
+ * A client entry: it starts with `"use client"`, which the build keeps
6
+ * (ADR 0007). React and React DOM 18.3 or later are optional peer
7
+ * dependencies.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ import { ButtonHTMLAttributes } from 'react';
13
+ import { DialogHTMLAttributes } from 'react';
14
+ import { ForwardRefExoticComponent } from 'react';
15
+ import { HTMLAttributes } from 'react';
16
+ import { InputHTMLAttributes } from 'react';
17
+ import { Messages } from '@hussmartinez/sdk-core';
18
+ import { ProgressHTMLAttributes } from 'react';
19
+ import { ReactElement } from 'react';
20
+ import { ReactNode } from 'react';
21
+ import { Ref } from 'react';
22
+ import { RefAttributes } from 'react';
23
+ import { RefObject } from 'react';
24
+ import type { SVGProps } from 'react';
25
+
26
+ /**
27
+ * The `add` icon: Lucide's `plus`.
28
+ *
29
+ * @public
30
+ */
31
+ export declare function AddIcon(props: IconProps): ReactElement;
32
+
33
+ /**
34
+ * Announces a message to screen readers, such as "Saved 1.3 MB" (ADR 0014).
35
+ * The message is plain text from your message catalogue.
36
+ *
37
+ * @public
38
+ */
39
+ export declare type Announce = (message: string, options?: {
40
+ politeness?: Politeness;
41
+ }) => void;
42
+
43
+ /**
44
+ * Renders a polite and an assertive `aria-live` region, visually hidden, and
45
+ * lets everything inside announce through {@link useAnnounce}. The regions are
46
+ * in the server-rendered page from the start, as screen readers only announce
47
+ * changes to regions that already exist. Render it once, near the root of an
48
+ * editor or application.
49
+ *
50
+ * @public
51
+ */
52
+ export declare function AnnouncerProvider({ children }: AnnouncerProviderProps): ReactElement;
53
+
54
+ /**
55
+ * Props of {@link AnnouncerProvider}.
56
+ *
57
+ * @public
58
+ */
59
+ export declare interface AnnouncerProviderProps {
60
+ readonly children?: ReactNode;
61
+ }
62
+
63
+ /**
64
+ * A button: a native `<button>`, `type="button"` unless you say otherwise.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <Button variant="primary" startIcon={<DownloadIcon />} onClick={save}>
69
+ * {messages.t("toolbar.download")}
70
+ * </Button>
71
+ * ```
72
+ *
73
+ * @public
74
+ */
75
+ export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
76
+
77
+ /**
78
+ * The parts of a button that `classNames` can target.
79
+ *
80
+ * @public
81
+ */
82
+ export declare type ButtonPart = "root" | "icon" | "label";
83
+
84
+ /**
85
+ * Props of {@link Button}. Native button props are passed through.
86
+ *
87
+ * @public
88
+ */
89
+ export declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className">, StyleProps<ButtonPart> {
90
+ /** Defaults to `secondary`. */
91
+ readonly variant?: ButtonVariant | undefined;
92
+ /** Defaults to `medium`. */
93
+ readonly size?: ButtonSize | undefined;
94
+ /** Makes it a toggle button, on or off, exposed as `aria-pressed`. */
95
+ readonly pressed?: boolean | undefined;
96
+ /** An icon before the label. It's decorative, and draws with `currentColor`. */
97
+ readonly startIcon?: ReactNode;
98
+ /** An icon after the label. */
99
+ readonly endIcon?: ReactNode;
100
+ /**
101
+ * Keeps a disabled button focusable, with `aria-disabled` instead of the
102
+ * `disabled` attribute, so it stays in a toolbar's keyboard order and
103
+ * screen readers can find it. Clicks are ignored.
104
+ */
105
+ readonly focusableWhenDisabled?: boolean | undefined;
106
+ }
107
+
108
+ /**
109
+ * Button sizes. Both meet the 24 px target size, and 44 px on coarse
110
+ * pointers (ADR 0014).
111
+ *
112
+ * @public
113
+ */
114
+ export declare type ButtonSize = "medium" | "small";
115
+
116
+ /**
117
+ * How prominent a button is: `primary` for the main action, `secondary`
118
+ * (the default) for others, `quiet` for toolbars and dense places, `danger`
119
+ * for destructive actions.
120
+ *
121
+ * @public
122
+ */
123
+ export declare type ButtonVariant = "primary" | "secondary" | "quiet" | "danger";
124
+
125
+ /**
126
+ * The `check` icon: Lucide's `check`.
127
+ *
128
+ * @public
129
+ */
130
+ export declare function CheckIcon(props: IconProps): ReactElement;
131
+
132
+ /**
133
+ * The `chevron-down` icon: Lucide's `chevron-down`.
134
+ *
135
+ * @public
136
+ */
137
+ export declare function ChevronDownIcon(props: IconProps): ReactElement;
138
+
139
+ /**
140
+ * The `chevron-left` icon: Lucide's `chevron-left`.
141
+ *
142
+ * @public
143
+ */
144
+ export declare function ChevronLeftIcon(props: IconProps): ReactElement;
145
+
146
+ /**
147
+ * The `chevron-right` icon: Lucide's `chevron-right`.
148
+ *
149
+ * @public
150
+ */
151
+ export declare function ChevronRightIcon(props: IconProps): ReactElement;
152
+
153
+ /**
154
+ * Extra classes for a component's named parts.
155
+ *
156
+ * @public
157
+ */
158
+ export declare type ClassNames<Part extends string> = {
159
+ readonly [Name in Part]?: string;
160
+ };
161
+
162
+ /**
163
+ * The `close` icon: Lucide's `x`.
164
+ *
165
+ * @public
166
+ */
167
+ export declare function CloseIcon(props: IconProps): ReactElement;
168
+
169
+ /**
170
+ * How a subtree picks between light and dark: one of them, or whichever the
171
+ * operating system prefers (`prefers-color-scheme`).
172
+ *
173
+ * @public
174
+ */
175
+ export declare type ColorMode = "light" | "dark" | "system";
176
+
177
+ /**
178
+ * The `delete` icon: Lucide's `trash`.
179
+ *
180
+ * @public
181
+ */
182
+ export declare function DeleteIcon(props: IconProps): ReactElement;
183
+
184
+ /**
185
+ * How tightly controls are packed. Set it with `data-hm-density` or the
186
+ * `density` prop.
187
+ *
188
+ * @public
189
+ */
190
+ export declare type Density = "comfortable" | "compact";
191
+
192
+ /**
193
+ * A modal dialog on the native `<dialog>` element with `showModal()` (ADR
194
+ * 0014): it traps focus, makes the page behind it inert, and sits in the top
195
+ * layer, which host z-indexes and overflow can't break.
196
+ *
197
+ * - **Controlled:** `open` decides, and `onOpenChange(false)` asks to close,
198
+ * on Escape or the close button.
199
+ * - **Focus:** moves into the dialog when it opens, to `initialFocus` or the
200
+ * first focusable element, and back to what was focused before when it
201
+ * closes.
202
+ * - **Server rendering:** renders closed, and opens after hydration.
203
+ *
204
+ * @example
205
+ * ```tsx
206
+ * <Dialog
207
+ * open={open}
208
+ * onOpenChange={setOpen}
209
+ * title={messages.t("export.title")}
210
+ * footer={<Button variant="primary" onClick={exportFile}>{messages.t("export.confirm")}</Button>}
211
+ * >
212
+ * {options}
213
+ * </Dialog>
214
+ * ```
215
+ *
216
+ * @public
217
+ */
218
+ export declare const Dialog: ForwardRefExoticComponent<DialogProps & RefAttributes<HTMLDialogElement>>;
219
+
220
+ /**
221
+ * The parts of a dialog that `classNames` can target.
222
+ *
223
+ * @public
224
+ */
225
+ export declare type DialogPart = "root" | "header" | "title" | "description" | "body" | "footer" | "close";
226
+
227
+ /**
228
+ * Props of {@link Dialog}.
229
+ *
230
+ * @public
231
+ */
232
+ export declare interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "className" | "title" | "open">, StyleProps<DialogPart> {
233
+ /** Whether the dialog is open. The dialog is always controlled. */
234
+ readonly open: boolean;
235
+ /**
236
+ * Called with `false` when the user asks to close: Escape, or the close
237
+ * button. Keep `open` true to refuse, for example while saving.
238
+ */
239
+ readonly onOpenChange: (open: boolean) => void;
240
+ /** The heading, and the dialog's accessible name. */
241
+ readonly title: ReactNode;
242
+ /** A short description under the title, read when the dialog opens. */
243
+ readonly description?: ReactNode;
244
+ /** Actions at the bottom, such as Cancel and Save buttons. */
245
+ readonly footer?: ReactNode;
246
+ /** The close button's accessible name. Defaults to `dialog.close` from the messages. */
247
+ readonly closeLabel?: string | undefined;
248
+ /** Replaces the close icon. It draws with `currentColor`. */
249
+ readonly closeIcon?: ReactNode;
250
+ /** The element to focus when the dialog opens. Defaults to the first focusable one. */
251
+ readonly initialFocus?: RefObject<HTMLElement | null> | undefined;
252
+ /** Defaults to `medium`. */
253
+ readonly size?: "small" | "medium" | "large" | undefined;
254
+ }
255
+
256
+ /**
257
+ * The `download` icon: Lucide's `download`.
258
+ *
259
+ * @public
260
+ */
261
+ export declare function DownloadIcon(props: IconProps): ReactElement;
262
+
263
+ /**
264
+ * A label, an optional description and an optional error, wired to one
265
+ * control: the label names it, and the description and error describe it.
266
+ *
267
+ * The control must be labelable, such as an `<input>`, `<select>`,
268
+ * `<textarea>` or `ui`'s `Slider`. For a group of controls, such as
269
+ * `SegmentedControl`, use the group's own `label`.
270
+ *
271
+ * An error that appears after the user acts, such as on submit, isn't
272
+ * announced on its own: move focus to the field, or announce it with
273
+ * `useAnnounce`.
274
+ *
275
+ * @example
276
+ * ```tsx
277
+ * <Field label={t("export.dpi")} description={t("export.dpiHelp")} error={dpiError}>
278
+ * <Slider min={72} max={600} value={dpi} onValueChange={setDpi} />
279
+ * </Field>
280
+ *
281
+ * <Field label={t("export.name")}>
282
+ * {(control) => <input {...control} value={name} onChange={onNameChange} />}
283
+ * </Field>
284
+ * ```
285
+ *
286
+ * @public
287
+ */
288
+ export declare const Field: ForwardRefExoticComponent<FieldProps & RefAttributes<HTMLDivElement>>;
289
+
290
+ /**
291
+ * The props a {@link Field} gives its control, so the label, description
292
+ * and error reach assistive technology.
293
+ *
294
+ * @public
295
+ */
296
+ export declare interface FieldControlProps {
297
+ /** The control's `id`, which the label points at. */
298
+ readonly id: string;
299
+ /** The ids of the description and the error, when there are any. */
300
+ readonly "aria-describedby": string | undefined;
301
+ /** `true` while the field shows an error. */
302
+ readonly "aria-invalid": true | undefined;
303
+ }
304
+
305
+ /**
306
+ * The parts of a field that `classNames` can target.
307
+ *
308
+ * @public
309
+ */
310
+ export declare type FieldPart = "root" | "label" | "description" | "error";
311
+
312
+ /**
313
+ * Props of {@link Field}. Native `div` props are passed through to the root.
314
+ *
315
+ * @public
316
+ */
317
+ export declare interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "className" | "children">, StyleProps<FieldPart> {
318
+ /** The visible label. Use text from your message catalogue. */
319
+ readonly label: ReactNode;
320
+ /** Help shown under the label, such as "Between −24 and 24 dB". */
321
+ readonly description?: ReactNode;
322
+ /**
323
+ * What's wrong with the value, such as "Enter a number". While it's set,
324
+ * the control is marked invalid and the text is read with it.
325
+ */
326
+ readonly error?: ReactNode;
327
+ /** The control's `id`. Defaults to a generated one. */
328
+ readonly controlId?: string | undefined;
329
+ /**
330
+ * The control. `ui` controls, such as `Slider` and `NumberField`, connect
331
+ * themselves. For any other control, pass a function and spread the
332
+ * props it receives onto the control.
333
+ */
334
+ readonly children: ReactNode | ((control: FieldControlProps) => ReactNode);
335
+ }
336
+
337
+ /**
338
+ * Where people choose or drop files, such as a document to open. The button
339
+ * opens the system's file picker: it's the keyboard and screen reader path.
340
+ * The zone around it takes dropped files, a shortcut for pointer users, so it
341
+ * isn't focusable itself. While files are dragged over it, it has the
342
+ * `data-hm-dragging` attribute.
343
+ *
344
+ * The zone checks names, types and counts against `accept` and `multiple`,
345
+ * and turns away folders, then calls `onFiles`. It never reads a file and
346
+ * never shows a file's name. Treat files as untrusted: check their contents
347
+ * before using them, and show their names as text.
348
+ *
349
+ * While a zone is on the page, files dropped elsewhere on the page are
350
+ * turned away, so a near miss doesn't navigate away from it. Hosts that
351
+ * handle that themselves turn it off with `preventStrayDrops={false}`.
352
+ *
353
+ * @example
354
+ * ```tsx
355
+ * <FileDropZone accept=".pdf,application/pdf" onFiles={([file]) => open(file)}>
356
+ * <p>{messages.t("editor.start.title")}</p>
357
+ * </FileDropZone>
358
+ * ```
359
+ *
360
+ * @public
361
+ */
362
+ export declare const FileDropZone: ForwardRefExoticComponent<FileDropZoneProps & RefAttributes<HTMLDivElement>>;
363
+
364
+ /**
365
+ * The parts of a file drop zone that `classNames` can target.
366
+ *
367
+ * @public
368
+ */
369
+ export declare type FileDropZonePart = "root" | "button" | "hint";
370
+
371
+ /**
372
+ * Props of {@link FileDropZone}. Native `div` props are passed through to the
373
+ * zone.
374
+ *
375
+ * @public
376
+ */
377
+ export declare interface FileDropZoneProps extends Omit<HTMLAttributes<HTMLDivElement>, "className" | "onDrop" | "onDragEnter" | "onDragOver" | "onDragLeave">, StyleProps<FileDropZonePart> {
378
+ /**
379
+ * Called with the files that passed the zone's checks, chosen or dropped,
380
+ * in order. The checks only look at names, types and counts: validate each
381
+ * file's contents before using it.
382
+ */
383
+ readonly onFiles: (files: File[]) => void;
384
+ /** Called with the files the zone turned away, and why. */
385
+ readonly onFilesRejected?: ((rejections: FileRejection[]) => void) | undefined;
386
+ /**
387
+ * The file types to offer and take, as in `<input accept>`: extensions
388
+ * such as `.pdf`, MIME types such as `application/pdf`, or `audio/*`.
389
+ * A hint for the picker and a first filter, not a security check: a
390
+ * file's name and type are whatever its sender chose.
391
+ */
392
+ readonly accept?: string | undefined;
393
+ /** Takes several files at once. Defaults to `false`. */
394
+ readonly multiple?: boolean | undefined;
395
+ /**
396
+ * Turns away files dropped anywhere else on the page while the zone is
397
+ * mounted, so a near miss doesn't open the file in place of the page.
398
+ * Defaults to `true`. Turn it off when the host handles stray drops
399
+ * itself, or embeds the zone in a page whose drag and drop it doesn't own.
400
+ */
401
+ readonly preventStrayDrops?: boolean | undefined;
402
+ /** Turns the button off, and ignores drops. */
403
+ readonly disabled?: boolean | undefined;
404
+ /**
405
+ * The button's text. Defaults to `fileDropZone.choose` from the messages
406
+ * ("Choose a file"), or `fileDropZone.chooseMultiple` with `multiple`.
407
+ */
408
+ readonly buttonLabel?: ReactNode;
409
+ /** Defaults to `primary`. */
410
+ readonly buttonVariant?: ButtonVariant | undefined;
411
+ /** A ref to the button, for moving focus to it. */
412
+ readonly buttonRef?: Ref<HTMLButtonElement> | undefined;
413
+ /**
414
+ * Text under the button, which also describes it. Defaults to
415
+ * `fileDropZone.hint` ("or drop it here"), or `fileDropZone.hintMultiple`.
416
+ */
417
+ readonly hint?: ReactNode;
418
+ /** Content above the button, such as a title or the reason the last file failed. */
419
+ readonly children?: ReactNode;
420
+ }
421
+
422
+ /**
423
+ * A file that {@link FileDropZone} turned away, and why: `type` when it
424
+ * doesn't match `accept`, `count` when several came and `multiple` is off,
425
+ * `directory` for a dropped folder.
426
+ *
427
+ * @public
428
+ */
429
+ export declare interface FileRejection {
430
+ readonly file: File;
431
+ readonly reason: "type" | "count" | "directory";
432
+ }
433
+
434
+ /**
435
+ * The `highlighter` icon: Lucide's `highlighter`.
436
+ *
437
+ * @public
438
+ */
439
+ export declare function HighlighterIcon(props: IconProps): ReactElement;
440
+
441
+ /**
442
+ * A square button with only an icon. `label` is its accessible name, so it
443
+ * can't be left out.
444
+ *
445
+ * @example
446
+ * ```tsx
447
+ * <IconButton label={messages.t("toolbar.rotate")} icon={<RotateIcon />} onClick={rotate} />
448
+ * ```
449
+ *
450
+ * @public
451
+ */
452
+ export declare const IconButton: ForwardRefExoticComponent<IconButtonProps & RefAttributes<HTMLButtonElement>>;
453
+
454
+ /**
455
+ * Props of {@link IconButton}.
456
+ *
457
+ * @public
458
+ */
459
+ export declare interface IconButtonProps extends Omit<ButtonProps, "startIcon" | "endIcon" | "children" | "classNames"> {
460
+ /** The accessible name. Required, because the button shows no text. */
461
+ readonly label: string;
462
+ /** The icon. It draws with `currentColor`. */
463
+ readonly icon: ReactNode;
464
+ /** Extra classes on the root and the icon. */
465
+ readonly classNames?: ClassNames<"root" | "icon"> | undefined;
466
+ }
467
+
468
+ /**
469
+ * An icon from ui's set, such as `UndoIcon`.
470
+ *
471
+ * @public
472
+ */
473
+ export declare type IconComponent = (props: IconProps) => ReactElement;
474
+
475
+ /**
476
+ * The name of an icon in ui's set, such as `rotate-left`. Tools refer to
477
+ * icons by name (sdk-core ADR 0030), and the SDK maps the names it uses to
478
+ * their components.
479
+ *
480
+ * @public
481
+ */
482
+ export declare type IconName = "add" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "close" | "delete" | "download" | "highlighter" | "info" | "loop" | "menu" | "more" | "muted" | "open" | "page-grid" | "page-single" | "pan" | "pause" | "pen" | "play" | "redo" | "remove" | "rotate-left" | "rotate-right" | "search" | "select" | "skip-back" | "skip-forward" | "split" | "stop" | "undo" | "upload" | "volume" | "warning" | "zoom-in" | "zoom-out";
483
+
484
+ /**
485
+ * Props of every icon. SVG attributes are passed through.
486
+ *
487
+ * @public
488
+ */
489
+ export declare interface IconProps extends Omit<SVGProps<SVGSVGElement>, "children" | "dangerouslySetInnerHTML" | "ref"> {
490
+ /**
491
+ * The accessible name, for an icon that means something on its own.
492
+ * Without it, the icon is decorative and hidden from assistive
493
+ * technology, as it should be inside a labelled button.
494
+ */
495
+ readonly label?: string | undefined;
496
+ }
497
+
498
+ /**
499
+ * The `info` icon: Lucide's `info`.
500
+ *
501
+ * @public
502
+ */
503
+ export declare function InfoIcon(props: IconProps): ReactElement;
504
+
505
+ /**
506
+ * The `loop` icon: Lucide's `repeat`.
507
+ *
508
+ * @public
509
+ */
510
+ export declare function LoopIcon(props: IconProps): ReactElement;
511
+
512
+ /**
513
+ * The `menu` icon: Lucide's `menu`.
514
+ *
515
+ * @public
516
+ */
517
+ export declare function MenuIcon(props: IconProps): ReactElement;
518
+
519
+ /**
520
+ * The `more` icon: Lucide's `ellipsis`.
521
+ *
522
+ * @public
523
+ */
524
+ export declare function MoreIcon(props: IconProps): ReactElement;
525
+
526
+ /**
527
+ * The `muted` icon: Lucide's `volume-x`.
528
+ *
529
+ * @public
530
+ */
531
+ export declare function MutedIcon(props: IconProps): ReactElement;
532
+
533
+ /**
534
+ * A number input: a text field exposed as a spin button, with locale-aware
535
+ * parsing and formatting.
536
+ *
537
+ * Typing never changes the value: the text is committed on blur or Enter,
538
+ * then kept within `min` and `max`. Text that isn't a number, or no text,
539
+ * goes back to the last value, so the value is never `NaN`. Escape throws
540
+ * the typing away. Arrow Up and Arrow Down move by `step`, Page Up and Page
541
+ * Down by `largeStep`, from the typed number when there is one.
542
+ *
543
+ * Other notations are a `parse` and `format` away: a timecode field is a
544
+ * `NumberField` of seconds. With `name`, forms receive the number, not the
545
+ * formatted text.
546
+ *
547
+ * @example
548
+ * ```tsx
549
+ * <Field label={messages.t("view.zoom")}>
550
+ * <NumberField
551
+ * min={10}
552
+ * max={400}
553
+ * step={10}
554
+ * value={zoom}
555
+ * onValueChange={setZoom}
556
+ * format={(percent) => `${percent}%`}
557
+ * parse={(text) => parseFloat(text)}
558
+ * />
559
+ * </Field>
560
+ * ```
561
+ *
562
+ * @public
563
+ */
564
+ export declare const NumberField: ForwardRefExoticComponent<NumberFieldProps & RefAttributes<HTMLInputElement>>;
565
+
566
+ /**
567
+ * Props of {@link NumberField}. Native input props are passed through.
568
+ *
569
+ * @public
570
+ */
571
+ export declare interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "type" | "value" | "defaultValue" | "min" | "max" | "step" | "onChange" | "role" | "aria-valuenow" | "aria-valuemin" | "aria-valuemax" | "aria-valuetext">, StyleProps<"root"> {
572
+ /** The value, when you control it. Leave it out to let the field keep its own. */
573
+ readonly value?: number | undefined;
574
+ /** The starting value, when the field keeps its own. Defaults to 0, kept within `min` and `max`. */
575
+ readonly defaultValue?: number | undefined;
576
+ /**
577
+ * Called with the new value when it's committed: on blur, on Enter, or
578
+ * with the arrow and Page keys. Never with `NaN`, and never while typing.
579
+ */
580
+ readonly onValueChange?: ((value: number) => void) | undefined;
581
+ /** The smallest value. Values below it are raised to it. */
582
+ readonly min?: number | undefined;
583
+ /** The largest value. Values above it are lowered to it. */
584
+ readonly max?: number | undefined;
585
+ /** The Arrow Up and Arrow Down step. Defaults to 1. Typed values aren't snapped to it. */
586
+ readonly step?: number | undefined;
587
+ /** The Page Up and Page Down step. Defaults to ten steps. */
588
+ readonly largeStep?: number | undefined;
589
+ /**
590
+ * The locale for the default `parse` and `format`, such as `"de"`.
591
+ * Defaults to the locale of `UiMessagesProvider`, or `"en"`.
592
+ */
593
+ readonly locale?: string | undefined;
594
+ /**
595
+ * Reads typed text as a number, or returns `undefined` when it isn't one.
596
+ * Defaults to the locale's digits, decimal and group separators, and minus
597
+ * sign. Replace it for other notations, such as a timecode.
598
+ */
599
+ readonly parse?: ((text: string) => number | undefined) | undefined;
600
+ /**
601
+ * Writes a value as text: the field shows it, and screen readers read it.
602
+ * Defaults to the locale's number format.
603
+ */
604
+ readonly format?: ((value: number) => string) | undefined;
605
+ /**
606
+ * The accessible name, such as "Zoom". Leave it out inside a `Field`, or
607
+ * when a visible `<label>` points at the field's `id`, or
608
+ * `aria-labelledby` names it.
609
+ */
610
+ readonly label?: string | undefined;
611
+ }
612
+
613
+ /**
614
+ * The `open` icon: Lucide's `folder-open`.
615
+ *
616
+ * @public
617
+ */
618
+ export declare function OpenIcon(props: IconProps): ReactElement;
619
+
620
+ /**
621
+ * The `page-grid` icon: Lucide's `grid-2x2`.
622
+ *
623
+ * @public
624
+ */
625
+ export declare function PageGridIcon(props: IconProps): ReactElement;
626
+
627
+ /**
628
+ * The `page-single` icon: Lucide's `file`.
629
+ *
630
+ * @public
631
+ */
632
+ export declare function PageSingleIcon(props: IconProps): ReactElement;
633
+
634
+ /**
635
+ * The `pan` icon: Lucide's `hand`.
636
+ *
637
+ * @public
638
+ */
639
+ export declare function PanIcon(props: IconProps): ReactElement;
640
+
641
+ /**
642
+ * The `pause` icon: Lucide's `pause`.
643
+ *
644
+ * @public
645
+ */
646
+ export declare function PauseIcon(props: IconProps): ReactElement;
647
+
648
+ /**
649
+ * The `pen` icon: Lucide's `pen`.
650
+ *
651
+ * @public
652
+ */
653
+ export declare function PenIcon(props: IconProps): ReactElement;
654
+
655
+ /**
656
+ * The `play` icon: Lucide's `play`.
657
+ *
658
+ * @public
659
+ */
660
+ export declare function PlayIcon(props: IconProps): ReactElement;
661
+
662
+ /**
663
+ * How urgently a message interrupts: `polite` waits for the screen reader to
664
+ * finish, `assertive` interrupts. Use `assertive` only for errors the user
665
+ * must act on.
666
+ *
667
+ * @public
668
+ */
669
+ export declare type Politeness = "polite" | "assertive";
670
+
671
+ /**
672
+ * Shows how much of a task is done, on the native `<progress>` element: no
673
+ * inline styles, so it renders correctly under a strict Content Security
674
+ * Policy, before hydration too. Without `value`, it's indeterminate and
675
+ * pulses, or stays still under reduced motion.
676
+ *
677
+ * @example
678
+ * ```tsx
679
+ * <ProgressBar value={done} max={total} label={messages.t("export.progress")} />
680
+ * ```
681
+ *
682
+ * @public
683
+ */
684
+ export declare const ProgressBar: ForwardRefExoticComponent<ProgressBarProps & RefAttributes<HTMLProgressElement>>;
685
+
686
+ /**
687
+ * Props of {@link ProgressBar}.
688
+ *
689
+ * @public
690
+ */
691
+ export declare interface ProgressBarProps extends Omit<ProgressHTMLAttributes<HTMLProgressElement>, "className" | "value" | "max">, StyleProps<"root"> {
692
+ /** How much is done, from 0 to `max`. Leave it out while the amount is unknown. */
693
+ readonly value?: number | undefined;
694
+ /** Defaults to 100. */
695
+ readonly max?: number | undefined;
696
+ /** What's in progress. Defaults to `progress.label` from the messages ("Progress"). */
697
+ readonly label?: string | undefined;
698
+ /** The value as words, such as "Page 3 of 12", read instead of a percentage. */
699
+ readonly valueText?: string | undefined;
700
+ }
701
+
702
+ /**
703
+ * The `redo` icon: Lucide's `redo-2`, mirrored in right-to-left text.
704
+ *
705
+ * @public
706
+ */
707
+ export declare function RedoIcon(props: IconProps): ReactElement;
708
+
709
+ /**
710
+ * The `remove` icon: Lucide's `minus`.
711
+ *
712
+ * @public
713
+ */
714
+ export declare function RemoveIcon(props: IconProps): ReactElement;
715
+
716
+ /**
717
+ * The `rotate-left` icon: Lucide's `rotate-ccw`.
718
+ *
719
+ * @public
720
+ */
721
+ export declare function RotateLeftIcon(props: IconProps): ReactElement;
722
+
723
+ /**
724
+ * The `rotate-right` icon: Lucide's `rotate-cw`.
725
+ *
726
+ * @public
727
+ */
728
+ export declare function RotateRightIcon(props: IconProps): ReactElement;
729
+
730
+ /**
731
+ * The `search` icon: Lucide's `search`.
732
+ *
733
+ * @public
734
+ */
735
+ export declare function SearchIcon(props: IconProps): ReactElement;
736
+
737
+ /**
738
+ * A small set of mutually exclusive choices shown side by side, such as a
739
+ * view mode. It's a WAI-ARIA radio group: arrow keys move and select. Inside a
740
+ * {@link Toolbar}, it joins the toolbar's arrow-key navigation instead, and
741
+ * Space or Enter selects.
742
+ *
743
+ * @example
744
+ * ```tsx
745
+ * <SegmentedControl
746
+ * label={messages.t("view.label")}
747
+ * value={view}
748
+ * onValueChange={setView}
749
+ * options={[
750
+ * { value: "single", label: messages.t("view.single") },
751
+ * { value: "grid", label: messages.t("view.grid"), icon: <GridIcon />, hideLabel: true },
752
+ * ]}
753
+ * />
754
+ * ```
755
+ *
756
+ * @public
757
+ */
758
+ export declare const SegmentedControl: <Value extends string>(props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>) => ReactElement;
759
+
760
+ /**
761
+ * One choice in a {@link SegmentedControl}.
762
+ *
763
+ * @public
764
+ */
765
+ export declare interface SegmentedControlOption<Value extends string> {
766
+ readonly value: Value;
767
+ /** The option's text, and its accessible name when `hideLabel` is set. */
768
+ readonly label: string;
769
+ /** An icon before the label. It draws with `currentColor`. */
770
+ readonly icon?: ReactNode;
771
+ /** Shows only the icon; `label` stays the accessible name. */
772
+ readonly hideLabel?: boolean;
773
+ readonly disabled?: boolean;
774
+ }
775
+
776
+ /**
777
+ * The parts of a segmented control that `classNames` can target.
778
+ *
779
+ * @public
780
+ */
781
+ export declare type SegmentedControlPart = "root" | "option" | "icon" | "label";
782
+
783
+ /**
784
+ * Props of {@link SegmentedControl}.
785
+ *
786
+ * @public
787
+ */
788
+ export declare interface SegmentedControlProps<Value extends string> extends Omit<HTMLAttributes<HTMLDivElement>, "className" | "role" | "onChange">, StyleProps<SegmentedControlPart> {
789
+ /** The group's accessible name, such as "View". Required. */
790
+ readonly label: string;
791
+ /** The selected option's value. The control is always controlled. */
792
+ readonly value: Value;
793
+ readonly onValueChange: (value: Value) => void;
794
+ readonly options: readonly SegmentedControlOption<Value>[];
795
+ /** Defaults to `medium`. */
796
+ readonly size?: "medium" | "small" | undefined;
797
+ }
798
+
799
+ /**
800
+ * The `select` icon: Lucide's `mouse-pointer-2`.
801
+ *
802
+ * @public
803
+ */
804
+ export declare function SelectIcon(props: IconProps): ReactElement;
805
+
806
+ /**
807
+ * The `skip-back` icon: Lucide's `skip-back`.
808
+ *
809
+ * @public
810
+ */
811
+ export declare function SkipBackIcon(props: IconProps): ReactElement;
812
+
813
+ /**
814
+ * The `skip-forward` icon: Lucide's `skip-forward`.
815
+ *
816
+ * @public
817
+ */
818
+ export declare function SkipForwardIcon(props: IconProps): ReactElement;
819
+
820
+ /**
821
+ * A slider for a value in a range, such as volume or zoom, on the native
822
+ * `<input type="range">`.
823
+ *
824
+ * Arrow keys move by `step`, Page Up and Page Down by `largeStep`, and Home
825
+ * and End to the ends. In right-to-left text, the slider is mirrored and the
826
+ * left and right arrows follow it, in every browser. `formatValue` gives
827
+ * screen readers the value as text.
828
+ *
829
+ * Inside a `Toolbar`, the slider keeps the arrow keys, Home and End, so
830
+ * they can't move focus past it: put it last in the toolbar. Tab still
831
+ * leaves the toolbar.
832
+ *
833
+ * It has no filled part of the track, because one would need an inline
834
+ * style, which a strict Content Security Policy blocks.
835
+ *
836
+ * @example
837
+ * ```tsx
838
+ * <Slider
839
+ * label={messages.t("player.volume")}
840
+ * min={-60}
841
+ * max={0}
842
+ * value={gain}
843
+ * onValueChange={setGain}
844
+ * formatValue={(db) => messages.t("player.decibels", { db })}
845
+ * />
846
+ * ```
847
+ *
848
+ * @public
849
+ */
850
+ export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLInputElement>>;
851
+
852
+ /**
853
+ * Props of {@link Slider}. Native input props are passed through.
854
+ *
855
+ * @public
856
+ */
857
+ export declare interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "type" | "value" | "defaultValue" | "min" | "max" | "step" | "onChange" | "aria-valuetext">, StyleProps<"root"> {
858
+ /** The value, when you control it. Leave it out to let the slider keep its own. */
859
+ readonly value?: number | undefined;
860
+ /** The starting value, when the slider keeps its own. Defaults to `min`. */
861
+ readonly defaultValue?: number | undefined;
862
+ /** Called with the new value as it changes, by pointer or keyboard. */
863
+ readonly onValueChange?: ((value: number) => void) | undefined;
864
+ /** Defaults to 0. */
865
+ readonly min?: number | undefined;
866
+ /** Defaults to 100. */
867
+ readonly max?: number | undefined;
868
+ /** The arrow keys' step, and the values the slider snaps to. Defaults to 1. */
869
+ readonly step?: number | undefined;
870
+ /**
871
+ * The Page Up and Page Down step. Defaults to a tenth of the range, rounded
872
+ * to a whole number of steps.
873
+ */
874
+ readonly largeStep?: number | undefined;
875
+ /**
876
+ * Writes the value as text for screen readers, such as "−6 dB" or "1:05",
877
+ * exposed as `aria-valuetext`. Without it, they read the number. Format
878
+ * for the user's locale, as `Intl.NumberFormat` does.
879
+ */
880
+ readonly formatValue?: ((value: number) => string) | undefined;
881
+ /**
882
+ * The accessible name, such as "Volume". Leave it out inside a `Field`,
883
+ * or when a visible `<label>` points at the slider's `id`, or
884
+ * `aria-labelledby` names it.
885
+ */
886
+ readonly label?: string | undefined;
887
+ }
888
+
889
+ /**
890
+ * Shows that something is loading, for an unknown time. It's an
891
+ * indeterminate progress bar to assistive technology, named by `label`.
892
+ * Under reduced motion it pulses slowly instead of turning. Its size follows
893
+ * `--hm-spinner-size`.
894
+ *
895
+ * @example
896
+ * ```tsx
897
+ * <Spinner label={messages.t("pages.loading")} />
898
+ * ```
899
+ *
900
+ * @public
901
+ */
902
+ export declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<HTMLSpanElement>>;
903
+
904
+ /**
905
+ * Props of {@link Spinner}.
906
+ *
907
+ * @public
908
+ */
909
+ export declare interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, "className" | "role" | "children">, StyleProps<"root"> {
910
+ /** What's loading. Defaults to `spinner.label` from the messages ("Loading"). */
911
+ readonly label?: string | undefined;
912
+ }
913
+
914
+ /**
915
+ * The `split` icon: Lucide's `scissors`.
916
+ *
917
+ * @public
918
+ */
919
+ export declare function SplitIcon(props: IconProps): ReactElement;
920
+
921
+ /**
922
+ * The `stop` icon: Lucide's `square`.
923
+ *
924
+ * @public
925
+ */
926
+ export declare function StopIcon(props: IconProps): ReactElement;
927
+
928
+ /**
929
+ * Styling props every component takes (STANDARDS: React API).
930
+ *
931
+ * @public
932
+ */
933
+ export declare interface StyleProps<Part extends string> {
934
+ /** Extra classes on the root element. */
935
+ readonly className?: string | undefined;
936
+ /** Extra classes on each named part. */
937
+ readonly classNames?: ClassNames<Part> | undefined;
938
+ /**
939
+ * Drops the visual styles (colours, borders, typography, motion) and keeps
940
+ * layout, focus indication and target sizes, so the component stays
941
+ * accessible while you style it yourself.
942
+ */
943
+ readonly unstyled?: boolean | undefined;
944
+ }
945
+
946
+ /**
947
+ * A validated theme. Create it with `createTheme`; its values are
948
+ * frozen and safe to write into CSS.
949
+ *
950
+ * @public
951
+ */
952
+ export declare interface Theme {
953
+ readonly colorScheme: "light" | "dark";
954
+ /** Every token value, by name without the `--hm-` prefix. Density tokens hold comfortable values. */
955
+ readonly tokens: Readonly<Record<string, string>>;
956
+ /** Density token values for compact density. */
957
+ readonly compact: Readonly<Record<string, string>>;
958
+ /** Density token values for coarse pointers. */
959
+ readonly coarsePointer: Readonly<Record<string, string>>;
960
+ }
961
+
962
+ /**
963
+ * A light and a dark theme used together, so `system` mode can follow the
964
+ * operating system. Density values come from `light`.
965
+ *
966
+ * @public
967
+ */
968
+ export declare interface ThemePair {
969
+ readonly light: Theme;
970
+ readonly dark: Theme;
971
+ }
972
+
973
+ /**
974
+ * Applies a theme, colour mode and density to everything inside it, with CSS
975
+ * custom properties only: no runtime styling library and no context reads in
976
+ * components (ADR 0006).
977
+ *
978
+ * It renders a wrapper with `display: contents`, so it doesn't affect layout.
979
+ * A custom theme is written as a `<style>` element, rendered on the server
980
+ * with the rest of the page, and `system` mode is pure CSS, so nothing
981
+ * flashes before hydration (ADR 0007). Pass a stable theme object, such as
982
+ * one created at module level, so its CSS is generated once.
983
+ *
984
+ * Under a Content Security Policy, a custom theme needs a `style-src` nonce
985
+ * source and the `nonce` prop. Without a nonce, use `themeToCss` at build
986
+ * time instead. The built-in themes need no inline styles.
987
+ *
988
+ * @example
989
+ * ```tsx
990
+ * <ThemeProvider theme={{ light: brandLight, dark: brandDark }} mode="system" density="compact">
991
+ * <App />
992
+ * </ThemeProvider>
993
+ * ```
994
+ *
995
+ * @public
996
+ */
997
+ export declare function ThemeProvider(props: ThemeProviderProps): ReactElement;
998
+
999
+ /**
1000
+ * Props of {@link ThemeProvider} shared by every form.
1001
+ *
1002
+ * @public
1003
+ */
1004
+ export declare interface ThemeProviderBaseProps {
1005
+ /** Density of everything inside. Inherited from above when omitted. */
1006
+ readonly density?: Density;
1007
+ /**
1008
+ * The nonce of a Content Security Policy whose `style-src` allows it.
1009
+ * Only needed with a custom theme, which renders a `<style>` element.
1010
+ */
1011
+ readonly nonce?: string;
1012
+ readonly children?: ReactNode;
1013
+ }
1014
+
1015
+ /**
1016
+ * The built-in themes, or a custom light and dark pair, with a colour mode.
1017
+ *
1018
+ * @public
1019
+ */
1020
+ export declare interface ThemeProviderModeProps extends ThemeProviderBaseProps {
1021
+ /** A custom `{ light, dark }` pair. The built-in themes when omitted. */
1022
+ readonly theme?: ThemePair;
1023
+ /** Light, dark, or follow the operating system. Defaults to `"system"`. */
1024
+ readonly mode?: ColorMode;
1025
+ }
1026
+
1027
+ /**
1028
+ * Props of {@link ThemeProvider}.
1029
+ *
1030
+ * @public
1031
+ */
1032
+ export declare type ThemeProviderProps = ThemeProviderModeProps | ThemeProviderSingleProps;
1033
+
1034
+ /**
1035
+ * A single custom theme, which has one colour scheme, so there's no mode.
1036
+ *
1037
+ * @public
1038
+ */
1039
+ export declare interface ThemeProviderSingleProps extends ThemeProviderBaseProps {
1040
+ readonly theme: Theme;
1041
+ readonly mode?: undefined;
1042
+ }
1043
+
1044
+ /**
1045
+ * A button that turns something on or off, such as loop playback or the
1046
+ * active tool, exposed as `aria-pressed`. Controlled with `pressed` and
1047
+ * `onPressedChange`, or keeping its own state from `defaultPressed`.
1048
+ *
1049
+ * Its label names what it turns on and never changes with the state: screen
1050
+ * readers announce the state. For a button whose label changes, such as
1051
+ * play and pause, use `IconButton` or `Button` and swap the label instead.
1052
+ *
1053
+ * Inside a `Toolbar`, it's a toolbar item like any button: arrow keys reach
1054
+ * it, and Space or Enter toggles it.
1055
+ *
1056
+ * @example
1057
+ * ```tsx
1058
+ * <ToggleButton
1059
+ * label={messages.t("player.loop")}
1060
+ * icon={<LoopIcon />}
1061
+ * pressed={loop}
1062
+ * onPressedChange={setLoop}
1063
+ * />
1064
+ * ```
1065
+ *
1066
+ * @public
1067
+ */
1068
+ export declare const ToggleButton: ForwardRefExoticComponent<ToggleButtonProps & RefAttributes<HTMLButtonElement>>;
1069
+
1070
+ /**
1071
+ * Props every {@link ToggleButton} takes, with or without visible text.
1072
+ *
1073
+ * @public
1074
+ */
1075
+ export declare interface ToggleButtonBaseProps extends Omit<ButtonProps, "variant" | "pressed" | "aria-pressed" | "children" | "startIcon" | "endIcon" | "classNames"> {
1076
+ /** Defaults to `secondary`. */
1077
+ readonly variant?: ToggleButtonVariant | undefined;
1078
+ /** Whether it's on, when you control it. Leave it out to let the button keep its own state. */
1079
+ readonly pressed?: boolean | undefined;
1080
+ /** Whether it starts on, when it keeps its own state. Defaults to `false`. */
1081
+ readonly defaultPressed?: boolean | undefined;
1082
+ /**
1083
+ * Called with the new state when the button is activated. Calling
1084
+ * `event.preventDefault()` in `onClick` stops the change.
1085
+ */
1086
+ readonly onPressedChange?: ((pressed: boolean) => void) | undefined;
1087
+ }
1088
+
1089
+ /**
1090
+ * A square toggle button with only an icon.
1091
+ *
1092
+ * @public
1093
+ */
1094
+ export declare interface ToggleButtonIconProps extends ToggleButtonBaseProps {
1095
+ /** The icon. It draws with `currentColor`. */
1096
+ readonly icon: ReactNode;
1097
+ /** The accessible name. Required, because the button shows no text. It stays the same in both states. */
1098
+ readonly label: string;
1099
+ /** Extra classes on the root and the icon. */
1100
+ readonly classNames?: ClassNames<"root" | "icon"> | undefined;
1101
+ readonly children?: undefined;
1102
+ readonly startIcon?: undefined;
1103
+ readonly endIcon?: undefined;
1104
+ }
1105
+
1106
+ /**
1107
+ * Props of {@link ToggleButton}: visible text, or an icon with a `label`.
1108
+ *
1109
+ * @public
1110
+ */
1111
+ export declare type ToggleButtonProps = ToggleButtonTextProps | ToggleButtonIconProps;
1112
+
1113
+ /**
1114
+ * A toggle button with visible text, and optional icons beside it.
1115
+ *
1116
+ * @public
1117
+ */
1118
+ export declare interface ToggleButtonTextProps extends ToggleButtonBaseProps {
1119
+ /** The label. It must say what the button turns on, and stay the same in both states. */
1120
+ readonly children: ReactNode;
1121
+ /** An icon before the label. It's decorative, and draws with `currentColor`. */
1122
+ readonly startIcon?: ReactNode;
1123
+ /** An icon after the label. */
1124
+ readonly endIcon?: ReactNode;
1125
+ /** Extra classes per part. */
1126
+ readonly classNames?: ClassNames<ButtonPart> | undefined;
1127
+ readonly icon?: undefined;
1128
+ readonly label?: undefined;
1129
+ }
1130
+
1131
+ /**
1132
+ * How prominent a toggle button is: `secondary` (the default), or `quiet` for
1133
+ * toolbars. There's no `primary` or `danger`: their solid fill would make a
1134
+ * toggle that's off look more active than one that's on.
1135
+ *
1136
+ * @public
1137
+ */
1138
+ export declare type ToggleButtonVariant = Extract<ButtonVariant, "secondary" | "quiet">;
1139
+
1140
+ /**
1141
+ * A toolbar (WAI-ARIA `toolbar`): one Tab stop, arrow keys between its items,
1142
+ * Home and End to the ends. Items are any focusable descendants, such as
1143
+ * `Button`, `IconButton` and `SegmentedControl`. Disabled items that should
1144
+ * stay discoverable use `focusableWhenDisabled`.
1145
+ *
1146
+ * @example
1147
+ * ```tsx
1148
+ * <Toolbar label={messages.t("toolbar.label")}>
1149
+ * <ToolbarGroup label={messages.t("toolbar.history")}>
1150
+ * <IconButton label={messages.t("toolbar.undo")} icon={<UndoIcon />} />
1151
+ * </ToolbarGroup>
1152
+ * <ToolbarSeparator />
1153
+ * </Toolbar>
1154
+ * ```
1155
+ *
1156
+ * @public
1157
+ */
1158
+ export declare const Toolbar: ForwardRefExoticComponent<ToolbarProps & RefAttributes<HTMLDivElement>>;
1159
+
1160
+ /**
1161
+ * Related items in a toolbar, announced together as a named group. Arrow keys
1162
+ * move across groups as if they weren't there.
1163
+ *
1164
+ * @public
1165
+ */
1166
+ export declare const ToolbarGroup: ForwardRefExoticComponent<ToolbarGroupProps & RefAttributes<HTMLDivElement>>;
1167
+
1168
+ /**
1169
+ * Props of {@link ToolbarGroup}.
1170
+ *
1171
+ * @public
1172
+ */
1173
+ export declare interface ToolbarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "role"> {
1174
+ /** The group's accessible name, such as "Zoom". Required. */
1175
+ readonly label: string;
1176
+ }
1177
+
1178
+ /**
1179
+ * Props of {@link Toolbar}.
1180
+ *
1181
+ * @public
1182
+ */
1183
+ export declare interface ToolbarProps extends Omit<HTMLAttributes<HTMLDivElement>, "className" | "role">, StyleProps<"root"> {
1184
+ /** The toolbar's accessible name, such as "Page tools". Required. */
1185
+ readonly label: string;
1186
+ /** Defaults to `horizontal`. Arrow keys follow it. */
1187
+ readonly orientation?: "horizontal" | "vertical" | undefined;
1188
+ }
1189
+
1190
+ /**
1191
+ * A line between toolbar items: a native `<hr>`, so it's a separator to
1192
+ * assistive technology. It isn't focusable, and is oriented across the
1193
+ * toolbar.
1194
+ *
1195
+ * @public
1196
+ */
1197
+ export declare const ToolbarSeparator: ForwardRefExoticComponent<ToolbarSeparatorProps & RefAttributes<HTMLHRElement>>;
1198
+
1199
+ /**
1200
+ * Props of {@link ToolbarSeparator}.
1201
+ *
1202
+ * @public
1203
+ */
1204
+ export declare type ToolbarSeparatorProps = Omit<HTMLAttributes<HTMLHRElement>, "children">;
1205
+
1206
+ /**
1207
+ * Messages that include `ui`'s text: any sdk-core `Messages` object whose
1208
+ * catalogue spreads `uiMessages`.
1209
+ *
1210
+ * @public
1211
+ */
1212
+ export declare type UiMessages = Messages<typeof uiMessages>;
1213
+
1214
+ /**
1215
+ * English text for `@hussmartinez/ui`'s error codes. Applications and SDKs
1216
+ * spread it into their catalogue, next to `sdkCoreMessages`, so
1217
+ * `messages.error()` can describe a `UiError`. Components add their
1218
+ * text here as they arrive.
1219
+ *
1220
+ * @example
1221
+ * ```ts
1222
+ * export const en = defineMessages({ ...sdkCoreMessages, ...uiMessages });
1223
+ * ```
1224
+ *
1225
+ * @public
1226
+ */
1227
+ export declare const uiMessages: {
1228
+ readonly "dialog.close": "Close";
1229
+ readonly "fileDropZone.choose": "Choose a file";
1230
+ readonly "fileDropZone.chooseMultiple": "Choose files";
1231
+ readonly "fileDropZone.hint": "or drop it here";
1232
+ readonly "fileDropZone.hintMultiple": "or drop them here";
1233
+ readonly "progress.label": "Progress";
1234
+ readonly "spinner.label": "Loading";
1235
+ readonly "errors.INVALID_THEME_TOKEN": "The theme setting {token} has a value that can't be used.";
1236
+ readonly "errors.INVALID_THEME_SELECTOR": "The theme can't be applied to the selector {selector}.";
1237
+ };
1238
+
1239
+ /**
1240
+ * Gives `ui`'s components their text (ADR 0014). SDKs and applications pass
1241
+ * their message catalogue once, here; a component's own text props still win.
1242
+ * Without a provider, components use English.
1243
+ *
1244
+ * @example
1245
+ * ```tsx
1246
+ * const messages = createMessages({ ...sdkCoreMessages, ...uiMessages, ...en }, { locale });
1247
+ * <UiMessagesProvider messages={messages}>{editor}</UiMessagesProvider>
1248
+ * ```
1249
+ *
1250
+ * @public
1251
+ */
1252
+ export declare function UiMessagesProvider({ messages, children }: UiMessagesProviderProps): ReactElement;
1253
+
1254
+ /**
1255
+ * Props of {@link UiMessagesProvider}.
1256
+ *
1257
+ * @public
1258
+ */
1259
+ export declare interface UiMessagesProviderProps {
1260
+ /** Your catalogue's messages, created with sdk-core's `createMessages`. */
1261
+ readonly messages: UiMessages;
1262
+ readonly children?: ReactNode;
1263
+ }
1264
+
1265
+ /**
1266
+ * The `undo` icon: Lucide's `undo-2`, mirrored in right-to-left text.
1267
+ *
1268
+ * @public
1269
+ */
1270
+ export declare function UndoIcon(props: IconProps): ReactElement;
1271
+
1272
+ /**
1273
+ * The `upload` icon: Lucide's `upload`.
1274
+ *
1275
+ * @public
1276
+ */
1277
+ export declare function UploadIcon(props: IconProps): ReactElement;
1278
+
1279
+ /**
1280
+ * The `announce` function of the closest {@link AnnouncerProvider}. Without
1281
+ * one, announcing does nothing and warns in development.
1282
+ *
1283
+ * @example
1284
+ * ```tsx
1285
+ * const announce = useAnnounce();
1286
+ * announce(messages.t("result.saved", { size }));
1287
+ * ```
1288
+ *
1289
+ * @public
1290
+ */
1291
+ export declare function useAnnounce(): Announce;
1292
+
1293
+ /**
1294
+ * The messages from the closest {@link UiMessagesProvider}, or English.
1295
+ *
1296
+ * @public
1297
+ */
1298
+ export declare function useUiMessages(): UiMessages;
1299
+
1300
+ /**
1301
+ * Content for assistive technology only: hidden on screen, but read out and
1302
+ * part of the accessible name of its parent. It has no `unstyled` prop,
1303
+ * because hiding is its whole purpose.
1304
+ *
1305
+ * @public
1306
+ */
1307
+ export declare const VisuallyHidden: ForwardRefExoticComponent<VisuallyHiddenProps & RefAttributes<HTMLElement>>;
1308
+
1309
+ /**
1310
+ * Props of {@link VisuallyHidden}.
1311
+ *
1312
+ * @public
1313
+ */
1314
+ export declare interface VisuallyHiddenProps extends HTMLAttributes<HTMLElement> {
1315
+ /** The element to render. Defaults to `span`. */
1316
+ readonly as?: "span" | "div";
1317
+ }
1318
+
1319
+ /**
1320
+ * The `volume` icon: Lucide's `volume-2`.
1321
+ *
1322
+ * @public
1323
+ */
1324
+ export declare function VolumeIcon(props: IconProps): ReactElement;
1325
+
1326
+ /**
1327
+ * The `warning` icon: Lucide's `triangle-exclamation-point`.
1328
+ *
1329
+ * @public
1330
+ */
1331
+ export declare function WarningIcon(props: IconProps): ReactElement;
1332
+
1333
+ /**
1334
+ * The `zoom-in` icon: Lucide's `zoom-in`.
1335
+ *
1336
+ * @public
1337
+ */
1338
+ export declare function ZoomInIcon(props: IconProps): ReactElement;
1339
+
1340
+ /**
1341
+ * The `zoom-out` icon: Lucide's `zoom-out`.
1342
+ *
1343
+ * @public
1344
+ */
1345
+ export declare function ZoomOutIcon(props: IconProps): ReactElement;
1346
+
1347
+ export { }