Skip to content

Commit 44cd374

Browse files
committed
Run eslint fix
1 parent 8232a03 commit 44cd374

File tree

173 files changed

+1036
-891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+1036
-891
lines changed

packages/react/src/accordion/item/AccordionItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ export interface AccordionItemProps
165165
/**
166166
* Event handler called when the panel is opened or closed.
167167
*/
168-
onOpenChange?: (open: boolean, eventDetails: AccordionItem.ChangeEventDetails) => void;
168+
onOpenChange?:
169+
| ((open: boolean, eventDetails: AccordionItem.ChangeEventDetails) => void)
170+
| undefined;
169171
}
170172

171173
export type AccordionItemChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.none;

packages/react/src/accordion/item/AccordionItemContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface AccordionItemContext {
66
open: boolean;
77
state: AccordionItem.State;
88
setTriggerId: (id: string | undefined) => void;
9-
triggerId?: string;
9+
triggerId?: string | undefined;
1010
}
1111

1212
export const AccordionItemContext = React.createContext<AccordionItemContext | undefined>(

packages/react/src/accordion/root/AccordionRoot.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,54 +177,56 @@ export interface AccordionRootProps extends BaseUIComponentProps<'div', Accordio
177177
*
178178
* To render an uncontrolled accordion, use the `defaultValue` prop instead.
179179
*/
180-
value?: AccordionValue;
180+
value?: AccordionValue | undefined;
181181
/**
182182
* The uncontrolled value of the item(s) that should be initially expanded.
183183
*
184184
* To render a controlled accordion, use the `value` prop instead.
185185
*/
186-
defaultValue?: AccordionValue;
186+
defaultValue?: AccordionValue | undefined;
187187
/**
188188
* Whether the component should ignore user interaction.
189189
* @default false
190190
*/
191-
disabled?: boolean;
191+
disabled?: boolean | undefined;
192192
/**
193193
* Allows the browser’s built-in page search to find and expand the panel contents.
194194
*
195195
* Overrides the `keepMounted` prop and uses `hidden="until-found"`
196196
* to hide the element without removing it from the DOM.
197197
* @default false
198198
*/
199-
hiddenUntilFound?: boolean;
199+
hiddenUntilFound?: boolean | undefined;
200200
/**
201201
* Whether to keep the element in the DOM while the panel is closed.
202202
* This prop is ignored when `hiddenUntilFound` is used.
203203
* @default false
204204
*/
205-
keepMounted?: boolean;
205+
keepMounted?: boolean | undefined;
206206
/**
207207
* Whether to loop keyboard focus back to the first item
208208
* when the end of the list is reached while using the arrow keys.
209209
* @default true
210210
*/
211-
loopFocus?: boolean;
211+
loopFocus?: boolean | undefined;
212212
/**
213213
* Event handler called when an accordion item is expanded or collapsed.
214214
* Provides the new value as an argument.
215215
*/
216-
onValueChange?: (value: AccordionValue, eventDetails: AccordionRootChangeEventDetails) => void;
216+
onValueChange?:
217+
| ((value: AccordionValue, eventDetails: AccordionRootChangeEventDetails) => void)
218+
| undefined;
217219
/**
218220
* Whether multiple items can be open at the same time.
219221
* @default true
220222
*/
221-
multiple?: boolean;
223+
multiple?: boolean | undefined;
222224
/**
223225
* The visual orientation of the accordion.
224226
* Controls whether roving focus uses left/right or up/down arrow keys.
225227
* @default 'vertical'
226228
*/
227-
orientation?: Orientation;
229+
orientation?: Orientation | undefined;
228230
}
229231

230232
export type AccordionRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.none;

packages/react/src/alert-dialog/root/AlertDialogRoot.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,22 @@ export interface AlertDialogRootProps<Payload = unknown>
7979
/**
8080
* Event handler called when the dialog is opened or closed.
8181
*/
82-
onOpenChange?: (open: boolean, eventDetails: AlertDialogRoot.ChangeEventDetails) => void;
82+
onOpenChange?:
83+
| ((open: boolean, eventDetails: AlertDialogRoot.ChangeEventDetails) => void)
84+
| undefined;
8385
/**
8486
* A ref to imperative actions.
8587
* - `unmount`: When specified, the dialog will not be unmounted when closed.
8688
* Instead, the `unmount` function must be called to unmount the dialog manually.
8789
* Useful when the dialog's animation is controlled by an external library.
8890
*/
89-
actionsRef?: React.RefObject<AlertDialogRoot.Actions>;
91+
actionsRef?: React.RefObject<AlertDialogRoot.Actions> | undefined;
9092
/**
9193
* A handle to associate the popover with a trigger.
9294
* If specified, allows external triggers to control the popover's open state.
9395
* Can be created with the AlertDialog.createHandle() method.
9496
*/
95-
handle?: DialogHandle<Payload>;
97+
handle?: DialogHandle<Payload> | undefined;
9698
}
9799

98100
export type AlertDialogRootActions = DialogRoot.Actions;

packages/react/src/autocomplete/root/AutocompleteRoot.tsx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function AutocompleteRoot<ItemValue>(
2727
* The items to be displayed in the list.
2828
* Can be either a flat array of items or an array of groups with items.
2929
*/
30-
items?: readonly ItemValue[];
30+
items?: readonly ItemValue[] | undefined;
3131
},
3232
): React.JSX.Element;
3333
export function AutocompleteRoot<ItemValue>(
@@ -181,64 +181,69 @@ export interface AutocompleteRootProps<ItemValue>
181181
* - `none`: items are static (not filtered), and the input value will not change based on the active item.
182182
* @default 'list'
183183
*/
184-
mode?: 'list' | 'both' | 'inline' | 'none';
184+
mode?: ('list' | 'both' | 'inline' | 'none') | undefined;
185185
/**
186186
* Whether the first matching item is highlighted automatically.
187187
* - `true`: highlight after the user types and keep the highlight while the query changes.
188188
* - `'always'`: always highlight the first item.
189189
* @default false
190190
*/
191-
autoHighlight?: boolean | 'always';
191+
autoHighlight?: (boolean | 'always') | undefined;
192192
/**
193193
* Whether the highlighted item should be preserved when the pointer leaves the list.
194194
* @default false
195195
*/
196-
keepHighlight?: boolean;
196+
keepHighlight?: boolean | undefined;
197197
/**
198198
* Whether moving the pointer over items should highlight them.
199199
* @default true
200200
*/
201-
highlightItemOnHover?: boolean;
201+
highlightItemOnHover?: boolean | undefined;
202202
/**
203203
* The uncontrolled input value of the autocomplete when it's initially rendered.
204204
*
205205
* To render a controlled autocomplete, use the `value` prop instead.
206206
*/
207-
defaultValue?: AriaCombobox.Props<
208-
React.ComponentProps<'input'>['defaultValue'],
209-
'none'
210-
>['defaultInputValue'];
207+
defaultValue?:
208+
| AriaCombobox.Props<React.ComponentProps<'input'>['defaultValue'], 'none'>['defaultInputValue']
209+
| undefined;
211210
/**
212211
* The input value of the autocomplete. Use when controlled.
213212
*/
214-
value?: AriaCombobox.Props<React.ComponentProps<'input'>['value'], 'none'>['inputValue'];
213+
value?:
214+
| AriaCombobox.Props<React.ComponentProps<'input'>['value'], 'none'>['inputValue']
215+
| undefined;
215216
/**
216217
* Event handler called when the input value of the autocomplete changes.
217218
*/
218-
onValueChange?: (value: string, eventDetails: AutocompleteRootChangeEventDetails) => void;
219+
onValueChange?:
220+
| ((value: string, eventDetails: AutocompleteRootChangeEventDetails) => void)
221+
| undefined;
219222
/**
220223
* Whether clicking an item should submit the autocomplete's owning form.
221224
* By default, clicking an item via a pointer or <kbd>Enter</kbd> key does not submit the owning form.
222225
* Useful when the autocomplete is used as a single-field form search input.
223226
* @default false
224227
*/
225-
submitOnItemClick?: AriaCombobox.Props<ItemValue, 'none'>['submitOnItemClick'];
228+
submitOnItemClick?: AriaCombobox.Props<ItemValue, 'none'>['submitOnItemClick'] | undefined;
226229
/**
227230
* When the item values are objects (`<Autocomplete.Item value={object}>`), this function converts the object value to a string representation for both display in the input and form submission.
228231
* If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
229232
*/
230-
itemToStringValue?: (itemValue: ItemValue) => string;
233+
itemToStringValue?: ((itemValue: ItemValue) => string) | undefined;
231234
/**
232235
* A ref to imperative actions.
233236
* - `unmount`: When specified, the autocomplete will not be unmounted when closed.
234237
* Instead, the `unmount` function must be called to unmount the autocomplete manually.
235238
* Useful when the autocomplete's animation is controlled by an external library.
236239
*/
237-
actionsRef?: React.RefObject<AutocompleteRootActions>;
240+
actionsRef?: React.RefObject<AutocompleteRootActions> | undefined;
238241
/**
239242
* Event handler called when the popup is opened or closed.
240243
*/
241-
onOpenChange?: (open: boolean, eventDetails: AutocompleteRootChangeEventDetails) => void;
244+
onOpenChange?:
245+
| ((open: boolean, eventDetails: AutocompleteRootChangeEventDetails) => void)
246+
| undefined;
242247
/**
243248
* Callback fired when an item is highlighted or unhighlighted.
244249
* Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
@@ -247,10 +252,12 @@ export interface AutocompleteRootProps<ItemValue>
247252
* - `'pointer'`: the highlight changed due to pointer hovering.
248253
* - `'none'`: the highlight changed programmatically.
249254
*/
250-
onItemHighlighted?: (
251-
highlightedValue: ItemValue | undefined,
252-
eventDetails: AutocompleteRootHighlightEventDetails,
253-
) => void;
255+
onItemHighlighted?:
256+
| ((
257+
highlightedValue: ItemValue | undefined,
258+
eventDetails: AutocompleteRootHighlightEventDetails,
259+
) => void)
260+
| undefined;
254261
}
255262

256263
export namespace AutocompleteRoot {

packages/react/src/avatar/fallback/AvatarFallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface AvatarFallbackProps extends BaseUIComponentProps<'span', Avatar
5252
/**
5353
* How long to wait before showing the fallback. Specified in milliseconds.
5454
*/
55-
delay?: number;
55+
delay?: number | undefined;
5656
}
5757

5858
export namespace AvatarFallback {

packages/react/src/avatar/image/AvatarImage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface AvatarImageProps extends BaseUIComponentProps<'img', AvatarRoot
6767
/**
6868
* Callback fired when the loading status changes.
6969
*/
70-
onLoadingStatusChange?: (status: ImageLoadingStatus) => void;
70+
onLoadingStatusChange?: ((status: ImageLoadingStatus) => void) | undefined;
7171
}
7272

7373
export namespace AvatarImage {

packages/react/src/avatar/image/useImageLoadingStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { NOOP } from '../../utils/noop';
66
export type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
77

88
interface UseImageLoadingStatusOptions {
9-
referrerPolicy?: React.HTMLAttributeReferrerPolicy;
10-
crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>['crossOrigin'];
9+
referrerPolicy?: React.HTMLAttributeReferrerPolicy | undefined;
10+
crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>['crossOrigin'] | undefined;
1111
}
1212

1313
export function useImageLoadingStatus(

packages/react/src/button/Button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ interface ButtonCommonProps {
5656
/**
5757
* Whether the button should ignore user interaction.
5858
*/
59-
disabled?: boolean;
59+
disabled?: boolean | undefined;
6060
/**
6161
* Whether the button should be focusable when disabled.
6262
* @default false
6363
*/
64-
focusableWhenDisabled?: boolean;
64+
focusableWhenDisabled?: boolean | undefined;
6565
}
6666

6767
type NonNativeAttributeKeys =
@@ -79,7 +79,7 @@ interface ButtonNativeProps
7979
extends NativeButtonProps,
8080
ButtonCommonProps,
8181
Omit<BaseUIComponentProps<'button', ButtonState>, 'disabled'> {
82-
nativeButton?: true;
82+
nativeButton?: true | undefined;
8383
}
8484

8585
interface ButtonNonNativeProps

packages/react/src/checkbox-group/CheckboxGroup.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,27 +175,29 @@ export interface CheckboxGroupProps extends BaseUIComponentProps<'div', Checkbox
175175
*
176176
* To render an uncontrolled checkbox group, use the `defaultValue` prop instead.
177177
*/
178-
value?: string[];
178+
value?: string[] | undefined;
179179
/**
180180
* Names of the checkboxes in the group that should be initially ticked.
181181
*
182182
* To render a controlled checkbox group, use the `value` prop instead.
183183
*/
184-
defaultValue?: string[];
184+
defaultValue?: string[] | undefined;
185185
/**
186186
* Event handler called when a checkbox in the group is ticked or unticked.
187187
* Provides the new value as an argument.
188188
*/
189-
onValueChange?: (value: string[], eventDetails: CheckboxGroupChangeEventDetails) => void;
189+
onValueChange?:
190+
| ((value: string[], eventDetails: CheckboxGroupChangeEventDetails) => void)
191+
| undefined;
190192
/**
191193
* Names of all checkboxes in the group. Use this when creating a parent checkbox.
192194
*/
193-
allValues?: string[];
195+
allValues?: string[] | undefined;
194196
/**
195197
* Whether the component should ignore user interaction.
196198
* @default false
197199
*/
198-
disabled?: boolean;
200+
disabled?: boolean | undefined;
199201
}
200202

201203
export type CheckboxGroupChangeEventReason = typeof REASONS.none;

0 commit comments

Comments
 (0)