@vitavision/ui 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/index.d.ts +244 -7
- package/dist/index.js +590 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tabs.tsx +3 -10
- package/src/components/ThemeToggle.tsx +1 -5
- package/src/components/ui/Badge.tsx +1 -4
- package/src/components/ui/Breakdown.tsx +139 -0
- package/src/components/ui/Button.tsx +3 -15
- package/src/components/ui/Dialog.tsx +4 -19
- package/src/components/ui/Disclosure.tsx +2 -7
- package/src/components/ui/DropdownMenu.tsx +2 -16
- package/src/components/ui/Feedback.tsx +5 -9
- package/src/components/ui/Field.tsx +4 -15
- package/src/components/ui/HighlightedText.tsx +84 -0
- package/src/components/ui/Input.tsx +5 -43
- package/src/components/ui/Panel.tsx +4 -16
- package/src/components/ui/PoseInput.tsx +7 -5
- package/src/components/ui/Progress.tsx +80 -0
- package/src/components/ui/SegmentedControl.tsx +1 -3
- package/src/components/ui/Select.tsx +2 -10
- package/src/components/ui/Slider.tsx +2 -7
- package/src/components/ui/Table.tsx +182 -32
- package/src/components/ui/Textarea.tsx +149 -0
- package/src/components/ui/Toaster.tsx +3 -19
- package/src/components/ui/Toggle.tsx +1 -5
- package/src/components/ui/ToggleChip.tsx +1 -3
- package/src/components/ui/Tooltip.tsx +1 -5
- package/src/components/ui/VectorInput.tsx +1 -1
- package/src/components/ui/cn.ts +1 -2
- package/src/components/ui/highlightSpans.ts +110 -0
- package/src/components/ui/index.ts +18 -41
- package/src/components/ui/listboxModel.ts +1 -6
- package/src/components/ui/tableSort.ts +2 -9
- package/src/components/ui/tableWindow.ts +96 -0
- package/src/index.ts +1 -8
- package/src/styles.css +14 -0
- package/src/theme.ts +2 -7
package/README.md
CHANGED
|
@@ -125,11 +125,14 @@ keep independent preferences.
|
|
|
125
125
|
**Primitives** — `Badge`, `CountRun`, `StatusDot` · `Button`, `ButtonLink` (a navigation styled as a button — never nest a `Button` in a link), `buttonClasses` · `Dialog`, `ConfirmDialog`,
|
|
126
126
|
`DialogClose` · `Disclosure` · `DropdownMenu`, `MenuItem`, `MenuCheckboxItem`, `MenuLabel`,
|
|
127
127
|
`MenuSeparator` (a non-modal command and toggle menu) · `Callout`, `Empty`, `ErrorBox`,
|
|
128
|
-
`
|
|
129
|
-
`
|
|
128
|
+
`Skeleton`, `SkeletonRows` · `Progress` (a count out of a total, or indeterminate; `ProgressBar` is
|
|
129
|
+
deprecated) · `Breakdown`, `breakdownText` (counts by verdict as one thin stacked bar) · `Field` · `Input`, `NumberInput` (with an optional
|
|
130
|
+
`unit` written in the field; number-valued with `onValueChange`), `Textarea` (optionally growing
|
|
131
|
+
with its content between `minRows` and `maxRows`) · `HighlightedText`, `findSpans` (a string
|
|
132
|
+
with its placeholders, tags and terms marked, never parsed as HTML) · `VectorInput`,
|
|
130
133
|
`PoseInput` · `Kbd` · `Listbox` (single choice among options that render their own content) ·
|
|
131
134
|
`PageHeader`, `Panel`, `ReadoutStrip`, `Section` · `Popover`, `PopoverClose` ·
|
|
132
|
-
`SegmentedControl` · `Select` · `Slider` · `Table` ·
|
|
135
|
+
`SegmentedControl` · `Select` · `Slider` · `Table` (with `windowed` for thousands of rows, and `selectionFollowsFocus` for keyboard selection) ·
|
|
133
136
|
`Checkbox`, `Switch` · `ToggleChip` · `Toaster`, `toast()` (notifications from anywhere; mount one `<Toaster />` near the root) ·
|
|
134
137
|
`InfoHint`, `Tooltip`, `TooltipProvider` ·
|
|
135
138
|
`ThemeToggle` · plus `cn`, `focusRing`, `focusRingInset`, and `formatNumber` / `parseNumber`
|
package/dist/index.d.ts
CHANGED
|
@@ -154,6 +154,69 @@ export declare function CountRun({ counts, className }: {
|
|
|
154
154
|
className?: string | undefined;
|
|
155
155
|
}): import("react").JSX.Element;
|
|
156
156
|
//#endregion
|
|
157
|
+
//#region src/components/ui/Breakdown.d.ts
|
|
158
|
+
/**
|
|
159
|
+
* The colour of a `Breakdown` segment: a verdict (`normal`, `warn`, `defect`) for things the app
|
|
160
|
+
* has judged, or `neutral` for a category that is no verdict (skipped, not applicable).
|
|
161
|
+
*/
|
|
162
|
+
type BreakdownTone = "normal" | "warn" | "defect" | "neutral";
|
|
163
|
+
/** One category of a `Breakdown`: how many, in which colour, and what a reader calls them. */
|
|
164
|
+
interface BreakdownSegment {
|
|
165
|
+
/** How many. Negative and non-finite values count as 0, and a segment of 0 is left out. */
|
|
166
|
+
value: number;
|
|
167
|
+
/** The colour, by meaning. */
|
|
168
|
+
tone: BreakdownTone;
|
|
169
|
+
/** What the count is, as it reads after the number: `"done"` gives "412 done". Unique among the segments. */
|
|
170
|
+
label: string;
|
|
171
|
+
}
|
|
172
|
+
/** Options of `breakdownText`, the same as the `Breakdown` props of the same names. */
|
|
173
|
+
interface BreakdownTextOptions {
|
|
174
|
+
/** The whole. Defaults to the sum of the segments; a total below the sum counts as the sum. */
|
|
175
|
+
total?: number | undefined;
|
|
176
|
+
/** What the rest of the total is, as it reads after the number: `"to do"` gives "131 to do". */
|
|
177
|
+
remainderLabel?: string | undefined;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The counts of a breakdown in words: `"412 done, 20 to check, 3 problems, 131 to do of 566"`.
|
|
181
|
+
*
|
|
182
|
+
* It is the default accessible name of `Breakdown`, and the text for a tooltip or a label printed
|
|
183
|
+
* beside the bar. Segments of 0 are left out; the rest of the total is named only with a
|
|
184
|
+
* `remainderLabel`. With nothing to count it reads `"0 of 566"`.
|
|
185
|
+
*
|
|
186
|
+
* @param segments - The categories, in order.
|
|
187
|
+
* @param options - The `total` and the `remainderLabel`.
|
|
188
|
+
* @returns The text.
|
|
189
|
+
*/
|
|
190
|
+
export declare function breakdownText(segments: readonly BreakdownSegment[], options?: BreakdownTextOptions): string;
|
|
191
|
+
/** Props of `Breakdown`: the segments and their total, plus the `<div>` props. */
|
|
192
|
+
type BreakdownProps = Omit<ComponentProps<"div">, "children" | "role"> & {
|
|
193
|
+
/** The categories, drawn left to right in this order, each as wide as its share of the total. */
|
|
194
|
+
segments: readonly BreakdownSegment[];
|
|
195
|
+
/**
|
|
196
|
+
* The whole. Defaults to the sum of the segments; the rest is drawn as empty track. A total
|
|
197
|
+
* below the sum counts as the sum.
|
|
198
|
+
*/
|
|
199
|
+
total?: number | undefined;
|
|
200
|
+
/** What the empty track counts, for the accessible name: `"to do"` gives "131 to do". */
|
|
201
|
+
remainderLabel?: string | undefined;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* A thin bar of counts by category: 412 done, 20 to check and 3 problems out of 566, with the
|
|
205
|
+
* rest as empty track. Segments are drawn in the order given, each as wide as its share of the
|
|
206
|
+
* total (a non-zero count is never narrower than 2 px); segments of 0 are left out.
|
|
207
|
+
*
|
|
208
|
+
* Its colours are verdicts, so use it only for things the app has judged — never for a share of
|
|
209
|
+
* a continuous quantity or for series side by side (use `Progress` or a chart).
|
|
210
|
+
*
|
|
211
|
+
* A `role="img"` whose name lists every non-zero count, as `breakdownText` writes it: "412 done,
|
|
212
|
+
* 20 to check, 3 problems, 131 to do of 566". `aria-label` or `aria-labelledby` replaces it. The track
|
|
213
|
+
* matches `Progress` and follows the density in force. State is exposed as `data-state`
|
|
214
|
+
* (`"empty"` with nothing counted, `"partial"`, or `"complete"` when the segments fill the
|
|
215
|
+
* total), and each segment's tone as its `data-tone`. Width changes ease over 300 ms, and not at
|
|
216
|
+
* all with reduced motion.
|
|
217
|
+
*/
|
|
218
|
+
export declare function Breakdown({ segments, total, remainderLabel, className, "aria-label": ariaLabel, ...rest }: BreakdownProps): import("react").JSX.Element;
|
|
219
|
+
//#endregion
|
|
157
220
|
//#region src/components/ui/Button.d.ts
|
|
158
221
|
/**
|
|
159
222
|
* A button's look, by what the action is: `primary` for the one action a screen is for,
|
|
@@ -464,6 +527,9 @@ export declare function SkeletonRows({ rows, className }: {
|
|
|
464
527
|
* A `role="progressbar"` with `aria-valuenow` in percent. Its accessible name is
|
|
465
528
|
* `aria-label` if given, else `label`, else "Progress" — pass one that names the job when
|
|
466
529
|
* a screen shows more than one bar.
|
|
530
|
+
*
|
|
531
|
+
* @deprecated Use `Progress`: a value out of a `max` with a "412 of 2,556" value text, an
|
|
532
|
+
* indeterminate state, and a track that follows the density.
|
|
467
533
|
*/
|
|
468
534
|
export declare function ProgressBar({ fraction, label, "aria-label": ariaLabel, className }: {
|
|
469
535
|
/** Done, from 0 to 1. Clamped. */
|
|
@@ -510,6 +576,75 @@ export declare function Field({ label, description, error, required, annotation,
|
|
|
510
576
|
children: ReactNode;
|
|
511
577
|
}): import("react").JSX.Element;
|
|
512
578
|
//#endregion
|
|
579
|
+
//#region src/components/ui/highlightSpans.d.ts
|
|
580
|
+
/** What a highlighted span is. Each kind has its own shape on screen, not only its own colour. */
|
|
581
|
+
type HighlightKind = "placeholder" | "tag" | "protected-term" | "mismatch";
|
|
582
|
+
/** A highlighted range of the text: `[start, end)` in UTF-16 code units. */
|
|
583
|
+
interface HighlightSpan {
|
|
584
|
+
/** The offset of the span's first code unit. */
|
|
585
|
+
start: number;
|
|
586
|
+
/** The offset just past the span's last code unit. */
|
|
587
|
+
end: number;
|
|
588
|
+
/** What the span is; it decides the span's shape and its default label. */
|
|
589
|
+
kind: HighlightKind;
|
|
590
|
+
/**
|
|
591
|
+
* What a screen reader hears after the span, instead of the kind's default label: say
|
|
592
|
+
* *why* it is marked ("missing from the translation").
|
|
593
|
+
*/
|
|
594
|
+
label?: string | undefined;
|
|
595
|
+
}
|
|
596
|
+
/** A pattern whose matches become spans of one kind. */
|
|
597
|
+
interface HighlightRule {
|
|
598
|
+
/** Matched against the whole text, every match (the `g` flag is added if missing). */
|
|
599
|
+
pattern: RegExp;
|
|
600
|
+
/** The kind every match gets. */
|
|
601
|
+
kind: HighlightKind;
|
|
602
|
+
/** The spans' `label`, if they need one. */
|
|
603
|
+
label?: string | undefined;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Spans for every match of every rule: `%1`, `<b>`, a glossary term. Empty matches are
|
|
607
|
+
* skipped. The result is sorted by start, then longest first.
|
|
608
|
+
*
|
|
609
|
+
* @param text - The string to search.
|
|
610
|
+
* @param rules - Each pattern and the kind its matches get.
|
|
611
|
+
* @returns The spans, ready for `HighlightedText`.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```ts
|
|
615
|
+
* findSpans("Open %1 in <b>ParamsManager</b>", [
|
|
616
|
+
* { pattern: /%\d+/, kind: "placeholder" },
|
|
617
|
+
* { pattern: /<\/?[a-z][^>]*>/i, kind: "tag" },
|
|
618
|
+
* { pattern: /\bParamsManager\b/, kind: "protected-term" },
|
|
619
|
+
* ]);
|
|
620
|
+
* ```
|
|
621
|
+
*/
|
|
622
|
+
export declare function findSpans(text: string, rules: readonly HighlightRule[]): HighlightSpan[];
|
|
623
|
+
//#endregion
|
|
624
|
+
//#region src/components/ui/HighlightedText.d.ts
|
|
625
|
+
/** Props of `HighlightedText`: the text, its spans, and every `<span>` prop but `children`. */
|
|
626
|
+
type HighlightedTextProps = Omit<ComponentProps<"span">, "children"> & {
|
|
627
|
+
/** The string. Shown as text, whitespace and line breaks kept; markup in it is not interpreted. */
|
|
628
|
+
text: string;
|
|
629
|
+
/** The ranges to mark, in UTF-16 offsets, in any order; overlaps are allowed. `findSpans` builds them from patterns. */
|
|
630
|
+
spans?: readonly HighlightSpan[] | undefined;
|
|
631
|
+
/**
|
|
632
|
+
* What a screen reader hears after a span of each kind: "placeholder", "markup",
|
|
633
|
+
* "protected term" and "mismatch" by default. `null` silences a kind. A span's own `label` wins.
|
|
634
|
+
*/
|
|
635
|
+
labels?: Partial<Record<HighlightKind, string | null>> | undefined;
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* A string with highlighted spans: placeholders (`%1`, `{count}`), markup tags (`<b>`),
|
|
639
|
+
* protected terms (`ParamsManager`) and mismatches, each drawn in its own shape. The caller
|
|
640
|
+
* supplies the spans, or finds them with `findSpans`.
|
|
641
|
+
*
|
|
642
|
+
* The text is rendered as text, never as HTML. Each span is a `<mark>` with `data-kind` (the
|
|
643
|
+
* kinds covering it, space-separated), followed by its label for screen readers ("%1,
|
|
644
|
+
* placeholder"), which a copy of the text leaves out.
|
|
645
|
+
*/
|
|
646
|
+
export declare function HighlightedText({ text, spans, labels, className, ...rest }: HighlightedTextProps): import("react").JSX.Element;
|
|
647
|
+
//#endregion
|
|
513
648
|
//#region src/components/ui/Input.d.ts
|
|
514
649
|
/**
|
|
515
650
|
* The shared look of a text-like control — border, palette, placeholder, hover, disabled and
|
|
@@ -598,11 +733,6 @@ type NumberInputProps = Omit<ComponentProps<"input">, "min" | "max" | "value"> &
|
|
|
598
733
|
* is the native text-valued input.
|
|
599
734
|
*/
|
|
600
735
|
export declare function NumberInput({ onValueChange, onClear, precision, ...props }: NumberInputProps): import("react").JSX.Element;
|
|
601
|
-
/**
|
|
602
|
-
* Multi-line text — set in mono, for JSON and lists. Takes every `<textarea>` prop, `ref`
|
|
603
|
-
* included.
|
|
604
|
-
*/
|
|
605
|
-
export declare function Textarea({ className, "aria-describedby": describedBy, ...rest }: ComponentProps<"textarea">): import("react").JSX.Element;
|
|
606
736
|
//#endregion
|
|
607
737
|
//#region src/components/ui/Kbd.d.ts
|
|
608
738
|
/**
|
|
@@ -776,6 +906,39 @@ export declare function ReadoutStrip({ items, className }: {
|
|
|
776
906
|
className?: string | undefined;
|
|
777
907
|
}): import("react").JSX.Element | null;
|
|
778
908
|
//#endregion
|
|
909
|
+
//#region src/components/ui/Progress.d.ts
|
|
910
|
+
/**
|
|
911
|
+
* The accessible value text of a progress: `"412 of 2,556"`, or `null` while indeterminate.
|
|
912
|
+
*
|
|
913
|
+
* @param value - Done so far; `null` or `undefined` for an unknown amount.
|
|
914
|
+
* @param max - The whole. Defaults to 100.
|
|
915
|
+
* @returns The text, with the value clamped to `[0, max]`.
|
|
916
|
+
*/
|
|
917
|
+
export declare function progressText(value: number | null | undefined, max?: number): string | null;
|
|
918
|
+
/** Props of `Progress`: a value out of a `max`, or none for an unknown amount, plus the `<div>` props. */
|
|
919
|
+
type ProgressProps = Omit<ComponentProps<"div">, "children" | "role"> & {
|
|
920
|
+
/** Done so far, from 0 to `max`; clamped. `null` or left out: indeterminate, the amount unknown. */
|
|
921
|
+
value?: number | null | undefined;
|
|
922
|
+
/** The whole. Defaults to 100; a value ≤ 0 counts as 100. */
|
|
923
|
+
max?: number | undefined;
|
|
924
|
+
/**
|
|
925
|
+
* What a screen reader says for the value. Defaults to `"412 of 2,556"`; give your own when
|
|
926
|
+
* the unit matters ("412 of 2,556 strings").
|
|
927
|
+
*/
|
|
928
|
+
valueText?: string | undefined;
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* A progress bar: determinate when it has a `value` (a `max`, 100 by default), indeterminate
|
|
932
|
+
* without one. Name it with `aria-label` or `aria-labelledby`.
|
|
933
|
+
*
|
|
934
|
+
* A `progressbar` with `aria-valuenow`, `aria-valuemax` and `aria-valuetext` ("412 of 2,556",
|
|
935
|
+
* or your `valueText`); indeterminate, it has none of them, as the ARIA pattern asks.
|
|
936
|
+
* The track follows the density in force. State is exposed as `data-state`
|
|
937
|
+
* (`"indeterminate"`, `"loading"` or `"complete"`). With reduced motion the indeterminate bar
|
|
938
|
+
* holds still.
|
|
939
|
+
*/
|
|
940
|
+
export declare function Progress({ value, max, valueText, className, ...rest }: ProgressProps): import("react").JSX.Element;
|
|
941
|
+
//#endregion
|
|
779
942
|
//#region src/components/ui/Popover.d.ts
|
|
780
943
|
/** Props of `Popover`. */
|
|
781
944
|
interface PopoverProps {
|
|
@@ -1064,6 +1227,25 @@ type Column<Row> = {
|
|
|
1064
1227
|
*/
|
|
1065
1228
|
firstSort?: SortDirection | undefined;
|
|
1066
1229
|
};
|
|
1230
|
+
/**
|
|
1231
|
+
* Windowed rendering for a long table: only the rows in view, plus `overscan` on each side,
|
|
1232
|
+
* are in the DOM. The rows scroll under a sticky header drawn on `surface`, the panel colour.
|
|
1233
|
+
*/
|
|
1234
|
+
interface TableWindowing {
|
|
1235
|
+
/**
|
|
1236
|
+
* Every body row's height in px. Rows are drawn exactly this tall and cells keep to one line
|
|
1237
|
+
* (longer content is cut with an ellipsis), so it must be at least the density's own row
|
|
1238
|
+
* height: 36 px comfortable, 22 px compact.
|
|
1239
|
+
*/
|
|
1240
|
+
rowHeight: number;
|
|
1241
|
+
/**
|
|
1242
|
+
* The scroll area's height in px, header included. Leave it out to fill the height of the
|
|
1243
|
+
* container, which must then have one (a flex child with `min-h-0`, a fixed-height panel).
|
|
1244
|
+
*/
|
|
1245
|
+
height?: number | undefined;
|
|
1246
|
+
/** Rows rendered beyond each edge of the view, so a fast scroll shows no gap. Defaults to 8. */
|
|
1247
|
+
overscan?: number | undefined;
|
|
1248
|
+
}
|
|
1067
1249
|
/**
|
|
1068
1250
|
* A table of rows, with numeric columns set in mono and right-aligned.
|
|
1069
1251
|
*
|
|
@@ -1078,8 +1260,13 @@ type Column<Row> = {
|
|
|
1078
1260
|
* `defaultSort`) or controlled (`sort` with `onSortChange`); with `manualSort` the headers
|
|
1079
1261
|
* show it and the rows render as given. Row callbacks always receive a row's index in `rows`,
|
|
1080
1262
|
* whatever the order on screen.
|
|
1263
|
+
*
|
|
1264
|
+
* Activatable rows also move focus with the arrow keys, Page Up / Page Down and Home / End;
|
|
1265
|
+
* with `selectionFollowsFocus` each of those moves also activates the row it lands on.
|
|
1266
|
+
* With `windowed` the table scrolls itself (vertically, under a sticky header), renders only the
|
|
1267
|
+
* rows in view, and uses a fixed layout: give columns a `width` where the content needs it.
|
|
1081
1268
|
*/
|
|
1082
|
-
export declare function Table<Row>({ columns, rows, rowKey, empty, caption, className, onRowClick, isRowActive, onRowHover, sort: controlledSort, defaultSort, onSortChange, manualSort }: {
|
|
1269
|
+
export declare function Table<Row>({ columns, rows, rowKey, empty, caption, className, onRowClick, isRowActive, onRowHover, sort: controlledSort, defaultSort, onSortChange, manualSort, windowed, selectionFollowsFocus }: {
|
|
1083
1270
|
/** The columns, in order. */
|
|
1084
1271
|
columns: Column<Row>[];
|
|
1085
1272
|
/** The rows, in their own order: the order shown while the table is not sorted. */
|
|
@@ -1122,8 +1309,58 @@ export declare function Table<Row>({ columns, rows, rowKey, empty, caption, clas
|
|
|
1122
1309
|
* and the rows render exactly as given. Mark the columns it can sort `sortable: true`.
|
|
1123
1310
|
*/
|
|
1124
1311
|
manualSort?: boolean | undefined;
|
|
1312
|
+
/**
|
|
1313
|
+
* Render only the rows in view, for a long table: every row `rowHeight` tall, in a scroll
|
|
1314
|
+
* area of `height` (or the container's height) under a sticky header. Sorting, row
|
|
1315
|
+
* callbacks and keyboard navigation work as without it.
|
|
1316
|
+
*/
|
|
1317
|
+
windowed?: TableWindowing | undefined;
|
|
1318
|
+
/**
|
|
1319
|
+
* Activate a row as soon as the keyboard moves to it: each arrow key, Page Up / Page Down,
|
|
1320
|
+
* Home or End that lands on another row also calls `onRowClick` for that row, with the key
|
|
1321
|
+
* press as the event — selection follows focus, as in a list where the selected item shows
|
|
1322
|
+
* its detail beside the list. Clicks, Enter and Space work as without it. Leave it off when
|
|
1323
|
+
* activating a row is costly or navigates away: then a reader can move through the rows and
|
|
1324
|
+
* choose one. Needs `onRowClick`.
|
|
1325
|
+
*/
|
|
1326
|
+
selectionFollowsFocus?: boolean | undefined;
|
|
1125
1327
|
}): import("react").JSX.Element;
|
|
1126
1328
|
//#endregion
|
|
1329
|
+
//#region src/components/ui/Textarea.d.ts
|
|
1330
|
+
/**
|
|
1331
|
+
* Props of `Textarea`: every `<textarea>` prop, `ref` included, plus an invalid state, the
|
|
1332
|
+
* mono face, and growing with the content between `minRows` and `maxRows`.
|
|
1333
|
+
*/
|
|
1334
|
+
type TextareaProps = ComponentProps<"textarea"> & {
|
|
1335
|
+
/** Called with the new text on every edit, alongside the native `onChange`. */
|
|
1336
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
1337
|
+
/**
|
|
1338
|
+
* Marks the value as wrong: `aria-invalid`, `data-invalid` and a border in the defect
|
|
1339
|
+
* colour. Inside a `Field` with an `error` it is on without this. Say what is wrong in
|
|
1340
|
+
* text too (the field's `error`): the border alone is a colour.
|
|
1341
|
+
*/
|
|
1342
|
+
invalid?: boolean | undefined;
|
|
1343
|
+
/** Sets the text in IBM Plex Mono, for code, JSON, lists, or strings whose characters all matter. */
|
|
1344
|
+
mono?: boolean | undefined;
|
|
1345
|
+
/**
|
|
1346
|
+
* Grows with the content from this many lines. Set it or `maxRows` to turn growing on;
|
|
1347
|
+
* `rows` is then ignored.
|
|
1348
|
+
*/
|
|
1349
|
+
minRows?: number | undefined;
|
|
1350
|
+
/** Stops growing at this many lines and scrolls beyond them. Set it or `minRows` to turn growing on. */
|
|
1351
|
+
maxRows?: number | undefined;
|
|
1352
|
+
};
|
|
1353
|
+
/**
|
|
1354
|
+
* Multi-line text, on the shared control palette. Takes every `<textarea>` prop, `ref`
|
|
1355
|
+
* included; inside a `Field` it is described by the field's description and error, and
|
|
1356
|
+
* shown invalid while the field has an error.
|
|
1357
|
+
*
|
|
1358
|
+
* With `minRows` or `maxRows` it grows with its content between the two (and scrolls past
|
|
1359
|
+
* `maxRows`); without them it is `rows` tall and the reader can resize it. State is exposed
|
|
1360
|
+
* as `data-invalid`.
|
|
1361
|
+
*/
|
|
1362
|
+
export declare function Textarea({ className, "aria-describedby": describedBy, invalid, mono, minRows, maxRows, rows, value, onChange, onValueChange, ref, ...rest }: TextareaProps): import("react").JSX.Element;
|
|
1363
|
+
//#endregion
|
|
1127
1364
|
//#region src/components/ui/Toggle.d.ts
|
|
1128
1365
|
/**
|
|
1129
1366
|
* A setting: changes how the thing behaves from now on, and reads as one ("show the mask").
|
|
@@ -1422,5 +1659,5 @@ export declare function Tabs<Id extends string>({ items, active, onSelect, label
|
|
|
1422
1659
|
className?: string | undefined;
|
|
1423
1660
|
}): import("react").JSX.Element;
|
|
1424
1661
|
//#endregion
|
|
1425
|
-
export type { BackLink, ButtonSize, ButtonVariant, CalloutTone, Column, Density, DropdownMenuProps, ListboxOption, ListboxOptionState, ListboxProps, MeasureTone, MenuCheckboxItemProps, MenuItemProps, NumberInputProps, PopoverProps, PoseInputProps, PoseValue, Quaternion, ReadoutItem, RotationView, SelectOption, SortDirection, TabItem, TableSort, ThemeChoice, ToastOptions, ToastRecord, ToastStore, ToastTone, ToasterProps, Tone, Vec3, VectorInputProps };
|
|
1662
|
+
export type { BackLink, BreakdownProps, BreakdownSegment, BreakdownTextOptions, BreakdownTone, ButtonSize, ButtonVariant, CalloutTone, Column, Density, DropdownMenuProps, HighlightKind, HighlightRule, HighlightSpan, HighlightedTextProps, ListboxOption, ListboxOptionState, ListboxProps, MeasureTone, MenuCheckboxItemProps, MenuItemProps, NumberInputProps, PopoverProps, PoseInputProps, PoseValue, ProgressProps, Quaternion, ReadoutItem, RotationView, SelectOption, SortDirection, TabItem, TableSort, TableWindowing, TextareaProps, ThemeChoice, ToastOptions, ToastRecord, ToastStore, ToastTone, ToasterProps, Tone, Vec3, VectorInputProps };
|
|
1426
1663
|
//# sourceMappingURL=index.d.ts.map
|