@mortenbrudvik/waveui 0.8.0 → 0.9.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 +231 -85
- package/dist/components/data-display/InfoButton.cjs +2 -0
- package/dist/components/data-display/InfoButton.cjs.map +1 -0
- package/dist/components/data-display/InfoButton.mjs +173 -0
- package/dist/components/data-display/InfoButton.mjs.map +1 -0
- package/dist/components/data-display/InfoLabel.cjs +1 -1
- package/dist/components/data-display/InfoLabel.cjs.map +1 -1
- package/dist/components/data-display/InfoLabel.mjs +39 -96
- package/dist/components/data-display/InfoLabel.mjs.map +1 -1
- package/dist/components/input/Checkbox.cjs +1 -1
- package/dist/components/input/Checkbox.cjs.map +1 -1
- package/dist/components/input/Checkbox.mjs +91 -75
- package/dist/components/input/Checkbox.mjs.map +1 -1
- package/dist/components/input/ColorPicker.parts.cjs +1 -1
- package/dist/components/input/ColorPicker.parts.cjs.map +1 -1
- package/dist/components/input/ColorPicker.parts.mjs +1 -1
- package/dist/components/input/ColorPicker.parts.mjs.map +1 -1
- package/dist/components/input/Combobox.cjs +1 -1
- package/dist/components/input/Combobox.cjs.map +1 -1
- package/dist/components/input/Combobox.expand.cjs +1 -1
- package/dist/components/input/Combobox.expand.cjs.map +1 -1
- package/dist/components/input/Combobox.expand.mjs +20 -20
- package/dist/components/input/Combobox.expand.mjs.map +1 -1
- package/dist/components/input/Combobox.mjs +143 -138
- package/dist/components/input/Combobox.mjs.map +1 -1
- package/dist/components/input/DatePicker.cjs +1 -1
- package/dist/components/input/DatePicker.cjs.map +1 -1
- package/dist/components/input/DatePicker.mjs +213 -209
- package/dist/components/input/DatePicker.mjs.map +1 -1
- package/dist/components/input/Dropdown.cjs +1 -1
- package/dist/components/input/Dropdown.cjs.map +1 -1
- package/dist/components/input/Dropdown.mjs +80 -74
- package/dist/components/input/Dropdown.mjs.map +1 -1
- package/dist/components/input/Field.cjs +1 -1
- package/dist/components/input/Field.cjs.map +1 -1
- package/dist/components/input/Field.mjs +99 -66
- package/dist/components/input/Field.mjs.map +1 -1
- package/dist/components/input/Input.cjs +1 -1
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.mjs +79 -55
- package/dist/components/input/Input.mjs.map +1 -1
- package/dist/components/input/Label.cjs +1 -1
- package/dist/components/input/Label.cjs.map +1 -1
- package/dist/components/input/Label.mjs +19 -13
- package/dist/components/input/Label.mjs.map +1 -1
- package/dist/components/input/Rating.cjs +1 -1
- package/dist/components/input/Rating.cjs.map +1 -1
- package/dist/components/input/Rating.item.cjs +2 -0
- package/dist/components/input/Rating.item.cjs.map +1 -0
- package/dist/components/input/Rating.item.mjs +255 -0
- package/dist/components/input/Rating.item.mjs.map +1 -0
- package/dist/components/input/Rating.mjs +150 -151
- package/dist/components/input/Rating.mjs.map +1 -1
- package/dist/components/input/SearchBox.cjs +1 -1
- package/dist/components/input/SearchBox.cjs.map +1 -1
- package/dist/components/input/SearchBox.mjs +146 -115
- package/dist/components/input/SearchBox.mjs.map +1 -1
- package/dist/components/input/Select.cjs +1 -1
- package/dist/components/input/Select.cjs.map +1 -1
- package/dist/components/input/Select.mjs +34 -25
- package/dist/components/input/Select.mjs.map +1 -1
- package/dist/components/input/Slider.cjs +1 -1
- package/dist/components/input/Slider.cjs.map +1 -1
- package/dist/components/input/Slider.mjs +77 -54
- package/dist/components/input/Slider.mjs.map +1 -1
- package/dist/components/input/SpinButton.cjs +1 -1
- package/dist/components/input/SpinButton.cjs.map +1 -1
- package/dist/components/input/SpinButton.mjs +198 -96
- package/dist/components/input/SpinButton.mjs.map +1 -1
- package/dist/components/input/Switch.cjs +1 -1
- package/dist/components/input/Switch.cjs.map +1 -1
- package/dist/components/input/Switch.mjs +71 -55
- package/dist/components/input/Switch.mjs.map +1 -1
- package/dist/components/input/TagPicker.cjs +1 -1
- package/dist/components/input/TagPicker.cjs.map +1 -1
- package/dist/components/input/TagPicker.mjs +142 -116
- package/dist/components/input/TagPicker.mjs.map +1 -1
- package/dist/components/input/Textarea.cjs +1 -1
- package/dist/components/input/Textarea.cjs.map +1 -1
- package/dist/components/input/Textarea.mjs +28 -21
- package/dist/components/input/Textarea.mjs.map +1 -1
- package/dist/components/input/TimePicker.cjs +1 -1
- package/dist/components/input/TimePicker.cjs.map +1 -1
- package/dist/components/input/TimePicker.mjs +189 -184
- package/dist/components/input/TimePicker.mjs.map +1 -1
- package/dist/components/input/fieldLabel.cjs +2 -0
- package/dist/components/input/fieldLabel.cjs.map +1 -0
- package/dist/components/input/fieldLabel.mjs +17 -0
- package/dist/components/input/fieldLabel.mjs.map +1 -0
- package/dist/components/input/inputLook.cjs +2 -0
- package/dist/components/input/inputLook.cjs.map +1 -0
- package/dist/components/input/inputLook.mjs +28 -0
- package/dist/components/input/inputLook.mjs.map +1 -0
- package/dist/components/input/pickerStyles.cjs +1 -1
- package/dist/components/input/pickerStyles.cjs.map +1 -1
- package/dist/components/input/pickerStyles.mjs +42 -4
- package/dist/components/input/pickerStyles.mjs.map +1 -1
- package/dist/components/navigation/Menu.popover.cjs +1 -1
- package/dist/components/navigation/Menu.popover.cjs.map +1 -1
- package/dist/components/navigation/Menu.popover.mjs +10 -10
- package/dist/components/navigation/Menu.root.cjs +1 -1
- package/dist/components/navigation/Menu.root.cjs.map +1 -1
- package/dist/components/navigation/Menu.root.mjs +10 -10
- package/dist/components/overlays/Popover.cjs +1 -1
- package/dist/components/overlays/Popover.cjs.map +1 -1
- package/dist/components/overlays/Popover.mjs +203 -208
- package/dist/components/overlays/Popover.mjs.map +1 -1
- package/dist/components/overlays/Popover.shared.cjs +1 -1
- package/dist/components/overlays/Popover.shared.cjs.map +1 -1
- package/dist/components/overlays/Popover.shared.mjs +82 -77
- package/dist/components/overlays/Popover.shared.mjs.map +1 -1
- package/dist/components/provider/WaveProvider.cjs +1 -1
- package/dist/components/provider/WaveProvider.cjs.map +1 -1
- package/dist/components/provider/WaveProvider.mjs +25 -19
- package/dist/components/provider/WaveProvider.mjs.map +1 -1
- package/dist/hooks/useFieldControl.cjs.map +1 -1
- package/dist/hooks/useFieldControl.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +805 -99
- package/dist/index.d.ts +805 -99
- package/dist/index.mjs +101 -99
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +74 -66
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/styles.cjs +1 -1
- package/dist/lib/styles.cjs.map +1 -1
- package/dist/lib/styles.mjs +21 -4
- package/dist/lib/styles.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/tokens.css +13 -0
package/dist/index.d.cts
CHANGED
|
@@ -1116,9 +1116,12 @@ export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivEle
|
|
|
1116
1116
|
* `labelPosition="before"` (the root carries `data-label-position`). The box lines up with the
|
|
1117
1117
|
* first line of a label that wraps or has a second line. `children` are not rendered (a
|
|
1118
1118
|
* development warning says so).
|
|
1119
|
+
* - `size` (`medium`, `large`) and `shape` (`square`, `circular`) set the box's dimensions and
|
|
1120
|
+
* corners; the root carries `data-size` and `data-shape`. Checkbox does not read a surrounding
|
|
1121
|
+
* `Field`'s size or a `WaveProvider`'s input defaults.
|
|
1119
1122
|
*/
|
|
1120
1123
|
export declare const Checkbox: {
|
|
1121
|
-
({ checked: checkedProp, defaultChecked, indeterminate, onCheckedChange, onChange, disabled, disabledFocusable, label, labelPosition, name, value, required, form, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, "aria-disabled": ariaDisabled, autoFocus, tabIndex, onClick, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, children, ref, ...rest }: CheckboxProps): React_2.JSX.Element;
|
|
1124
|
+
({ checked: checkedProp, defaultChecked, indeterminate, onCheckedChange, onChange, disabled, disabledFocusable, label, labelPosition, size, shape, name, value, required, form, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, "aria-disabled": ariaDisabled, autoFocus, tabIndex, onClick, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, children, ref, ...rest }: CheckboxProps): React_2.JSX.Element;
|
|
1122
1125
|
displayName: string;
|
|
1123
1126
|
};
|
|
1124
1127
|
|
|
@@ -1188,6 +1191,18 @@ export declare interface CheckboxProps extends Omit<React_2.HTMLAttributes<HTMLL
|
|
|
1188
1191
|
* @default 'after'
|
|
1189
1192
|
*/
|
|
1190
1193
|
labelPosition?: CheckboxLabelPosition;
|
|
1194
|
+
/**
|
|
1195
|
+
* Size of the box: an 18px box (the 0.7 look) or a 22px box with a bigger glyph. Unlike the
|
|
1196
|
+
* text controls and pickers, Checkbox does not read a surrounding Field's size or a
|
|
1197
|
+
* WaveProvider's input defaults: this prop is the only source of its size.
|
|
1198
|
+
* @default 'medium'
|
|
1199
|
+
*/
|
|
1200
|
+
size?: CheckboxSize;
|
|
1201
|
+
/**
|
|
1202
|
+
* Shape of the box: square corners (the 0.7 look) or a circular, round box.
|
|
1203
|
+
* @default 'square'
|
|
1204
|
+
*/
|
|
1205
|
+
shape?: CheckboxShape;
|
|
1191
1206
|
/**
|
|
1192
1207
|
* Form field name. With a name, the checkbox takes part in native form submission: it submits
|
|
1193
1208
|
* `name=value` while checked.
|
|
@@ -1217,6 +1232,12 @@ export declare interface CheckboxProps extends Omit<React_2.HTMLAttributes<HTMLL
|
|
|
1217
1232
|
ref?: React_2.Ref<HTMLLabelElement>;
|
|
1218
1233
|
}
|
|
1219
1234
|
|
|
1235
|
+
/** Shape of the box: square corners (the 0.7 look) or a circular, round box. */
|
|
1236
|
+
export declare type CheckboxShape = Extract<Shape, 'square' | 'circular'>;
|
|
1237
|
+
|
|
1238
|
+
/** Size of the box: an 18px box (the 0.7 look) or a 22px box with a bigger glyph. */
|
|
1239
|
+
export declare type CheckboxSize = Extract<Size, 'medium' | 'large'>;
|
|
1240
|
+
|
|
1220
1241
|
/**
|
|
1221
1242
|
* Checked items of a menu or toolbar, per group `name`: `{ sort: ['date'], view: ['ruler', 'grid'] }`.
|
|
1222
1243
|
* A checkbox or switch item (or a toolbar toggle) is checked while its `value` is in
|
|
@@ -1772,6 +1793,11 @@ export declare interface ColorSliderProps extends Omit<React_2.HTMLAttributes<HT
|
|
|
1772
1793
|
* `name`/`required` the value takes part in form submission, validation and reset. The open
|
|
1773
1794
|
* listbox renders in a portal; while closed it stays in the DOM, hidden.
|
|
1774
1795
|
*
|
|
1796
|
+
* **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
1797
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own prop,
|
|
1798
|
+
* then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
1799
|
+
* `data-appearance` on the root `<div>`. The listbox keeps its size.
|
|
1800
|
+
*
|
|
1775
1801
|
* Sub-components: `Combobox.Option`, `Combobox.OptionGroup`. React Server Components import the
|
|
1776
1802
|
* flat names `ComboboxOption` / `ComboboxOptionGroup` (dotted access needs a client file).
|
|
1777
1803
|
*/
|
|
@@ -1866,6 +1892,18 @@ export declare interface ComboboxProps extends Omit<React_2.HTMLAttributes<HTMLD
|
|
|
1866
1892
|
* @default false
|
|
1867
1893
|
*/
|
|
1868
1894
|
disabled?: boolean;
|
|
1895
|
+
/**
|
|
1896
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
1897
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`. The
|
|
1898
|
+
* listbox keeps its size.
|
|
1899
|
+
*/
|
|
1900
|
+
size?: CoreSize;
|
|
1901
|
+
/**
|
|
1902
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
1903
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
1904
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
1905
|
+
*/
|
|
1906
|
+
appearance?: InputAppearance;
|
|
1869
1907
|
/**
|
|
1870
1908
|
* Whether the typed text is itself the value. Without it, typing only filters the options (the
|
|
1871
1909
|
* first match becomes active, so Enter selects it) and the input shows the selected option's
|
|
@@ -2047,6 +2085,12 @@ export declare interface CompoundButtonOwnProps {
|
|
|
2047
2085
|
*/
|
|
2048
2086
|
export declare type CompoundButtonProps<C extends React_2.ElementType = 'button'> = PolymorphicProps<C, CompoundButtonOwnProps>;
|
|
2049
2087
|
|
|
2088
|
+
/**
|
|
2089
|
+
* The three-step size of text inputs, pickers, Field and Label (Fluent's field sizes): `small`
|
|
2090
|
+
* (24px tall), `medium` (32px) and `large` (40px).
|
|
2091
|
+
*/
|
|
2092
|
+
export declare type CoreSize = Extract<Size, 'small' | 'medium' | 'large'>;
|
|
2093
|
+
|
|
2050
2094
|
/**
|
|
2051
2095
|
* A small pill showing a count (unread messages, notifications), or with `dot` a small dot
|
|
2052
2096
|
* without a number. Renders nothing for a count of 0 (unless `showZero`) or less, and
|
|
@@ -2516,6 +2560,10 @@ export declare interface DataGridUncontrolledSortProps extends NoDeprecatedSortP
|
|
|
2516
2560
|
* clear button that disappears.
|
|
2517
2561
|
* - Every emitted date is local midnight. The calendar opens on the month of the selected date or
|
|
2518
2562
|
* today, clamped into `minDate`/`maxDate`.
|
|
2563
|
+
* - **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
2564
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own
|
|
2565
|
+
* prop, then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as
|
|
2566
|
+
* `data-size` and `data-appearance` on the root `<div>`. The calendar keeps its size.
|
|
2519
2567
|
* - The input (`controlRef`) receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
|
|
2520
2568
|
* `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`,
|
|
2521
2569
|
* `autoFocus`, `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes
|
|
@@ -2657,6 +2705,18 @@ export declare interface DatePickerProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
2657
2705
|
* @default false
|
|
2658
2706
|
*/
|
|
2659
2707
|
disabled?: boolean;
|
|
2708
|
+
/**
|
|
2709
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
2710
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`. The
|
|
2711
|
+
* calendar keeps its size.
|
|
2712
|
+
*/
|
|
2713
|
+
size?: CoreSize;
|
|
2714
|
+
/**
|
|
2715
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
2716
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
2717
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
2718
|
+
*/
|
|
2719
|
+
appearance?: InputAppearance;
|
|
2660
2720
|
/**
|
|
2661
2721
|
* Makes the input read-only: the calendar does not open and the value cannot change. Turning it
|
|
2662
2722
|
* (or `disabled`) on while the user is typing drops the typed text.
|
|
@@ -3354,6 +3414,11 @@ export declare interface DrawerTriggerRenderProps extends React_2.HTMLAttributes
|
|
|
3354
3414
|
* `name`/`required` the value takes part in form submission, validation and reset. The open
|
|
3355
3415
|
* listbox renders in a portal; while closed it stays in the DOM, hidden.
|
|
3356
3416
|
*
|
|
3417
|
+
* **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
3418
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own prop,
|
|
3419
|
+
* then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
3420
|
+
* `data-appearance` on the root `<div>`. The listbox keeps its size.
|
|
3421
|
+
*
|
|
3357
3422
|
* Sub-components: `Dropdown.Option`, `Dropdown.OptionGroup`. React Server Components import the
|
|
3358
3423
|
* flat names `DropdownOption` / `DropdownOptionGroup` (dotted access needs a client file).
|
|
3359
3424
|
*/
|
|
@@ -3439,6 +3504,18 @@ export declare interface DropdownProps extends Omit<React_2.HTMLAttributes<HTMLD
|
|
|
3439
3504
|
* @default false
|
|
3440
3505
|
*/
|
|
3441
3506
|
disabled?: boolean;
|
|
3507
|
+
/**
|
|
3508
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
3509
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`. The
|
|
3510
|
+
* listbox keeps its size.
|
|
3511
|
+
*/
|
|
3512
|
+
size?: CoreSize;
|
|
3513
|
+
/**
|
|
3514
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
3515
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
3516
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
3517
|
+
*/
|
|
3518
|
+
appearance?: InputAppearance;
|
|
3442
3519
|
/** Name of the value in form submissions (renders a hidden input). */
|
|
3443
3520
|
name?: string;
|
|
3444
3521
|
/** Id of the form the value belongs to, when the Dropdown is outside it. */
|
|
@@ -3483,6 +3560,17 @@ export declare interface DropdownProps extends Omit<React_2.HTMLAttributes<HTMLD
|
|
|
3483
3560
|
* - `orientation="horizontal"` puts the label in a start column beside the control, with the
|
|
3484
3561
|
* message and the hint below the control. The label lines up with the first line of the
|
|
3485
3562
|
* control (a Checkbox, Switch or RadioGroup gets 6px of padding above and below for it).
|
|
3563
|
+
* - `size` sets the label's type ramp and, in the horizontal layout, its top padding and the
|
|
3564
|
+
* padding that lines a Checkbox, Switch or RadioGroup row up with it, so the label's first
|
|
3565
|
+
* line keeps lining up with a 24, 32 or 40px control. The message and the hint stay small.
|
|
3566
|
+
* Controls inside read the prop from `FieldContext` as their own default `size` (their own
|
|
3567
|
+
* `size` wins); the Field's own label falls back to `WaveProvider inputDefaults.size`, else
|
|
3568
|
+
* `medium`, and the root always renders that resolved value as `data-size`.
|
|
3569
|
+
* - `label` also takes a `Label` or `InfoLabel` element, which renders in place of Field's own
|
|
3570
|
+
* `<label>` with the Field's wiring (see `label`); an InfoLabel's info button sits next to the
|
|
3571
|
+
* label text, outside the `<label>`, so the control is named by the text alone. A group control
|
|
3572
|
+
* (RadioGroup, your own `<div role="radiogroup">`) is named through `aria-labelledby` pointing
|
|
3573
|
+
* at that `<label>`.
|
|
3486
3574
|
* - Provides `FieldContext`: the library's inputs (Input, Select, Textarea, Slider, SearchBox,
|
|
3487
3575
|
* Checkbox, Switch, RadioGroup, Rating, SpinButton, pickers, …) read it wherever they are inside
|
|
3488
3576
|
* the Field and are named by the label, described by the message and the hint and marked
|
|
@@ -3543,6 +3631,13 @@ export declare interface DropdownProps extends Omit<React_2.HTMLAttributes<HTMLD
|
|
|
3543
3631
|
* </Field>
|
|
3544
3632
|
*
|
|
3545
3633
|
* @example
|
|
3634
|
+
* // An InfoLabel as the label: the input is named "Password", the info button
|
|
3635
|
+
* // "Password Information".
|
|
3636
|
+
* <Field label={<InfoLabel info="Use 12 characters or more.">Password</InfoLabel>} required>
|
|
3637
|
+
* <Input type="password" />
|
|
3638
|
+
* </Field>
|
|
3639
|
+
*
|
|
3640
|
+
* @example
|
|
3546
3641
|
* // A wrapper component goes inside a plain element.
|
|
3547
3642
|
* <Field label="Name" required>
|
|
3548
3643
|
* <div>
|
|
@@ -3553,7 +3648,7 @@ export declare interface DropdownProps extends Omit<React_2.HTMLAttributes<HTMLD
|
|
|
3553
3648
|
* </Field>
|
|
3554
3649
|
*/
|
|
3555
3650
|
export declare const Field: {
|
|
3556
|
-
({ label, hint, error, validationState, validationMessage, validationMessageIcon, orientation, required, htmlFor, className, children, ref, ...rest }: FieldProps): React_2.JSX.Element;
|
|
3651
|
+
({ label, hint, error, validationState, validationMessage, validationMessageIcon, orientation, size, required, htmlFor, className, children, ref, ...rest }: FieldProps): React_2.JSX.Element;
|
|
3557
3652
|
displayName: string;
|
|
3558
3653
|
};
|
|
3559
3654
|
|
|
@@ -3621,6 +3716,12 @@ export declare interface FieldContextValue {
|
|
|
3621
3716
|
* `errorId` is set only while that message is an error.
|
|
3622
3717
|
*/
|
|
3623
3718
|
validationMessageId?: string;
|
|
3719
|
+
/**
|
|
3720
|
+
* The Field's own `size` prop, when set: the default size of the text inputs and pickers inside
|
|
3721
|
+
* it (their own `size` wins). Absent when the Field has no `size` (the controls then fall back to
|
|
3722
|
+
* `WaveProvider inputDefaults`) and in contexts built before 0.9.
|
|
3723
|
+
*/
|
|
3724
|
+
size?: CoreSize;
|
|
3624
3725
|
}
|
|
3625
3726
|
|
|
3626
3727
|
/**
|
|
@@ -3683,6 +3784,18 @@ export declare interface FieldProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
3683
3784
|
/**
|
|
3684
3785
|
* Label displayed above the control (beside it with `orientation="horizontal"`); names the
|
|
3685
3786
|
* control.
|
|
3787
|
+
*
|
|
3788
|
+
* A `Label` or `InfoLabel` element passed as `label` renders in place of Field's own `<label>`,
|
|
3789
|
+
* never inside it, and names the control by its label text alone (an InfoLabel's info button
|
|
3790
|
+
* sits next to the `<label>`, outside it). Field always points it at the control (`htmlFor`),
|
|
3791
|
+
* and gives it the Field's label id, `required`, label `size` and `weight="semibold"` (the look
|
|
3792
|
+
* of Field's own label), each only where the element leaves it unset; Field's layout classes go
|
|
3793
|
+
* before the element's `className`, so the element's classes win. The element's own `htmlFor`
|
|
3794
|
+
* is read like the Field's `htmlFor` (which wins over it): it becomes the control's id when the
|
|
3795
|
+
* control has none, and one that points at another element is replaced, with a development
|
|
3796
|
+
* warning. Field shows no asterisk of its own next to such an element: the element shows its
|
|
3797
|
+
* `required` indicator. Only the element itself is recognized, not one inside a Fragment, an
|
|
3798
|
+
* array or another element.
|
|
3686
3799
|
*/
|
|
3687
3800
|
label?: React_2.ReactNode;
|
|
3688
3801
|
/** Hint shown below the control, after any validation message; describes the control. */
|
|
@@ -3725,6 +3838,12 @@ export declare interface FieldProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
3725
3838
|
* @default 'vertical'
|
|
3726
3839
|
*/
|
|
3727
3840
|
orientation?: Orientation;
|
|
3841
|
+
/**
|
|
3842
|
+
* The label's size and the default `size` of the text inputs and pickers inside the Field
|
|
3843
|
+
* (their own `size` wins; choice controls keep theirs). The message and the hint stay small.
|
|
3844
|
+
* @default `WaveProvider` `inputDefaults.size`, else `'medium'`.
|
|
3845
|
+
*/
|
|
3846
|
+
size?: CoreSize;
|
|
3728
3847
|
/**
|
|
3729
3848
|
* Whether the field is required: shows a decorative asterisk next to the label, sets
|
|
3730
3849
|
* `aria-required`, and turns on native constraint validation. `<input>`, `<select>`,
|
|
@@ -3737,7 +3856,8 @@ export declare interface FieldProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
3737
3856
|
required?: boolean;
|
|
3738
3857
|
/**
|
|
3739
3858
|
* The id of the control the label points at, when the control has no `id` of its own
|
|
3740
|
-
* (default: a
|
|
3859
|
+
* (default: the `htmlFor` of a `Label` or `InfoLabel` element passed as `label`, else a
|
|
3860
|
+
* generated id).
|
|
3741
3861
|
*/
|
|
3742
3862
|
htmlFor?: string;
|
|
3743
3863
|
/** Ref to the root `<div>`. */
|
|
@@ -3973,50 +4093,166 @@ export declare interface ImageProps extends React_2.ImgHTMLAttributes<HTMLImageE
|
|
|
3973
4093
|
export declare type ImageShape = Shape;
|
|
3974
4094
|
|
|
3975
4095
|
/**
|
|
3976
|
-
* A
|
|
4096
|
+
* A button with the info glyph that shows `info` in a note next to it: text, links or other rich
|
|
4097
|
+
* content, placed above the button with a beak (a toggletip).
|
|
4098
|
+
*
|
|
4099
|
+
* - **Naming.** The button is named "Information" (`aria-label`, which localizes it). Next to a
|
|
4100
|
+
* heading or other text, pass `aria-labelledby` with that text's id and the button's own `id`:
|
|
4101
|
+
* the button is then named "‹text› Information", so several info buttons on a page are told
|
|
4102
|
+
* apart. The note (`role="note"`) is labelled like the button: by the same `aria-labelledby`
|
|
4103
|
+
* ids, else by the button. The button has `aria-expanded`, and `aria-controls` while the note is
|
|
4104
|
+
* open, but no `aria-haspopup`: a note is none of the popup kinds it names.
|
|
4105
|
+
* - **Opening.** A click pins the note open, and a click on a pinned note closes it. With
|
|
4106
|
+
* `openOnHover` (the default) a mouse pointer resting on the button opens it after 250 ms, and
|
|
4107
|
+
* it closes 250 ms after the pointer has left the button and the note (a pointer moving
|
|
4108
|
+
* diagonally from the button into the note keeps it open; touch and pen never hover); keyboard
|
|
4109
|
+
* focus on the button opens it too, while focus that comes from a pointer press waits for the
|
|
4110
|
+
* click. A hover close moves no focus, and a note that keyboard focus opened or keeps never
|
|
4111
|
+
* closes because of pointer movement. Opening never moves focus. Escape, a press outside and
|
|
4112
|
+
* focus moving outside the button and the note close it; Escape returns focus to the button when
|
|
4113
|
+
* it was in the note, and a dismissed note opens again on keyboard focus only once focus has
|
|
4114
|
+
* left both.
|
|
4115
|
+
* - **Tab path.** The note is portaled, but it keeps its place right after the button in the
|
|
4116
|
+
* keyboard order: Tab from the open button enters the note's first element (a link in it), Tab
|
|
4117
|
+
* past its last element continues after the button, and Shift+Tab from its first element
|
|
4118
|
+
* returns to the button.
|
|
4119
|
+
* - **One copy of `info`.** While the note is closed, `info` renders next to the button in an
|
|
4120
|
+
* element that is not displayed and describes the button (`aria-describedby`), so it is in the
|
|
4121
|
+
* server HTML and is read when the button takes focus. While the note is shown, `info` renders
|
|
4122
|
+
* only inside it, in an unnamed element that describes the button. `info` is never in the
|
|
4123
|
+
* document twice, so content with ids or effects is safe; it remounts each time the note opens
|
|
4124
|
+
* and closes, so state inside it starts over and its effects run again.
|
|
4125
|
+
* - **Structure.** The button is the root element: `ref`, `className`, `style` and every other
|
|
4126
|
+
* attribute go to it, the consumer's handlers first. The description and the note render next
|
|
4127
|
+
* to it, never inside it. Its box is 24×24px at every `size` and renders `data-size`. The note
|
|
4128
|
+
* mounts through the presence core: it carries `data-presence`, `data-state` (`open`, and
|
|
4129
|
+
* `closed` while it exits, `inert`) and the `data-wave-infolabel-surface` marker; it ships no
|
|
4130
|
+
* motion of its own.
|
|
4131
|
+
*
|
|
4132
|
+
* Fluent's InfoButton takes the same `info` and `size`. It opens on click only
|
|
4133
|
+
* (`openOnHover={false}` here), renders its note in place, and moves focus into the note; this one
|
|
4134
|
+
* keeps focus on the button and renders the note in a portal. Fluent's `popover` props and a
|
|
4135
|
+
* controlled open state are not offered.
|
|
4136
|
+
*
|
|
4137
|
+
* @example
|
|
4138
|
+
* <h2 id="billing">Billing</h2>
|
|
4139
|
+
* <InfoButton
|
|
4140
|
+
* id="billing-info"
|
|
4141
|
+
* aria-labelledby="billing billing-info"
|
|
4142
|
+
* info={<>Invoices are sent monthly. <a href="/help/billing">Learn more</a></>}
|
|
4143
|
+
* />
|
|
4144
|
+
*/
|
|
4145
|
+
export declare const InfoButton: {
|
|
4146
|
+
({ info, size: sizeProp, openOnHover, id: idProp, type, "aria-label": ariaLabelProp, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, disabled, onClick, onFocus, onBlur, onKeyDown, onPointerDown, onMouseDown, onPointerEnter, onPointerMove, onPointerLeave, ref, ...rest }: InfoButtonProps): React_2.JSX.Element;
|
|
4147
|
+
displayName: string;
|
|
4148
|
+
};
|
|
4149
|
+
|
|
4150
|
+
/**
|
|
4151
|
+
* InfoButton: `root` on the `<button>`; `info` on the `role="note"` popup that shows your `info`
|
|
4152
|
+
* (Fluent's `info` slot, the popover surface); `beak` on its arrow.
|
|
4153
|
+
*/
|
|
4154
|
+
export declare const infoButtonClassNames: {
|
|
4155
|
+
readonly root: "wave-info-button";
|
|
4156
|
+
readonly info: "wave-info-button__info";
|
|
4157
|
+
readonly beak: "wave-info-button__beak";
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4160
|
+
/** Properties for the InfoButton component. */
|
|
4161
|
+
export declare interface InfoButtonProps extends Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
4162
|
+
/**
|
|
4163
|
+
* The information the note shows: text, links or other content. It also describes the button
|
|
4164
|
+
* (`aria-describedby`), from the server HTML on. It is rendered once: next to the button, not
|
|
4165
|
+
* displayed, while the note is closed, and inside the note while it is shown.
|
|
4166
|
+
*/
|
|
4167
|
+
info: React_2.ReactNode;
|
|
4168
|
+
/**
|
|
4169
|
+
* Size of the glyph: 12, 16 or 20px. The button box stays 24×24px at every size, with negative
|
|
4170
|
+
* margins above and below, so it never makes a row that centres its items (as InfoLabel does)
|
|
4171
|
+
* taller.
|
|
4172
|
+
* @default 'medium'
|
|
4173
|
+
*/
|
|
4174
|
+
size?: CoreSize;
|
|
4175
|
+
/**
|
|
4176
|
+
* Open the note when a mouse pointer rests on the button (after 250 ms; it closes 250 ms after
|
|
4177
|
+
* the pointer has left the button and the note, touch and pen never hover), and when the button
|
|
4178
|
+
* receives keyboard focus. `false` opens it only on a click, and so on Enter and Space (Fluent's
|
|
4179
|
+
* InfoButton opens on click only). A click always toggles the note: it pins a note that hover or
|
|
4180
|
+
* keyboard focus opened, and closes a pinned one.
|
|
4181
|
+
* @default true
|
|
4182
|
+
*/
|
|
4183
|
+
openOnHover?: boolean;
|
|
4184
|
+
/**
|
|
4185
|
+
* Accessible name of the button, and of the note, which is labelled like the button. Localize it
|
|
4186
|
+
* here. With `aria-labelledby` listing the id of your text and the button's own `id`, the name is
|
|
4187
|
+
* your text followed by this one ("Billing Information").
|
|
4188
|
+
* @default 'Information'
|
|
4189
|
+
*/
|
|
4190
|
+
'aria-label'?: string;
|
|
4191
|
+
/** Ref to the button. */
|
|
4192
|
+
ref?: React_2.Ref<HTMLButtonElement>;
|
|
4193
|
+
}
|
|
4194
|
+
|
|
4195
|
+
/**
|
|
4196
|
+
* A label followed by a button that reveals more information about it (Fluent's InfoLabel): the
|
|
4197
|
+
* label renders in a real `<label htmlFor>`, and the button shows `info` — text, links or other
|
|
4198
|
+
* rich content — in a note next to it, rendered once whether the note is open or closed (see
|
|
4199
|
+
* `InfoButton`, which owns that note and its opening, closing and Tab order).
|
|
3977
4200
|
*
|
|
3978
|
-
* -
|
|
3979
|
-
*
|
|
3980
|
-
*
|
|
3981
|
-
*
|
|
3982
|
-
*
|
|
3983
|
-
*
|
|
3984
|
-
*
|
|
3985
|
-
*
|
|
3986
|
-
* -
|
|
3987
|
-
*
|
|
3988
|
-
*
|
|
4201
|
+
* - `children` is the label content; `label` is a deprecated alias (a warning fires once, and
|
|
4202
|
+
* `children` wins when both are given).
|
|
4203
|
+
* - `htmlFor`, `required`, `size`, `weight` and `disabled` route to the `<label>`; `disabled` dims
|
|
4204
|
+
* only the label text, and the info button stays usable.
|
|
4205
|
+
* - The button is named "‹label text› ‹infoButtonLabel›" through `aria-labelledby`, which points
|
|
4206
|
+
* at the `<label>` and at the button's own id (whose `aria-label` supplies the second half), so
|
|
4207
|
+
* several InfoLabels on a page are told apart; `infoButtonLabel` localizes that second half.
|
|
4208
|
+
* `openOnHover` and `size` reach the button too.
|
|
4209
|
+
* - No `controlRef`: InfoLabel is a label, not a form control, so C-ROUTING's composite-control
|
|
4210
|
+
* routing does not apply to it; a layout that needs the button's own element renders `InfoButton`
|
|
4211
|
+
* next to a `Label` instead.
|
|
3989
4212
|
*
|
|
3990
4213
|
* @example
|
|
3991
|
-
* <InfoLabel
|
|
4214
|
+
* <InfoLabel info="Use at least 8 characters.">Password</InfoLabel>
|
|
3992
4215
|
*/
|
|
3993
4216
|
export declare const InfoLabel: {
|
|
3994
|
-
({ label, info, infoButtonLabel, className, ref, ...
|
|
4217
|
+
({ children, label, info, infoButtonLabel, openOnHover, id, htmlFor, required, size, weight, disabled, className, ref, ...rest }: InfoLabelProps): React_2.JSX.Element;
|
|
3995
4218
|
displayName: string;
|
|
3996
4219
|
};
|
|
3997
4220
|
|
|
3998
|
-
/**
|
|
4221
|
+
/**
|
|
4222
|
+
* InfoLabel: `root` on the outer span; `label` on its Label (which also carries Label's root);
|
|
4223
|
+
* `infoButton` on its InfoButton (which also carries InfoButton's root); `info` on the popup, the
|
|
4224
|
+
* InfoButton's note (which also carries InfoButton's `info`).
|
|
4225
|
+
*/
|
|
3999
4226
|
export declare const infoLabelClassNames: {
|
|
4000
4227
|
readonly root: "wave-info-label";
|
|
4228
|
+
readonly label: "wave-info-label__label";
|
|
4001
4229
|
readonly infoButton: "wave-info-label__info-button";
|
|
4002
4230
|
readonly info: "wave-info-label__info";
|
|
4003
4231
|
};
|
|
4004
4232
|
|
|
4005
4233
|
/** Properties for the InfoLabel component. */
|
|
4006
|
-
export declare interface InfoLabelProps extends React_2.HTMLAttributes<HTMLSpanElement> {
|
|
4007
|
-
/**
|
|
4008
|
-
|
|
4234
|
+
export declare interface InfoLabelProps extends Omit<React_2.HTMLAttributes<HTMLSpanElement>, 'children'>, Pick<LabelProps, 'htmlFor' | 'required' | 'size' | 'weight' | 'disabled'> {
|
|
4235
|
+
/** The label content (Fluent's `children`). */
|
|
4236
|
+
children?: React_2.ReactNode;
|
|
4009
4237
|
/**
|
|
4010
|
-
*
|
|
4011
|
-
*
|
|
4012
|
-
* keyboard focus or click.
|
|
4238
|
+
* The label content.
|
|
4239
|
+
* @deprecated Use `children`.
|
|
4013
4240
|
*/
|
|
4014
|
-
|
|
4241
|
+
label?: React_2.ReactNode;
|
|
4242
|
+
/** The information the info button's note shows: text, links or other rich content. */
|
|
4243
|
+
info: React_2.ReactNode;
|
|
4015
4244
|
/**
|
|
4016
|
-
* Accessible name of the info button
|
|
4245
|
+
* Accessible name of the info button: the second half of its name, after the label text
|
|
4246
|
+
* ("Password Information"). Localize it here.
|
|
4017
4247
|
* @default 'Information'
|
|
4018
4248
|
*/
|
|
4019
4249
|
infoButtonLabel?: string;
|
|
4250
|
+
/**
|
|
4251
|
+
* Opens the note on a mouse hover, after a short delay, and on keyboard focus, next to a click
|
|
4252
|
+
* (see `InfoButton`'s `openOnHover`, which this passes through unchanged).
|
|
4253
|
+
* @default true
|
|
4254
|
+
*/
|
|
4255
|
+
openOnHover?: boolean;
|
|
4020
4256
|
/** Ref to the root `<span>`. */
|
|
4021
4257
|
ref?: React_2.Ref<HTMLSpanElement>;
|
|
4022
4258
|
}
|
|
@@ -4027,6 +4263,12 @@ export declare interface InfoLabelProps extends React_2.HTMLAttributes<HTMLSpanE
|
|
|
4027
4263
|
* optional error message. Inside a `Field` it picks up the label, hint, error, `required` (native
|
|
4028
4264
|
* attribute) and invalid state automatically.
|
|
4029
4265
|
*
|
|
4266
|
+
* `size` resolves from its own prop, then the surrounding `Field`'s `size`, then
|
|
4267
|
+
* `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own prop, then
|
|
4268
|
+
* `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
4269
|
+
* `data-appearance` on the element that draws the field (the `<input>`, or the wrapper with slot
|
|
4270
|
+
* content).
|
|
4271
|
+
*
|
|
4030
4272
|
* Every prop reaches the `<input>`, except with slot content: then a bordered `<span>` wrapper
|
|
4031
4273
|
* draws the field and receives `className`, `style` and `hidden` (`ref` stays on the input).
|
|
4032
4274
|
*
|
|
@@ -4036,10 +4278,16 @@ export declare interface InfoLabelProps extends React_2.HTMLAttributes<HTMLSpanE
|
|
|
4036
4278
|
* </Field>
|
|
4037
4279
|
*/
|
|
4038
4280
|
export declare const Input: {
|
|
4039
|
-
({ error, errorMessageProps, contentBefore, contentAfter, onChange, onValueChange, className, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: InputProps): React_2.JSX.Element;
|
|
4281
|
+
({ error, errorMessageProps, size: sizeProp, htmlSize, appearance: appearanceProp, contentBefore, contentAfter, onChange, onValueChange, className, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: InputProps): React_2.JSX.Element;
|
|
4040
4282
|
displayName: string;
|
|
4041
4283
|
};
|
|
4042
4284
|
|
|
4285
|
+
/**
|
|
4286
|
+
* Look of a text input or picker: `outline` (a full border), `underline` (a bottom stroke only),
|
|
4287
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke).
|
|
4288
|
+
*/
|
|
4289
|
+
export declare type InputAppearance = 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
|
4290
|
+
|
|
4043
4291
|
/**
|
|
4044
4292
|
* Input: `root` on the `<input>`, or, with `contentBefore` or `contentAfter` content, on the
|
|
4045
4293
|
* wrapper that draws the field; `input` on the `<input>` (also when it is the root);
|
|
@@ -4054,6 +4302,14 @@ export declare const inputClassNames: {
|
|
|
4054
4302
|
readonly errorMessage: "wave-input__error-message";
|
|
4055
4303
|
};
|
|
4056
4304
|
|
|
4305
|
+
/** Default size and appearance of the text inputs and pickers in a subtree. */
|
|
4306
|
+
export declare interface InputDefaults {
|
|
4307
|
+
/** Default `size` of Input, Textarea, Select, SearchBox, SpinButton and the pickers. */
|
|
4308
|
+
size?: CoreSize;
|
|
4309
|
+
/** Default `appearance` of the same controls. */
|
|
4310
|
+
appearance?: InputAppearance;
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4057
4313
|
/**
|
|
4058
4314
|
* Props of the error message element that {@link Input}, `Select` and `Textarea` render after the
|
|
4059
4315
|
* control for a string `error` (`id`, `className`, `role`, data attributes, …).
|
|
@@ -4066,7 +4322,7 @@ export declare interface InputErrorMessageProps extends React_2.HTMLAttributes<H
|
|
|
4066
4322
|
}
|
|
4067
4323
|
|
|
4068
4324
|
/** Properties for the Input component. */
|
|
4069
|
-
export declare interface InputProps extends React_2.InputHTMLAttributes<HTMLInputElement> {
|
|
4325
|
+
export declare interface InputProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
4070
4326
|
/**
|
|
4071
4327
|
* Validation error.
|
|
4072
4328
|
* - A non-empty string renders the message in a `role="alert"` element **after** the field (a
|
|
@@ -4084,6 +4340,24 @@ export declare interface InputProps extends React_2.InputHTMLAttributes<HTMLInpu
|
|
|
4084
4340
|
error?: string | boolean;
|
|
4085
4341
|
/** Props of the error message element (`id`, `className`, …) rendered for a string `error`. */
|
|
4086
4342
|
errorMessageProps?: InputErrorMessageProps;
|
|
4343
|
+
/**
|
|
4344
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
4345
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`.
|
|
4346
|
+
*
|
|
4347
|
+
* A number is the native `size` attribute (the visible width in characters), as in 0.8: it
|
|
4348
|
+
* still renders, warns once in development and is removed in 1.0. Use `htmlSize` for it.
|
|
4349
|
+
* A string of digits only (`size="20"` from untyped code) counts as that number. Any other value
|
|
4350
|
+
* outside the three sizes renders as if `size` were not set.
|
|
4351
|
+
*/
|
|
4352
|
+
size?: CoreSize | number;
|
|
4353
|
+
/** The native `size` attribute: the visible width of the field in characters. */
|
|
4354
|
+
htmlSize?: number;
|
|
4355
|
+
/**
|
|
4356
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
4357
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
4358
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
4359
|
+
*/
|
|
4360
|
+
appearance?: InputAppearance;
|
|
4087
4361
|
/**
|
|
4088
4362
|
* Slot rendered before the input text (e.g., an icon). With content in either slot, a bordered
|
|
4089
4363
|
* `<span>` around the input draws the field: it receives `className`, `style` and `hidden`,
|
|
@@ -4104,7 +4378,7 @@ export declare interface InputProps extends React_2.InputHTMLAttributes<HTMLInpu
|
|
|
4104
4378
|
|
|
4105
4379
|
/**
|
|
4106
4380
|
* A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required
|
|
4107
|
-
*
|
|
4381
|
+
* indicator is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom
|
|
4108
4382
|
* layouts.
|
|
4109
4383
|
*
|
|
4110
4384
|
* @example
|
|
@@ -4131,11 +4405,12 @@ export declare type LabelPosition = 'before' | 'after' | 'above' | 'below';
|
|
|
4131
4405
|
|
|
4132
4406
|
/** Properties for the Label component. */
|
|
4133
4407
|
export declare interface LabelProps extends React_2.LabelHTMLAttributes<HTMLLabelElement> {
|
|
4134
|
-
/** Whether to show a required indicator
|
|
4135
|
-
*
|
|
4408
|
+
/** Whether to show a required indicator. `true` shows a decorative asterisk; other content
|
|
4409
|
+
* replaces it (for example a `(required)` text). Decorative (`aria-hidden`), so it must not be
|
|
4410
|
+
* focusable; mark the control itself `required`.
|
|
4136
4411
|
* @default false
|
|
4137
4412
|
*/
|
|
4138
|
-
required?: boolean;
|
|
4413
|
+
required?: boolean | React_2.ReactNode;
|
|
4139
4414
|
/** Whether the label is visually dimmed.
|
|
4140
4415
|
* @default false
|
|
4141
4416
|
*/
|
|
@@ -4143,7 +4418,7 @@ export declare interface LabelProps extends React_2.LabelHTMLAttributes<HTMLLabe
|
|
|
4143
4418
|
/** Text size of the label: `small` = caption-1, `medium` = body-1, `large` = body-2.
|
|
4144
4419
|
* @default 'medium'
|
|
4145
4420
|
*/
|
|
4146
|
-
size?:
|
|
4421
|
+
size?: CoreSize;
|
|
4147
4422
|
/** Font weight of the label (the shared `TextWeight` vocabulary).
|
|
4148
4423
|
* @default 'regular'
|
|
4149
4424
|
*/
|
|
@@ -6852,29 +7127,51 @@ export declare interface RadioItemProps extends Omit<React_2.ButtonHTMLAttribute
|
|
|
6852
7127
|
/**
|
|
6853
7128
|
* A star rating input (`role="radiogroup"` of `role="radio"` stars).
|
|
6854
7129
|
*
|
|
6855
|
-
* - One tab stop (the chosen
|
|
6856
|
-
* move focus to the chosen
|
|
6857
|
-
* (Left/Right mirrored under `dir="rtl"`), Home
|
|
6858
|
-
*
|
|
6859
|
-
*
|
|
7130
|
+
* - One tab stop (the radio of the chosen value, else the first). Keys choose relative to the
|
|
7131
|
+
* current rating and move focus to the chosen radio, as in 0.4: Right/Up one `step` more (a
|
|
7132
|
+
* star, or half a star), Left/Down one fewer (Left/Right mirrored under `dir="rtl"`), Home the
|
|
7133
|
+
* smallest value (`step`) and End `max`. From an empty rating, Right/Up/Home choose `step`.
|
|
7134
|
+
* Keys at the ends (and Left/Down while empty) emit nothing.
|
|
7135
|
+
* - The keyboard cannot clear a rating: Left/Down stop at `step` (APG radio group; 0.4 went down
|
|
6860
7136
|
* to 0). Only a controlled `value={0}` (or a form reset while `defaultValue` is 0) clears it.
|
|
7137
|
+
* - `step={0.5}` offers half stars. Each star stays one pointer target, which chooses by the
|
|
7138
|
+
* pointer's position (its half from the inline start, else its full value) and then focuses
|
|
7139
|
+
* the radio it chose; it holds two transparent radios ("2.5 stars", "3 stars") for the
|
|
7140
|
+
* keyboard and screen readers, and draws the focus ring of either. A controlled value between
|
|
7141
|
+
* two steps checks no radio and is drawn as the step below it; the keys move it to the next or
|
|
7142
|
+
* previous step.
|
|
6861
7143
|
* - `onValueChange` (and the deprecated `onChange` alias) fire only when the rating changes, so
|
|
6862
7144
|
* choosing the current star again calls neither.
|
|
6863
|
-
* - Hovering previews a value
|
|
7145
|
+
* - Hovering previews a value (half stars preview by the pointer's position); the preview never
|
|
7146
|
+
* outlives the hover or a disabled state.
|
|
7147
|
+
* - `color` colors the filled stars (`marigold`, the default, `brand` or `neutral`; the root
|
|
7148
|
+
* carries `data-color`); `iconFilled` and `iconOutline` replace the star glyphs, as a pair.
|
|
6864
7149
|
* - Inside a `Field` it is named by the Field label (instead of the default "Rating") and
|
|
6865
|
-
* described by its hint and error. The stars are named "1 star", "2 stars",
|
|
6866
|
-
* localizes these names.
|
|
7150
|
+
* described by its hint and error. The stars are named "1 star", "2 stars", … (and a half value
|
|
7151
|
+
* "2.5 stars"); `labels` localizes these names.
|
|
6867
7152
|
* - With `name` (or `required`) it takes part in native forms; a form reset restores
|
|
6868
7153
|
* `defaultValue`.
|
|
7154
|
+
* - The stars are generated from `max`. Children that render content replace them: one
|
|
7155
|
+
* `Rating.Item` per value from 1 to `max`, chosen, previewed, roved and named as the generated
|
|
7156
|
+
* stars are (`max` still sets the key range and the star names).
|
|
7157
|
+
*
|
|
7158
|
+
* Sub-component: `Rating.Item` (the same component as `RatingDisplay.Item`). React Server
|
|
7159
|
+
* Components import its flat name `RatingItem` (dotted access needs a client file).
|
|
6869
7160
|
*/
|
|
6870
7161
|
export declare const Rating: {
|
|
6871
|
-
({ value: valueProp, defaultValue, onValueChange, onChange, max, size, disabled, name, required, form, labels, className, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, onKeyDown, onFocus, onMouseLeave, ref, ...rest }: RatingProps): React_2.JSX.Element;
|
|
7162
|
+
({ value: valueProp, defaultValue, onValueChange, onChange, max, step: stepProp, size, color, iconFilled, iconOutline, disabled, name, required, form, labels, className, children, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, onKeyDown, onFocus, onMouseLeave, ref, ...rest }: RatingProps): React_2.JSX.Element;
|
|
6872
7163
|
displayName: string;
|
|
7164
|
+
} & {
|
|
7165
|
+
Item: {
|
|
7166
|
+
({ value, iconFilled, iconOutline, className, ref, ...rest }: RatingItemProps): React_2.JSX.Element;
|
|
7167
|
+
displayName: string;
|
|
7168
|
+
};
|
|
6873
7169
|
};
|
|
6874
7170
|
|
|
6875
7171
|
/**
|
|
6876
|
-
* Rating: `root` on the `role="radiogroup"` element; `star` on each
|
|
6877
|
-
* on each
|
|
7172
|
+
* Rating: `root` on the `role="radiogroup"` element; `star` on each star (a RatingItem: the
|
|
7173
|
+
* `role="radio"` button, or with `step={0.5}` the span around its two radios); `icon` on each
|
|
7174
|
+
* star glyph (the default `<svg>`, or the span of your `iconFilled`/`iconOutline`).
|
|
6878
7175
|
*/
|
|
6879
7176
|
export declare const ratingClassNames: {
|
|
6880
7177
|
readonly root: "wave-rating";
|
|
@@ -6882,6 +7179,9 @@ export declare const ratingClassNames: {
|
|
|
6882
7179
|
readonly icon: "wave-rating__icon";
|
|
6883
7180
|
};
|
|
6884
7181
|
|
|
7182
|
+
/** Color of a rating's filled stars. */
|
|
7183
|
+
export declare type RatingColor = 'neutral' | 'brand' | 'marigold';
|
|
7184
|
+
|
|
6885
7185
|
/**
|
|
6886
7186
|
* A read-only star rating (`role="img"` named "Rating: <value> out of <max>"). A fractional value
|
|
6887
7187
|
* is drawn with a partly filled star, so the stars and the name show the same value.
|
|
@@ -6891,15 +7191,29 @@ export declare const ratingClassNames: {
|
|
|
6891
7191
|
* stars (the root carries `data-compact`). Without them only the stars show.
|
|
6892
7192
|
* - The value (up to one decimal) and the count are formatted with `locale`, in the text and in
|
|
6893
7193
|
* the name; `labels` localizes the name. Pass `locale` when rendering on the server.
|
|
7194
|
+
* - `color` colors the filled stars (`marigold`, the default, `brand` or `neutral`; the root
|
|
7195
|
+
* carries `data-color`); `iconFilled` and `iconOutline` replace the star glyphs, as a pair.
|
|
7196
|
+
* - The stars are generated from `max`. Children that render content replace them: one
|
|
7197
|
+
* `RatingDisplay.Item` per value from 1 to `max`. A `compact` display ignores them.
|
|
7198
|
+
*
|
|
7199
|
+
* Sub-component: `RatingDisplay.Item` (the same component as `Rating.Item`). React Server
|
|
7200
|
+
* Components import its flat name `RatingDisplayItem`, or `RatingItem` (dotted access needs a
|
|
7201
|
+
* client file).
|
|
6894
7202
|
*/
|
|
6895
7203
|
export declare const RatingDisplay: {
|
|
6896
|
-
({ value, max, size, showValue, count, compact, locale, labels, className, ref, ...rest }: RatingDisplayProps): React_2.JSX.Element;
|
|
7204
|
+
({ value, max, size, color, iconFilled, iconOutline, showValue, count, compact, locale, labels, className, children, ref, ...rest }: RatingDisplayProps): React_2.JSX.Element;
|
|
6897
7205
|
displayName: string;
|
|
7206
|
+
} & {
|
|
7207
|
+
Item: {
|
|
7208
|
+
({ value, iconFilled, iconOutline, className, ref, ...rest }: RatingItemProps): React_2.JSX.Element;
|
|
7209
|
+
displayName: string;
|
|
7210
|
+
};
|
|
6898
7211
|
};
|
|
6899
7212
|
|
|
6900
7213
|
/**
|
|
6901
|
-
* RatingDisplay: `root` on the `role="img"` element; `star` on each star span
|
|
6902
|
-
*
|
|
7214
|
+
* RatingDisplay: `root` on the `role="img"` element; `star` on each star span (a RatingItem, and
|
|
7215
|
+
* the one star of `compact`); `icon` on the star glyphs; `value` on the value span; `count` on the
|
|
7216
|
+
* count span.
|
|
6903
7217
|
*/
|
|
6904
7218
|
export declare const ratingDisplayClassNames: {
|
|
6905
7219
|
readonly root: "wave-rating-display";
|
|
@@ -6909,6 +7223,15 @@ export declare const ratingDisplayClassNames: {
|
|
|
6909
7223
|
readonly count: "wave-rating-display__count";
|
|
6910
7224
|
};
|
|
6911
7225
|
|
|
7226
|
+
/**
|
|
7227
|
+
* Flat name of `RatingDisplay.Item` for React Server Components (the same component as
|
|
7228
|
+
* `RatingItem`).
|
|
7229
|
+
*/
|
|
7230
|
+
export declare const RatingDisplayItem: {
|
|
7231
|
+
({ value, iconFilled, iconOutline, className, ref, ...rest }: RatingItemProps): React_2.JSX.Element;
|
|
7232
|
+
displayName: string;
|
|
7233
|
+
};
|
|
7234
|
+
|
|
6912
7235
|
/** Built-in texts of RatingDisplay, for localization. */
|
|
6913
7236
|
export declare interface RatingDisplayLabels {
|
|
6914
7237
|
/**
|
|
@@ -6924,7 +7247,7 @@ export declare interface RatingDisplayLabels {
|
|
|
6924
7247
|
}
|
|
6925
7248
|
|
|
6926
7249
|
/** Properties for the RatingDisplay (read-only) component. */
|
|
6927
|
-
export declare interface RatingDisplayProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
7250
|
+
export declare interface RatingDisplayProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
6928
7251
|
/**
|
|
6929
7252
|
* Rating value to display. A fraction is drawn as a partly filled star (`4.6` fills 60% of the
|
|
6930
7253
|
* fifth star), so the stars show the value the accessible name reports.
|
|
@@ -6938,6 +7261,36 @@ export declare interface RatingDisplayProps extends React_2.HTMLAttributes<HTMLD
|
|
|
6938
7261
|
* @default 'medium'
|
|
6939
7262
|
*/
|
|
6940
7263
|
size?: Size;
|
|
7264
|
+
/**
|
|
7265
|
+
* Color of the filled stars: `marigold` (default), `brand` or `neutral`; unfilled stars keep a
|
|
7266
|
+
* 3:1 outline. Fluent's default is `neutral`. A value outside the three (from untyped code)
|
|
7267
|
+
* renders as `marigold`; the root carries `data-color` with the resolved value.
|
|
7268
|
+
* @default 'marigold'
|
|
7269
|
+
*/
|
|
7270
|
+
color?: RatingColor;
|
|
7271
|
+
/**
|
|
7272
|
+
* The glyph of a filled star. `iconFilled` and `iconOutline` are the glyphs of a filled and an
|
|
7273
|
+
* unfilled star, as a pair; decorative. Fluent's RatingDisplay takes one `icon`; here a filled
|
|
7274
|
+
* and an unfilled star must differ by shape, not by color alone.
|
|
7275
|
+
*
|
|
7276
|
+
* - Each glyph is sized by `size` (an SVG child fills the star) and takes the star's color
|
|
7277
|
+
* (paint it with `currentColor`). A partly filled star clips the filled glyph over the
|
|
7278
|
+
* unfilled one from the inline start, and the `compact` star is the filled glyph.
|
|
7279
|
+
* - `null`, `undefined` and a value that renders nothing draw the default star. A value that
|
|
7280
|
+
* renders nothing, and a pair with only one of the two set, log a development warning.
|
|
7281
|
+
* - A `<button>` or `Button` element (or a slot object whose `as` is one) is not nested in the
|
|
7282
|
+
* star: its children become the glyph (the default star when they render nothing), its props
|
|
7283
|
+
* are dropped, and a development warning says so (in place of the warning for a value that
|
|
7284
|
+
* renders nothing).
|
|
7285
|
+
* - A `RatingDisplay.Item` that sets its own pair draws that one instead.
|
|
7286
|
+
*/
|
|
7287
|
+
iconFilled?: Slot<'span'>;
|
|
7288
|
+
/**
|
|
7289
|
+
* The glyph of an unfilled star, as a pair with `iconFilled` (its rules apply); decorative.
|
|
7290
|
+
* Fluent's RatingDisplay takes one `icon`; here a filled and an unfilled star must differ by
|
|
7291
|
+
* shape, not by color alone.
|
|
7292
|
+
*/
|
|
7293
|
+
iconOutline?: Slot<'span'>;
|
|
6941
7294
|
/**
|
|
6942
7295
|
* Shows the value as text after the stars, formatted with `locale` (up to one decimal).
|
|
6943
7296
|
* @default false
|
|
@@ -6962,25 +7315,105 @@ export declare interface RatingDisplayProps extends React_2.HTMLAttributes<HTMLD
|
|
|
6962
7315
|
locale?: string;
|
|
6963
7316
|
/** Built-in texts, for localization. */
|
|
6964
7317
|
labels?: RatingDisplayLabels;
|
|
7318
|
+
/**
|
|
7319
|
+
* Custom stars: one `RatingDisplay.Item` per value from 1 to `max`, in place of the generated
|
|
7320
|
+
* stars (when the children render content). A `compact` display ignores them.
|
|
7321
|
+
*/
|
|
7322
|
+
children?: React_2.ReactNode;
|
|
6965
7323
|
/** Ref to the root element. */
|
|
6966
7324
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
6967
7325
|
}
|
|
6968
7326
|
|
|
7327
|
+
/**
|
|
7328
|
+
* One star of a `Rating` or a `RatingDisplay`, drawn from its root: pass one per value from 1 to
|
|
7329
|
+
* `max` as the root's children, in place of the stars it generates.
|
|
7330
|
+
*
|
|
7331
|
+
* - In a `Rating` it is a `role="radio"` button named by the root's `labels.star` ("2 stars"),
|
|
7332
|
+
* chosen, previewed and roved as a generated star is. With the root's `step={0.5}` it is a star
|
|
7333
|
+
* `<span>`, one pointer target that chooses by the pointer's position, holding two transparent
|
|
7334
|
+
* radios: its half value, then its full value ("1.5 stars", "2 stars"). In a `RatingDisplay` it
|
|
7335
|
+
* is a star filled, partly filled or empty by the root's value.
|
|
7336
|
+
* - It draws the root's `color` and glyph pair, or its own `iconFilled`/`iconOutline` pair when it
|
|
7337
|
+
* sets one.
|
|
7338
|
+
* - `className`, `style`, `data-*`, the other attributes, the handlers and `ref` go to that star
|
|
7339
|
+
* element, the consumer's handlers first. The role, name, checked state and tab stop of its
|
|
7340
|
+
* radio (or radios) come from the root.
|
|
7341
|
+
* - At `step={1}` the consumer's `onClick` and `onMouseEnter` compose onto the radio itself, so a
|
|
7342
|
+
* `preventDefault()` in either vetoes that star's own activation or hover preview. At
|
|
7343
|
+
* `step={0.5}` `onClick` and `onPointerMove` compose onto the star `<span>` instead: its two
|
|
7344
|
+
* radios run their own `onClick` first and choose their own value directly (Space, Enter, a
|
|
7345
|
+
* screen reader, or `radio.click()`), before the click bubbles to the span's composed handler,
|
|
7346
|
+
* so a `preventDefault()` there vetoes only a pointer-chosen value, never a keyboard or
|
|
7347
|
+
* assistive-technology activation.
|
|
7348
|
+
* - Outside a `Rating` or `RatingDisplay` it throws in development.
|
|
7349
|
+
*/
|
|
7350
|
+
export declare const RatingItem: {
|
|
7351
|
+
({ value, iconFilled, iconOutline, className, ref, ...rest }: RatingItemProps): React_2.JSX.Element;
|
|
7352
|
+
displayName: string;
|
|
7353
|
+
};
|
|
7354
|
+
|
|
7355
|
+
/**
|
|
7356
|
+
* RatingItem (also Rating.Item, RatingDisplay.Item and RatingDisplayItem): `root` on the star
|
|
7357
|
+
* element (the `role="radio"` button in a Rating, the span around its two radios with
|
|
7358
|
+
* `step={0.5}`, the star span in a RatingDisplay), which also carries its rating's `star` class;
|
|
7359
|
+
* `icon` on each glyph it draws (the default `<svg>`, or the span of an `iconFilled`/`iconOutline`
|
|
7360
|
+
* glyph), which also carries its rating's `icon` class.
|
|
7361
|
+
*/
|
|
7362
|
+
export declare const ratingItemClassNames: {
|
|
7363
|
+
readonly root: "wave-rating-item";
|
|
7364
|
+
readonly icon: "wave-rating-item__icon";
|
|
7365
|
+
};
|
|
7366
|
+
|
|
7367
|
+
/** Properties for the RatingItem component (`Rating.Item`, `RatingDisplay.Item`). */
|
|
7368
|
+
export declare interface RatingItemProps extends Omit<React_2.HTMLAttributes<HTMLElement>, 'role' | 'aria-checked' | 'aria-label' | 'aria-labelledby' | 'tabIndex' | 'children' | 'onChange'> {
|
|
7369
|
+
/**
|
|
7370
|
+
* The star's full value, from 1 to the root's `max`: the rating it chooses (with the root's
|
|
7371
|
+
* `step={0.5}` also its half, `value - 0.5`), or shows.
|
|
7372
|
+
*/
|
|
7373
|
+
value: number;
|
|
7374
|
+
/**
|
|
7375
|
+
* The glyph of this star when filled, as a pair with `iconOutline`, following the rules of the
|
|
7376
|
+
* root's `iconFilled` (a button is unwrapped, its children becoming the glyph, and a value or
|
|
7377
|
+
* button children that render nothing draw the default star). An item that sets either glyph
|
|
7378
|
+
* of the pair (`null` included) draws its own pair instead of its root's, and a glyph it leaves
|
|
7379
|
+
* unset is the default star (a development warning says so).
|
|
7380
|
+
*/
|
|
7381
|
+
iconFilled?: Slot<'span'>;
|
|
7382
|
+
/**
|
|
7383
|
+
* The glyph of this star when unfilled, as a pair with `iconFilled`, following the rules of the
|
|
7384
|
+
* root's `iconOutline` (a button is unwrapped, its children becoming the glyph, and a value or
|
|
7385
|
+
* button children that render nothing draw the default star). An item that sets either glyph
|
|
7386
|
+
* of the pair (`null` included) draws its own pair instead of its root's, and a glyph it leaves
|
|
7387
|
+
* unset is the default star (a development warning says so).
|
|
7388
|
+
*/
|
|
7389
|
+
iconOutline?: Slot<'span'>;
|
|
7390
|
+
/**
|
|
7391
|
+
* Ref to the star element: the `role="radio"` button in a Rating, the star `<span>` in a Rating
|
|
7392
|
+
* with `step={0.5}` and in a RatingDisplay.
|
|
7393
|
+
*/
|
|
7394
|
+
ref?: React_2.Ref<HTMLElement>;
|
|
7395
|
+
}
|
|
7396
|
+
|
|
6969
7397
|
/**
|
|
6970
7398
|
* The Rating's built-in star names, for localization. Each member is optional and falls back to
|
|
6971
7399
|
* its English default.
|
|
6972
7400
|
*/
|
|
6973
7401
|
export declare interface RatingLabels {
|
|
6974
7402
|
/**
|
|
6975
|
-
* Accessible name of the
|
|
7403
|
+
* Accessible name of the radio that chooses `value`: a whole star (1 to `max`), and with
|
|
7404
|
+
* `step={0.5}` a half value too ("2.5 stars").
|
|
6976
7405
|
* @default (value) => value === 1 ? '1 star' : `${value} stars`
|
|
6977
7406
|
*/
|
|
6978
7407
|
star?: (value: number, max: number) => string;
|
|
6979
7408
|
}
|
|
6980
7409
|
|
|
6981
7410
|
/** Properties for the Rating component. */
|
|
6982
|
-
export declare interface RatingProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
6983
|
-
/**
|
|
7411
|
+
export declare interface RatingProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'color'> {
|
|
7412
|
+
/**
|
|
7413
|
+
* Controlled rating value (`0` = no rating): a whole number of stars, or with `step={0.5}` a
|
|
7414
|
+
* multiple of 0.5. A value between two steps (2.7) checks no radio, is drawn as the step below
|
|
7415
|
+
* it (2.5) and holds the tab stop there; the keys move it to the next or previous step.
|
|
7416
|
+
*/
|
|
6984
7417
|
value?: number;
|
|
6985
7418
|
/** Initial rating for uncontrolled usage (also the value a form reset restores).
|
|
6986
7419
|
* @default 0
|
|
@@ -6998,10 +7431,50 @@ export declare interface RatingProps extends Omit<React_2.HTMLAttributes<HTMLDiv
|
|
|
6998
7431
|
* @default 5
|
|
6999
7432
|
*/
|
|
7000
7433
|
max?: number;
|
|
7434
|
+
/**
|
|
7435
|
+
* The grain of the rating: `1` (whole stars) or `0.5` (half stars). With `0.5`, each star stays
|
|
7436
|
+
* one pointer target of at least 24×24px (a larger `size` keeps a larger one): the half is
|
|
7437
|
+
* chosen by the pointer's position over it (the half at the inline start, which mirrors under
|
|
7438
|
+
* `dir="rtl"`), and two transparent radios per star, the half value then the full value, serve
|
|
7439
|
+
* the keyboard and screen readers. The keys then move by half a star. A value other than `0.5`
|
|
7440
|
+
* (from untyped code) counts as `1`. RatingDisplay has no `step`: it draws any fraction.
|
|
7441
|
+
* @default 1
|
|
7442
|
+
*/
|
|
7443
|
+
step?: 0.5 | 1;
|
|
7001
7444
|
/** Size of the star icons. Every size keeps a target of at least 24×24px.
|
|
7002
7445
|
* @default 'medium'
|
|
7003
7446
|
*/
|
|
7004
7447
|
size?: Size;
|
|
7448
|
+
/**
|
|
7449
|
+
* Color of the filled stars: `marigold` (default), `brand` or `neutral`; unfilled stars keep a
|
|
7450
|
+
* 3:1 outline. Fluent's default is `neutral`. A value outside the three (from untyped code)
|
|
7451
|
+
* renders as `marigold`; the root carries `data-color` with the resolved value.
|
|
7452
|
+
* @default 'marigold'
|
|
7453
|
+
*/
|
|
7454
|
+
color?: RatingColor;
|
|
7455
|
+
/**
|
|
7456
|
+
* The glyph of a filled star. `iconFilled` and `iconOutline` are the glyphs of a filled and an
|
|
7457
|
+
* unfilled star, as a pair; decorative. Fluent's RatingDisplay takes one `icon`; here a filled
|
|
7458
|
+
* and an unfilled star must differ by shape, not by color alone.
|
|
7459
|
+
*
|
|
7460
|
+
* - Each glyph is sized by `size` (an SVG child fills the star) and takes the star's color
|
|
7461
|
+
* (paint it with `currentColor`). A half-filled star (`step={0.5}`) clips the filled glyph
|
|
7462
|
+
* over the unfilled one from the inline start.
|
|
7463
|
+
* - `null`, `undefined` and a value that renders nothing draw the default star. A value that
|
|
7464
|
+
* renders nothing, and a pair with only one of the two set, log a development warning.
|
|
7465
|
+
* - A `<button>` or `Button` element (or a slot object whose `as` is one) is not nested in the
|
|
7466
|
+
* star: its children become the glyph (the default star when they render nothing), its props
|
|
7467
|
+
* are dropped, and a development warning says so (in place of the warning for a value that
|
|
7468
|
+
* renders nothing).
|
|
7469
|
+
* - A `Rating.Item` that sets its own pair draws that one instead.
|
|
7470
|
+
*/
|
|
7471
|
+
iconFilled?: Slot<'span'>;
|
|
7472
|
+
/**
|
|
7473
|
+
* The glyph of an unfilled star, as a pair with `iconFilled` (its rules apply); decorative.
|
|
7474
|
+
* Fluent's RatingDisplay takes one `icon`; here a filled and an unfilled star must differ by
|
|
7475
|
+
* shape, not by color alone.
|
|
7476
|
+
*/
|
|
7477
|
+
iconOutline?: Slot<'span'>;
|
|
7005
7478
|
/** Whether the rating is disabled and non-interactive.
|
|
7006
7479
|
* @default false
|
|
7007
7480
|
*/
|
|
@@ -7016,10 +7489,16 @@ export declare interface RatingProps extends Omit<React_2.HTMLAttributes<HTMLDiv
|
|
|
7016
7489
|
/** Id of the form the rating belongs to, when it is rendered outside that form. */
|
|
7017
7490
|
form?: string;
|
|
7018
7491
|
/**
|
|
7019
|
-
* Names of the stars ("1 star", "2 stars",
|
|
7020
|
-
* `aria-label` (default "Rating"). Unset members keep
|
|
7492
|
+
* Names of the stars ("1 star", "2 stars", …, and "2.5 stars" for a half value), for
|
|
7493
|
+
* localization. The group's own name is `aria-label` (default "Rating"). Unset members keep
|
|
7494
|
+
* their English defaults.
|
|
7021
7495
|
*/
|
|
7022
7496
|
labels?: RatingLabels;
|
|
7497
|
+
/**
|
|
7498
|
+
* Custom stars: one `Rating.Item` per value from 1 to `max`, in place of the generated stars
|
|
7499
|
+
* (when the children render content). `max` still sets the key range and the star names.
|
|
7500
|
+
*/
|
|
7501
|
+
children?: React_2.ReactNode;
|
|
7023
7502
|
/** Ref to the `role="radiogroup"` element. */
|
|
7024
7503
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
7025
7504
|
}
|
|
@@ -7110,12 +7589,16 @@ export declare interface RovingContainerProps {
|
|
|
7110
7589
|
* the label, hint, error and required state automatically.
|
|
7111
7590
|
* - **Forms**: with `name` the text is submitted with the form; a form reset restores
|
|
7112
7591
|
* `defaultValue`.
|
|
7592
|
+
* - **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
7593
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own
|
|
7594
|
+
* prop, then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as
|
|
7595
|
+
* `data-size` and `data-appearance` on the root `<div>`.
|
|
7113
7596
|
*
|
|
7114
7597
|
* @example
|
|
7115
7598
|
* <SearchBox aria-label="Search files" value={query} onValueChange={setQuery} />
|
|
7116
7599
|
*/
|
|
7117
7600
|
export declare const SearchBox: {
|
|
7118
|
-
({ value: controlledValue, defaultValue, onValueChange, onChange, onClear, placeholder, disabled, contentBefore, contentAfter, dismiss, className, ref, controlRef, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, required, name, form, readOnly, autoComplete, autoFocus, autoCapitalize, autoCorrect, inputMode, enterKeyHint, spellCheck, maxLength, minLength, pattern, tabIndex, onFocus, onBlur, onKeyDown, onKeyUp, onMouseDown, hidden, ...rest }: SearchBoxProps): React_2.JSX.Element;
|
|
7601
|
+
({ value: controlledValue, defaultValue, onValueChange, onChange, onClear, placeholder, disabled, size: sizeProp, appearance: appearanceProp, contentBefore, contentAfter, dismiss, className, ref, controlRef, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, required, name, form, readOnly, autoComplete, autoFocus, autoCapitalize, autoCorrect, inputMode, enterKeyHint, spellCheck, maxLength, minLength, pattern, tabIndex, onFocus, onBlur, onKeyDown, onKeyUp, onMouseDown, hidden, ...rest }: SearchBoxProps): React_2.JSX.Element;
|
|
7119
7602
|
displayName: string;
|
|
7120
7603
|
};
|
|
7121
7604
|
|
|
@@ -7166,6 +7649,17 @@ export declare interface SearchBoxProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
7166
7649
|
placeholder?: string;
|
|
7167
7650
|
/** Whether the search box is disabled and non-interactive. */
|
|
7168
7651
|
disabled?: boolean;
|
|
7652
|
+
/**
|
|
7653
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
7654
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`.
|
|
7655
|
+
*/
|
|
7656
|
+
size?: CoreSize;
|
|
7657
|
+
/**
|
|
7658
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
7659
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
7660
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
7661
|
+
*/
|
|
7662
|
+
appearance?: InputAppearance;
|
|
7169
7663
|
/**
|
|
7170
7664
|
* Slot rendered before the text (replaces the default search icon). It takes the room it needs;
|
|
7171
7665
|
* the text starts after it. A value that renders nothing (`null`, `false`, `''`, an empty array
|
|
@@ -7218,6 +7712,11 @@ export declare interface SearchBoxProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
7218
7712
|
* `Field` label, `aria-label` or `aria-labelledby`. Inside a `Field` it picks up the label, hint,
|
|
7219
7713
|
* error, `required` (native attribute) and invalid state automatically.
|
|
7220
7714
|
*
|
|
7715
|
+
* `size` resolves from its own prop, then the surrounding `Field`'s `size`, then
|
|
7716
|
+
* `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own prop, then
|
|
7717
|
+
* `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
7718
|
+
* `data-appearance` on the `<select>`.
|
|
7719
|
+
*
|
|
7221
7720
|
* @example
|
|
7222
7721
|
* <Field label="Country" required>
|
|
7223
7722
|
* <Select defaultValue="">
|
|
@@ -7227,7 +7726,7 @@ export declare interface SearchBoxProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
7227
7726
|
* </Field>
|
|
7228
7727
|
*/
|
|
7229
7728
|
export declare const Select: {
|
|
7230
|
-
({ error, errorMessageProps, className, children, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: SelectProps): React_2.JSX.Element;
|
|
7729
|
+
({ error, errorMessageProps, size: sizeProp, htmlSize, appearance: appearanceProp, className, children, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: SelectProps): React_2.JSX.Element;
|
|
7231
7730
|
displayName: string;
|
|
7232
7731
|
};
|
|
7233
7732
|
|
|
@@ -7242,7 +7741,7 @@ declare type SelectionMode_2 = 'single' | 'multiple';
|
|
|
7242
7741
|
export { SelectionMode_2 as SelectionMode }
|
|
7243
7742
|
|
|
7244
7743
|
/** Properties for the Select component. */
|
|
7245
|
-
export declare interface SelectProps extends React_2.SelectHTMLAttributes<HTMLSelectElement> {
|
|
7744
|
+
export declare interface SelectProps extends Omit<React_2.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
7246
7745
|
/**
|
|
7247
7746
|
* Validation error.
|
|
7248
7747
|
* - A non-empty string renders the message in a `role="alert"` element **after** the select
|
|
@@ -7259,6 +7758,24 @@ export declare interface SelectProps extends React_2.SelectHTMLAttributes<HTMLSe
|
|
|
7259
7758
|
error?: string | boolean;
|
|
7260
7759
|
/** Props of the error message element (`id`, `className`, …) rendered for a string `error`. */
|
|
7261
7760
|
errorMessageProps?: InputErrorMessageProps;
|
|
7761
|
+
/**
|
|
7762
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
7763
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`.
|
|
7764
|
+
*
|
|
7765
|
+
* A number is the native `size` attribute (the number of visible rows), as in 0.8: it still
|
|
7766
|
+
* renders, warns once in development and is removed in 1.0. Use `htmlSize` for it.
|
|
7767
|
+
* A string of digits only (`size="20"` from untyped code) counts as that number. Any other value
|
|
7768
|
+
* outside the three sizes renders as if `size` were not set.
|
|
7769
|
+
*/
|
|
7770
|
+
size?: CoreSize | number;
|
|
7771
|
+
/** The native `size` attribute: the number of visible rows. */
|
|
7772
|
+
htmlSize?: number;
|
|
7773
|
+
/**
|
|
7774
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
7775
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
7776
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
7777
|
+
*/
|
|
7778
|
+
appearance?: InputAppearance;
|
|
7262
7779
|
/** Ref to the `<select>` element. */
|
|
7263
7780
|
ref?: React_2.Ref<HTMLSelectElement>;
|
|
7264
7781
|
}
|
|
@@ -7357,11 +7874,14 @@ export declare interface SkeletonProps extends React_2.HTMLAttributes<HTMLDivEle
|
|
|
7357
7874
|
* The fill follows the value through the `--wave-slider-progress` variable on the input (also in
|
|
7358
7875
|
* the server HTML), including the browser's snapping to `step` and a form reset.
|
|
7359
7876
|
*
|
|
7877
|
+
* `size` (`small`, `medium`) sets the thumb and rail dimensions; the input carries `data-size`.
|
|
7878
|
+
* Slider does not read a surrounding `Field`'s size or a `WaveProvider`'s input defaults.
|
|
7879
|
+
*
|
|
7360
7880
|
* @example
|
|
7361
7881
|
* <Slider label="Volume" min={0} max={100} value={volume} onValueChange={setVolume} />
|
|
7362
7882
|
*/
|
|
7363
7883
|
export declare const Slider: {
|
|
7364
|
-
({ className, style, label, value, defaultValue, min, max, step, form, onChange, onValueChange, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, required, ...props }: SliderProps): React_2.JSX.Element;
|
|
7884
|
+
({ className, style, label, value, defaultValue, min, max, step, size: sizeProp, form, onChange, onValueChange, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, required, ...props }: SliderProps): React_2.JSX.Element;
|
|
7365
7885
|
displayName: string;
|
|
7366
7886
|
};
|
|
7367
7887
|
|
|
@@ -7371,7 +7891,7 @@ export declare const sliderClassNames: {
|
|
|
7371
7891
|
};
|
|
7372
7892
|
|
|
7373
7893
|
/** Properties for the Slider component. */
|
|
7374
|
-
export declare interface SliderProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
7894
|
+
export declare interface SliderProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
7375
7895
|
/** Controlled slider value. */
|
|
7376
7896
|
value?: number;
|
|
7377
7897
|
/** Initial value for uncontrolled usage. */
|
|
@@ -7391,10 +7911,25 @@ export declare interface SliderProps extends Omit<React_2.InputHTMLAttributes<HT
|
|
|
7391
7911
|
* `Field`, leave it out so the Field's label names the slider.
|
|
7392
7912
|
*/
|
|
7393
7913
|
label?: string;
|
|
7914
|
+
/**
|
|
7915
|
+
* Size of the thumb and rail: the 0.7 20px thumb on a 4px rail, or a small 16px thumb on a 2px
|
|
7916
|
+
* rail in a 24px-tall input. Unlike the text controls and pickers, Slider does not read a
|
|
7917
|
+
* surrounding `Field`'s size or a `WaveProvider`'s input defaults: this prop is the only source
|
|
7918
|
+
* of its size.
|
|
7919
|
+
*
|
|
7920
|
+
* `SliderProps` inherited the native HTML `size` attribute, which a range input ignores anyway.
|
|
7921
|
+
* A number is deprecated: it renders nothing (not even the native attribute), is reported once
|
|
7922
|
+
* in development, and is a type error from 1.0.
|
|
7923
|
+
* @default 'medium'
|
|
7924
|
+
*/
|
|
7925
|
+
size?: SliderSize | number;
|
|
7394
7926
|
/** Ref to the `<input type="range">` element. */
|
|
7395
7927
|
ref?: React_2.Ref<HTMLInputElement>;
|
|
7396
7928
|
}
|
|
7397
7929
|
|
|
7930
|
+
/** Size of the thumb and rail: a small 16px thumb on a 2px rail, or the 0.7 20px thumb on a 4px rail. */
|
|
7931
|
+
export declare type SliderSize = Extract<Size, 'small' | 'medium'>;
|
|
7932
|
+
|
|
7398
7933
|
/**
|
|
7399
7934
|
* Slot definition — a customisable sub-element of a component. Accepts:
|
|
7400
7935
|
*
|
|
@@ -7442,14 +7977,26 @@ export declare type SortDirection = 'ascending' | 'descending';
|
|
|
7442
7977
|
* A numeric input with decrement/increment buttons (APG spinbutton pattern).
|
|
7443
7978
|
*
|
|
7444
7979
|
* - **Keyboard** on the input: ArrowUp/ArrowDown step by `step`, PageUp/PageDown by `largeStep`
|
|
7445
|
-
* (default ten steps), Home/End jump to `min`/`max` when they are finite
|
|
7446
|
-
*
|
|
7447
|
-
* announce the new
|
|
7980
|
+
* (default ten steps), Home/End jump to `min`/`max` when they are finite (Shift+Home and
|
|
7981
|
+
* Shift+End keep their native text-selection instead). The −/+ buttons are not tab stops and
|
|
7982
|
+
* never take focus, so focus stays on the spinbutton and screen readers announce the new
|
|
7983
|
+
* value.
|
|
7984
|
+
* - **Pointer** on the −/+ buttons (mouse, touch or pen): a short press steps once, on release
|
|
7985
|
+
* (its click), never on the press alone, so a finger that starts a scroll on a button changes
|
|
7986
|
+
* nothing. Holding a button repeats the step: the first after 300ms, then faster, every 80ms
|
|
7987
|
+
* after about a second (Fluent's timing). A hold stops when the button is released, the
|
|
7988
|
+
* pointer leaves it or the press turns into a scroll, at the bound, when the window loses
|
|
7989
|
+
* focus, and when the spin button becomes disabled or read-only. Only the primary button of a
|
|
7990
|
+
* primary pointer holds: a second finger, a secondary button or a Ctrl+press with a mouse (the
|
|
7991
|
+
* secondary click on macOS) neither starts a hold nor ends one. A click without a press (a
|
|
7992
|
+
* screen reader, `element.click()`) steps once. The buttons open no context menu (a long press
|
|
7993
|
+
* on touch would), show no iOS callout, and allow no text selection or double-tap zoom.
|
|
7448
7994
|
* - **Typing** edits a draft: the value is parsed, clamped and committed on blur or Enter
|
|
7449
7995
|
* (Escape reverts). Text that is not a number is flagged with `aria-invalid` and reverted on
|
|
7450
7996
|
* blur. Steps (keys and buttons) start from the typed number, and the −/+ buttons are disabled
|
|
7451
7997
|
* when that number is at `min`/`max`. Steps are rounded to the precision of `step` and of the
|
|
7452
|
-
* value, so `0.1 + 0.2` is `0.3
|
|
7998
|
+
* value, so `0.1 + 0.2` is `0.3`; `precision` rounds every committed value, typed or stepped,
|
|
7999
|
+
* to a fixed number of decimals instead, without padding it (pad with `displayValue`).
|
|
7453
8000
|
* - **Routing**: `id`, ARIA, native input attributes and focus/keyboard handlers go to the
|
|
7454
8001
|
* `<input role="spinbutton">`; `className`, `style`, `data-*`, other handlers and `ref` stay on
|
|
7455
8002
|
* the root (`controlRef` reaches the input). Inside a `Field` it picks up the label, hint, error
|
|
@@ -7457,16 +8004,119 @@ export declare type SortDirection = 'ascending' | 'descending';
|
|
|
7457
8004
|
* or use a label (development warning otherwise).
|
|
7458
8005
|
* - **Forms**: with `name` the committed value is submitted; `required` makes the input natively
|
|
7459
8006
|
* required; a form reset restores `defaultValue`.
|
|
8007
|
+
* - **Empty values**: `allowEmpty` lets the value become `null` (an empty field). Clearing the
|
|
8008
|
+
* text and committing it (blur or Enter) sets the value to `null`, uncontrolled too; stepping
|
|
8009
|
+
* up or down from an empty value starts at 0 and clamps to the nearest bound. `required` (its
|
|
8010
|
+
* own, or a required Field's) still blocks submitting an empty value: the check runs on the
|
|
8011
|
+
* `HiddenInput` that carries the committed value, not on the shown text, so it keeps working
|
|
8012
|
+
* even when the shown text is not empty.
|
|
8013
|
+
* - **Display text**: `displayValue` shows formatted text (`$1.00`) for the value while the field
|
|
8014
|
+
* is not being edited, and as its `aria-valuetext`; while the field has focus and can be
|
|
8015
|
+
* edited it shows the plain number instead, so typing still edits the number (a consumer
|
|
8016
|
+
* `aria-valuetext` always wins). It applies only while `value` is controlled: an uncontrolled
|
|
8017
|
+
* spin button ignores it and warns once in development.
|
|
8018
|
+
* - **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
8019
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own
|
|
8020
|
+
* prop, then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as
|
|
8021
|
+
* `data-size` and `data-appearance` on the root. SpinButton takes every size the other fields
|
|
8022
|
+
* do, and unlike 0.7 its root is now exactly as tall as theirs, with its step buttons and
|
|
8023
|
+
* input taking up that height; sizing the root wider widens the input instead of leaving
|
|
8024
|
+
* empty space inside it. The step buttons keep a 1px separator from the input only in
|
|
8025
|
+
* `outline`; the other appearances have none.
|
|
7460
8026
|
* - The −/+ buttons are named "Decrement"/"Increment"; `labels` localizes the names.
|
|
7461
8027
|
*
|
|
7462
8028
|
* @example
|
|
7463
8029
|
* <SpinButton aria-label="Quantity" min={1} max={10} value={qty} onValueChange={setQty} />
|
|
7464
8030
|
*/
|
|
7465
8031
|
export declare const SpinButton: {
|
|
7466
|
-
(
|
|
8032
|
+
(props: SpinButtonProps | SpinButtonAllowEmptyProps): React_2.ReactNode;
|
|
7467
8033
|
displayName: string;
|
|
7468
8034
|
};
|
|
7469
8035
|
|
|
8036
|
+
/** SpinButton props with `allowEmpty`: the value may be `null` (an empty field). */
|
|
8037
|
+
export declare interface SpinButtonAllowEmptyProps extends SpinButtonBaseProps {
|
|
8038
|
+
/** The value may be `null`: clearing the text and committing it empties the field. */
|
|
8039
|
+
allowEmpty: true;
|
|
8040
|
+
/** Controlled value; `null` is an empty field. */
|
|
8041
|
+
value?: number | null;
|
|
8042
|
+
/** Initial value for uncontrolled usage (also what a form reset restores).
|
|
8043
|
+
* @default null
|
|
8044
|
+
*/
|
|
8045
|
+
defaultValue?: number | null;
|
|
8046
|
+
/** Called with the new value when it changes, `null` when the field is emptied. */
|
|
8047
|
+
onValueChange?: (value: number | null) => void;
|
|
8048
|
+
/** Not available with `allowEmpty` (the deprecated alias of `onValueChange`). */
|
|
8049
|
+
onChange?: never;
|
|
8050
|
+
}
|
|
8051
|
+
|
|
8052
|
+
/**
|
|
8053
|
+
* Properties every SpinButton mode shares (every member of {@link SpinButtonProps} and
|
|
8054
|
+
* {@link SpinButtonAllowEmptyProps} except the value members, which differ between them).
|
|
8055
|
+
*/
|
|
8056
|
+
export declare interface SpinButtonBaseProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | keyof SpinButtonInputProps>, SpinButtonInputProps {
|
|
8057
|
+
/** Minimum allowed value.
|
|
8058
|
+
* @default -Infinity
|
|
8059
|
+
*/
|
|
8060
|
+
min?: number;
|
|
8061
|
+
/** Maximum allowed value.
|
|
8062
|
+
* @default Infinity
|
|
8063
|
+
*/
|
|
8064
|
+
max?: number;
|
|
8065
|
+
/** Step of the increment/decrement buttons and of ArrowUp/ArrowDown.
|
|
8066
|
+
* @default 1
|
|
8067
|
+
*/
|
|
8068
|
+
step?: number;
|
|
8069
|
+
/** Step of PageUp/PageDown.
|
|
8070
|
+
* @default step * 10
|
|
8071
|
+
*/
|
|
8072
|
+
largeStep?: number;
|
|
8073
|
+
/**
|
|
8074
|
+
* Decimals every committed value is rounded to, typed or stepped (0–20); the number is not
|
|
8075
|
+
* padded (use `displayValue` for `1.00`). Default: steps round to the decimals of `step` and
|
|
8076
|
+
* the value, typed values are kept as typed.
|
|
8077
|
+
*/
|
|
8078
|
+
precision?: number;
|
|
8079
|
+
/** Whether the spin button is disabled and non-interactive. */
|
|
8080
|
+
disabled?: boolean;
|
|
8081
|
+
/** Form field name. With a name, the committed value is submitted with the form. */
|
|
8082
|
+
name?: string;
|
|
8083
|
+
/** Id of the form the spin button belongs to, when it is rendered outside that form. */
|
|
8084
|
+
form?: string;
|
|
8085
|
+
/**
|
|
8086
|
+
* Names of the −/+ step buttons (not tab stops, but in the accessibility tree), for
|
|
8087
|
+
* localization. Unset members keep their English defaults.
|
|
8088
|
+
*/
|
|
8089
|
+
labels?: SpinButtonLabels;
|
|
8090
|
+
/**
|
|
8091
|
+
* Text shown for the value while the field is not being edited, and its `aria-valuetext` (a
|
|
8092
|
+
* `$1.00` for 1). While the field has focus and can be edited it shows the plain number, so
|
|
8093
|
+
* typing edits the number. Applies only while `value` is controlled (update it with the
|
|
8094
|
+
* value); Fluent's `displayValue`.
|
|
8095
|
+
*/
|
|
8096
|
+
displayValue?: string;
|
|
8097
|
+
/**
|
|
8098
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
8099
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`.
|
|
8100
|
+
*
|
|
8101
|
+
* SpinButton is 24, 32 or 40px tall like every field; its buttons are square-ish, 24, 32 or
|
|
8102
|
+
* 40px wide.
|
|
8103
|
+
*/
|
|
8104
|
+
size?: CoreSize;
|
|
8105
|
+
/**
|
|
8106
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
8107
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a
|
|
8108
|
+
* visible label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
8109
|
+
*
|
|
8110
|
+
* The step buttons keep a 1px separator from the input only in `outline`; the other
|
|
8111
|
+
* appearances have none.
|
|
8112
|
+
*/
|
|
8113
|
+
appearance?: InputAppearance;
|
|
8114
|
+
/** Ref to the root `<div>`. */
|
|
8115
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
8116
|
+
/** Ref to the `<input role="spinbutton">` (the focusable control). */
|
|
8117
|
+
controlRef?: React_2.Ref<HTMLInputElement>;
|
|
8118
|
+
}
|
|
8119
|
+
|
|
7470
8120
|
/**
|
|
7471
8121
|
* SpinButton: `root` on the outer element; `decrementButton` on the − button; `input` on the
|
|
7472
8122
|
* `role="spinbutton"` input; `incrementButton` on the + button.
|
|
@@ -7499,8 +8149,14 @@ export declare interface SpinButtonLabels {
|
|
|
7499
8149
|
decrement?: string;
|
|
7500
8150
|
}
|
|
7501
8151
|
|
|
7502
|
-
/**
|
|
7503
|
-
export declare interface SpinButtonProps extends
|
|
8152
|
+
/** SpinButton props with a number value (the 0.7 shape). */
|
|
8153
|
+
export declare interface SpinButtonProps extends SpinButtonBaseProps {
|
|
8154
|
+
/**
|
|
8155
|
+
* Allows an empty value (`null`). Takes the literal `true`: a `boolean` variable fits neither
|
|
8156
|
+
* member of the props, so branch the JSX or spread `{ allowEmpty: true, value }`.
|
|
8157
|
+
* @default false
|
|
8158
|
+
*/
|
|
8159
|
+
allowEmpty?: false;
|
|
7504
8160
|
/** Controlled numeric value. */
|
|
7505
8161
|
value?: number;
|
|
7506
8162
|
/** Initial value for uncontrolled usage (also what a form reset restores).
|
|
@@ -7518,37 +8174,6 @@ export declare interface SpinButtonProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
7518
8174
|
* @deprecated Use `onValueChange`. (`onChange` is reserved for native change events.)
|
|
7519
8175
|
*/
|
|
7520
8176
|
onChange?: (value: number) => void;
|
|
7521
|
-
/** Minimum allowed value.
|
|
7522
|
-
* @default -Infinity
|
|
7523
|
-
*/
|
|
7524
|
-
min?: number;
|
|
7525
|
-
/** Maximum allowed value.
|
|
7526
|
-
* @default Infinity
|
|
7527
|
-
*/
|
|
7528
|
-
max?: number;
|
|
7529
|
-
/** Step of the increment/decrement buttons and of ArrowUp/ArrowDown.
|
|
7530
|
-
* @default 1
|
|
7531
|
-
*/
|
|
7532
|
-
step?: number;
|
|
7533
|
-
/** Step of PageUp/PageDown.
|
|
7534
|
-
* @default step * 10
|
|
7535
|
-
*/
|
|
7536
|
-
largeStep?: number;
|
|
7537
|
-
/** Whether the spin button is disabled and non-interactive. */
|
|
7538
|
-
disabled?: boolean;
|
|
7539
|
-
/** Form field name. With a name, the committed value is submitted with the form. */
|
|
7540
|
-
name?: string;
|
|
7541
|
-
/** Id of the form the spin button belongs to, when it is rendered outside that form. */
|
|
7542
|
-
form?: string;
|
|
7543
|
-
/**
|
|
7544
|
-
* Names of the −/+ step buttons (not tab stops, but in the accessibility tree), for
|
|
7545
|
-
* localization. Unset members keep their English defaults.
|
|
7546
|
-
*/
|
|
7547
|
-
labels?: SpinButtonLabels;
|
|
7548
|
-
/** Ref to the root `<div>`. */
|
|
7549
|
-
ref?: React_2.Ref<HTMLDivElement>;
|
|
7550
|
-
/** Ref to the `<input role="spinbutton">` (the focusable control). */
|
|
7551
|
-
controlRef?: React_2.Ref<HTMLInputElement>;
|
|
7552
8177
|
}
|
|
7553
8178
|
|
|
7554
8179
|
/**
|
|
@@ -8069,9 +8694,11 @@ export declare type SwatchPickerSize = Extract<Size, 'small' | 'medium' | 'large
|
|
|
8069
8694
|
* `labelPosition` (the root carries `data-label-position`). Beside the label, the switch lines
|
|
8070
8695
|
* up with the first line of a label that wraps or has a second line. `children` are not
|
|
8071
8696
|
* rendered (a development warning says so).
|
|
8697
|
+
* - `size` (`small`, `medium`) sets the track and thumb dimensions; the root carries `data-size`.
|
|
8698
|
+
* Switch does not read a surrounding `Field`'s size or a `WaveProvider`'s input defaults.
|
|
8072
8699
|
*/
|
|
8073
8700
|
export declare const Switch: {
|
|
8074
|
-
({ checked: checkedProp, defaultChecked, onCheckedChange, onChange, disabled, disabledFocusable, label, labelPosition, name, value, required, form, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, "aria-disabled": ariaDisabled, autoFocus, tabIndex, onClick, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, children, ref, ...rest }: SwitchProps): React_2.JSX.Element;
|
|
8701
|
+
({ checked: checkedProp, defaultChecked, onCheckedChange, onChange, disabled, disabledFocusable, label, labelPosition, size, name, value, required, form, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, "aria-disabled": ariaDisabled, autoFocus, tabIndex, onClick, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, children, ref, ...rest }: SwitchProps): React_2.JSX.Element;
|
|
8075
8702
|
displayName: string;
|
|
8076
8703
|
};
|
|
8077
8704
|
|
|
@@ -8134,6 +8761,14 @@ export declare interface SwitchProps extends Omit<React_2.HTMLAttributes<HTMLLab
|
|
|
8134
8761
|
* @default 'after'
|
|
8135
8762
|
*/
|
|
8136
8763
|
labelPosition?: SwitchLabelPosition;
|
|
8764
|
+
/**
|
|
8765
|
+
* Size of the track: the 0.7 40x20 track with a 14px thumb, or a small 32x16 track with a 10px
|
|
8766
|
+
* thumb and a 24px-tall pointer target. Unlike the text controls and pickers, Switch does not
|
|
8767
|
+
* read a surrounding Field's size or a WaveProvider's input defaults: this prop is the only
|
|
8768
|
+
* source of its size.
|
|
8769
|
+
* @default 'medium'
|
|
8770
|
+
*/
|
|
8771
|
+
size?: SwitchSize;
|
|
8137
8772
|
/**
|
|
8138
8773
|
* Form field name. With a name, the switch takes part in native form submission: it submits
|
|
8139
8774
|
* `name=value` while on.
|
|
@@ -8163,6 +8798,9 @@ export declare interface SwitchProps extends Omit<React_2.HTMLAttributes<HTMLLab
|
|
|
8163
8798
|
ref?: React_2.Ref<HTMLLabelElement>;
|
|
8164
8799
|
}
|
|
8165
8800
|
|
|
8801
|
+
/** Size of the track: a 32x16 track with a 10px thumb, or the 0.7 40x20 track with a 14px thumb. */
|
|
8802
|
+
export declare type SwitchSize = Extract<Size, 'small' | 'medium'>;
|
|
8803
|
+
|
|
8166
8804
|
/**
|
|
8167
8805
|
* A non-interactive data table with an optional striped body. The table sits in a horizontally
|
|
8168
8806
|
* scrollable wrapper; while it scrolls, the wrapper is a focusable region (named by
|
|
@@ -8634,6 +9272,12 @@ export declare interface TagOwnProps {
|
|
|
8634
9272
|
* Selected values without a matching option are shown with their raw value. The open list renders
|
|
8635
9273
|
* only in the browser: an open list (`defaultOpen`, `open`) is closed in the server HTML and opens
|
|
8636
9274
|
* once the picker has hydrated.
|
|
9275
|
+
*
|
|
9276
|
+
* **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
9277
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'` (a Field or provider `small`
|
|
9278
|
+
* gives `'medium'` too, since TagPicker has no `small`); `appearance` from its own prop, then
|
|
9279
|
+
* `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
9280
|
+
* `data-appearance` on the root `<div>`. The option list keeps its size.
|
|
8637
9281
|
*/
|
|
8638
9282
|
export declare const TagPicker: {
|
|
8639
9283
|
(props: TagPickerProps): React_2.JSX.Element;
|
|
@@ -8746,6 +9390,19 @@ export declare interface TagPickerProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
8746
9390
|
* @default false
|
|
8747
9391
|
*/
|
|
8748
9392
|
disabled?: boolean;
|
|
9393
|
+
/**
|
|
9394
|
+
* Size of the tags and the field: `medium` (the 0.7 look), `large` or `extra-large` (Fluent's
|
|
9395
|
+
* union; TagPicker has no `small`). Default: the surrounding Field's `size`, else `WaveProvider
|
|
9396
|
+
* inputDefaults.size`, else `'medium'`; a Field or provider `small` gives `'medium'` too. The
|
|
9397
|
+
* option list keeps its size.
|
|
9398
|
+
*/
|
|
9399
|
+
size?: TagPickerSize;
|
|
9400
|
+
/**
|
|
9401
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
9402
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
9403
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
9404
|
+
*/
|
|
9405
|
+
appearance?: InputAppearance;
|
|
8749
9406
|
/** Name of the values in form submissions (one hidden input per value). */
|
|
8750
9407
|
name?: string;
|
|
8751
9408
|
/** Id of the form the values belong to, when the TagPicker is outside it. */
|
|
@@ -8793,6 +9450,9 @@ export declare interface TagPickerProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
8793
9450
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
8794
9451
|
}
|
|
8795
9452
|
|
|
9453
|
+
/** Sizes of TagPicker (Fluent's): medium (the 0.7 look), large and extra-large. */
|
|
9454
|
+
export declare type TagPickerSize = Extract<Size, 'medium' | 'large' | 'extra-large'>;
|
|
9455
|
+
|
|
8796
9456
|
/**
|
|
8797
9457
|
* Props of {@link Tag} rendered as `C` (default `'span'`). `TagProps` without a type argument is
|
|
8798
9458
|
* the 0.4 name.
|
|
@@ -8975,13 +9635,18 @@ export { Text_2 as Text }
|
|
|
8975
9635
|
* bottom border while focused). Inside a `Field` it picks up the label, hint, error, `required`
|
|
8976
9636
|
* (native attribute) and invalid state automatically.
|
|
8977
9637
|
*
|
|
9638
|
+
* `size` resolves from its own prop, then the surrounding `Field`'s `size`, then
|
|
9639
|
+
* `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own prop, then
|
|
9640
|
+
* `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as `data-size` and
|
|
9641
|
+
* `data-appearance` on the textarea element.
|
|
9642
|
+
*
|
|
8978
9643
|
* @example
|
|
8979
9644
|
* <Field label="Description" hint="Markdown is supported">
|
|
8980
9645
|
* <Textarea rows={4} />
|
|
8981
9646
|
* </Field>
|
|
8982
9647
|
*/
|
|
8983
9648
|
export declare const Textarea: {
|
|
8984
|
-
({ error, errorMessageProps, className, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: TextareaProps): React_2.JSX.Element;
|
|
9649
|
+
({ error, errorMessageProps, size: sizeProp, appearance: appearanceProp, className, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, required, ...props }: TextareaProps): React_2.JSX.Element;
|
|
8985
9650
|
displayName: string;
|
|
8986
9651
|
};
|
|
8987
9652
|
|
|
@@ -9009,6 +9674,18 @@ export declare interface TextareaProps extends React_2.TextareaHTMLAttributes<HT
|
|
|
9009
9674
|
error?: string | boolean;
|
|
9010
9675
|
/** Props of the error message element (`id`, `className`, …) rendered for a string `error`. */
|
|
9011
9676
|
errorMessageProps?: InputErrorMessageProps;
|
|
9677
|
+
/**
|
|
9678
|
+
* Size of the field, a minimum height with its type ramp: `small` (64px, Caption 1 text),
|
|
9679
|
+
* `medium` (80px, Body 1) or `large` (96px, Body 2). Default: the surrounding Field's `size`,
|
|
9680
|
+
* else `WaveProvider inputDefaults.size`, else `'medium'`.
|
|
9681
|
+
*/
|
|
9682
|
+
size?: CoreSize;
|
|
9683
|
+
/**
|
|
9684
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
9685
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
9686
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
9687
|
+
*/
|
|
9688
|
+
appearance?: InputAppearance;
|
|
9012
9689
|
/** Ref to the `<textarea>` element. */
|
|
9013
9690
|
ref?: React_2.Ref<HTMLTextAreaElement>;
|
|
9014
9691
|
}
|
|
@@ -9076,6 +9753,10 @@ export declare type TextWeight = 'regular' | 'semibold' | 'bold';
|
|
|
9076
9753
|
* picker instead of to the clear button that disappears.
|
|
9077
9754
|
* - The value is `HH:mm` (24-hour) whatever the display `format`; values off the `step` grid or
|
|
9078
9755
|
* outside the bounds are still displayed in `format`.
|
|
9756
|
+
* - **Size and appearance**: `size` resolves from its own prop, then the surrounding `Field`'s
|
|
9757
|
+
* `size`, then `WaveProvider inputDefaults.size`, else `'medium'`; `appearance` from its own
|
|
9758
|
+
* prop, then `WaveProvider inputDefaults.appearance`, else `'outline'`; both render as
|
|
9759
|
+
* `data-size` and `data-appearance` on the root `<div>`. The time list keeps its size.
|
|
9079
9760
|
* - The input (`controlRef`) receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
|
|
9080
9761
|
* `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`,
|
|
9081
9762
|
* `autoFocus`, `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes
|
|
@@ -9204,6 +9885,18 @@ export declare interface TimePickerProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
9204
9885
|
* @default false
|
|
9205
9886
|
*/
|
|
9206
9887
|
disabled?: boolean;
|
|
9888
|
+
/**
|
|
9889
|
+
* Size of the field: `small` (24px tall), `medium` (32px) or `large` (40px). Default: the
|
|
9890
|
+
* surrounding Field's `size`, else `WaveProvider inputDefaults.size`, else `'medium'`. The time
|
|
9891
|
+
* list keeps its size.
|
|
9892
|
+
*/
|
|
9893
|
+
size?: CoreSize;
|
|
9894
|
+
/**
|
|
9895
|
+
* Look of the field: `outline` (a full border), `underline` (a bottom stroke only),
|
|
9896
|
+
* `filled-darker` or `filled-lighter` (a fill without a visible stroke: give the field a visible
|
|
9897
|
+
* label). Default: `WaveProvider inputDefaults.appearance`, else `'outline'`.
|
|
9898
|
+
*/
|
|
9899
|
+
appearance?: InputAppearance;
|
|
9207
9900
|
/**
|
|
9208
9901
|
* Makes the input read-only: the list does not open and the value cannot change. Turning it (or
|
|
9209
9902
|
* `disabled`) on while the user is typing drops the typed text.
|
|
@@ -11015,6 +11708,8 @@ export declare interface WaveContextValue {
|
|
|
11015
11708
|
themeClassName: string;
|
|
11016
11709
|
/** Element portaled overlays render into; `null` means `document.body`. */
|
|
11017
11710
|
portalContainer: HTMLElement | null;
|
|
11711
|
+
/** The merged input defaults of the providers above (`{}` outside a provider). */
|
|
11712
|
+
inputDefaults: InputDefaults;
|
|
11018
11713
|
/** `false` when no {@link WaveProvider} is above the caller (the defaults are returned). */
|
|
11019
11714
|
hasProvider: boolean;
|
|
11020
11715
|
}
|
|
@@ -11038,9 +11733,12 @@ export declare type WaveDir = 'ltr' | 'rtl';
|
|
|
11038
11733
|
* enclosing provider, so `<WaveProvider theme="light">` inside an RTL app is a light panel that
|
|
11039
11734
|
* stays right-to-left and keeps the app's portal container. At the top level the defaults are
|
|
11040
11735
|
* `'light'`, `'ltr'` and `document.body`.
|
|
11736
|
+
* - `inputDefaults` nests differently: a nested provider's defined keys override the enclosing
|
|
11737
|
+
* provider's, and an omitted key is inherited, so setting only `appearance` in a nested provider
|
|
11738
|
+
* keeps the enclosing provider's `size`.
|
|
11041
11739
|
*/
|
|
11042
11740
|
export declare const WaveProvider: {
|
|
11043
|
-
({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, children, className, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
|
|
11741
|
+
({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, inputDefaults: inputDefaultsProp, children, className, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
|
|
11044
11742
|
displayName: string;
|
|
11045
11743
|
};
|
|
11046
11744
|
|
|
@@ -11068,6 +11766,14 @@ export declare interface WaveProviderProps extends React_2.HTMLAttributes<HTMLDi
|
|
|
11068
11766
|
* @default the enclosing WaveProvider's container, else document.body
|
|
11069
11767
|
*/
|
|
11070
11768
|
portalContainer?: HTMLElement | null;
|
|
11769
|
+
/**
|
|
11770
|
+
* Default `size` and `appearance` of the text inputs and pickers in the subtree (Input,
|
|
11771
|
+
* Textarea, Select, SearchBox, SpinButton, Combobox, Dropdown, DatePicker, TimePicker,
|
|
11772
|
+
* TagPicker). Their own props and a Field's `size` win. A nested provider merges its keys over
|
|
11773
|
+
* the enclosing provider's; an omitted key is inherited.
|
|
11774
|
+
* @default the enclosing WaveProvider's defaults, else none (`medium`, `outline`)
|
|
11775
|
+
*/
|
|
11776
|
+
inputDefaults?: InputDefaults;
|
|
11071
11777
|
/** Content rendered inside the themed container. */
|
|
11072
11778
|
children: React_2.ReactNode;
|
|
11073
11779
|
/** Ref to the themed root `<div>`. */
|