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