@carbon/react 1.80.0 → 1.81.0-rc.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +869 -869
- package/es/components/Accordion/AccordionItem.d.ts +2 -2
- package/es/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/es/components/Button/Button.js +3 -0
- package/es/components/Button/ButtonBase.d.ts +2 -2
- package/es/components/ChatButton/ChatButton.js +5 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -0
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.js +17 -10
- package/es/components/ComposedModal/ModalFooter.js +0 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +5 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/FeatureFlags/index.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.d.ts +6 -1
- package/es/components/FileUploader/FileUploader.js +3 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +40 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +123 -0
- package/es/components/FluidTextInput/FluidTextInput.js +2 -2
- package/es/components/Grid/Column.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +6 -1
- package/es/components/Layer/LayerLevel.d.ts +3 -3
- package/es/components/Layer/LayerLevel.js +4 -3
- package/es/components/Layer/index.d.ts +4 -2
- package/es/components/Layer/index.js +3 -2
- package/es/components/Link/Link.js +3 -1
- package/es/components/Menu/Menu.d.ts +1 -1
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/Modal/Modal.js +22 -7
- package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/es/components/MultiSelect/MultiSelect.js +18 -3
- package/es/components/MultiSelect/index.d.ts +2 -4
- package/es/components/NumberInput/NumberInput.js +2 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +69 -17
- package/es/components/OverflowMenu/index.d.ts +3 -5
- package/es/components/OverflowMenu/index.js +9 -4
- package/es/components/OverflowMenu/next/index.js +0 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/es/components/PaginationNav/PaginationNav.js +2 -1
- package/es/components/Popover/index.d.ts +3 -2
- package/es/components/Popover/index.js +10 -5
- package/es/components/Portal/index.d.ts +1 -1
- package/es/components/Search/Search.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +3 -1
- package/es/components/Slider/Slider.d.ts +3 -13
- package/es/components/Slider/Slider.js +2 -14
- package/es/components/Tabs/Tabs.d.ts +2 -2
- package/es/components/Tabs/Tabs.js +8 -6
- package/es/components/Tabs/usePressable.js +1 -1
- package/es/components/Tag/Tag.js +9 -2
- package/es/components/Text/Text.js +3 -2
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +0 -6
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +0 -4
- package/es/components/TextInput/index.d.ts +6 -0
- package/es/components/TextInput/index.js +0 -8
- package/es/components/Tile/Tile.js +0 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +37 -41
- package/es/components/Toggletip/index.js +11 -8
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/TreeView/TreeView.d.ts +1 -1
- package/es/components/UIShell/Content.d.ts +14 -1
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +2 -99
- package/es/components/UIShell/HeaderMenu.js +10 -3
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/es/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/es/components/UIShell/HeaderMenuItem.js +3 -3
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/es/components/UIShell/Link.d.ts +8 -8
- package/es/components/UIShell/Link.js +8 -5
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/SideNavHeader.js +0 -1
- package/es/components/UIShell/SideNavLink.d.ts +3 -4
- package/es/components/UIShell/SideNavLink.js +8 -3
- package/es/components/UIShell/SideNavMenu.js +0 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +0 -1
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +7 -7
- package/es/internal/FloatingMenu.js +2 -1
- package/es/internal/clamp.d.ts +10 -0
- package/es/internal/clamp.js +13 -0
- package/es/internal/useEvent.d.ts +9 -0
- package/es/internal/useEvent.js +8 -49
- package/es/internal/useId.js +1 -1
- package/es/internal/useMatchMedia.d.ts +7 -2
- package/es/internal/useMatchMedia.js +9 -10
- package/es/internal/useNoInteractiveChildren.js +4 -2
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/isRequiredOneOf.d.ts +16 -0
- package/es/prop-types/isRequiredOneOf.js +11 -9
- package/es/tools/setupGetInstanceId.d.ts +12 -0
- package/es/tools/setupGetInstanceId.js +7 -8
- package/es/tools/toggleClass.d.ts +14 -0
- package/es/tools/toggleClass.js +9 -10
- package/es/tools/wrapComponent.d.ts +1 -1
- package/es/types/common.d.ts +1 -6
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/Button/ButtonBase.d.ts +2 -2
- package/lib/components/ChatButton/ChatButton.js +5 -3
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -0
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +16 -9
- package/lib/components/ComposedModal/ModalFooter.js +0 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +5 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/FeatureFlags/index.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.d.ts +6 -1
- package/lib/components/FileUploader/FileUploader.js +3 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +7 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +50 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +133 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/Grid/Column.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +6 -1
- package/lib/components/Layer/LayerLevel.d.ts +3 -3
- package/lib/components/Layer/LayerLevel.js +4 -2
- package/lib/components/Layer/index.d.ts +4 -2
- package/lib/components/Layer/index.js +2 -1
- package/lib/components/Link/Link.js +3 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/Modal/Modal.js +21 -6
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/lib/components/MultiSelect/MultiSelect.js +17 -2
- package/lib/components/MultiSelect/index.d.ts +2 -4
- package/lib/components/NumberInput/NumberInput.js +2 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +69 -17
- package/lib/components/OverflowMenu/index.d.ts +3 -5
- package/lib/components/OverflowMenu/index.js +8 -3
- package/lib/components/OverflowMenu/next/index.js +0 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/lib/components/PageHeader/PageHeader.js +1 -1
- package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/lib/components/PaginationNav/PaginationNav.js +2 -1
- package/lib/components/Popover/index.d.ts +3 -2
- package/lib/components/Popover/index.js +10 -5
- package/lib/components/Portal/index.d.ts +1 -1
- package/lib/components/Search/Search.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +3 -1
- package/lib/components/Slider/Slider.d.ts +3 -13
- package/lib/components/Slider/Slider.js +2 -14
- package/lib/components/Tabs/Tabs.d.ts +2 -2
- package/lib/components/Tabs/Tabs.js +7 -5
- package/lib/components/Tabs/usePressable.js +1 -1
- package/lib/components/Tag/Tag.js +9 -2
- package/lib/components/Text/Text.js +2 -1
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -6
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +0 -4
- package/lib/components/TextInput/index.d.ts +6 -0
- package/lib/components/TextInput/index.js +1 -7
- package/lib/components/Tile/Tile.js +0 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +34 -39
- package/lib/components/Toggletip/index.js +11 -8
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/TreeView/TreeView.d.ts +1 -1
- package/lib/components/UIShell/Content.d.ts +14 -1
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +2 -99
- package/lib/components/UIShell/HeaderMenu.js +10 -3
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/lib/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/lib/components/UIShell/HeaderMenuItem.js +3 -3
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/lib/components/UIShell/Link.d.ts +8 -8
- package/lib/components/UIShell/Link.js +7 -5
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/components/UIShell/SideNavHeader.js +0 -1
- package/lib/components/UIShell/SideNavLink.d.ts +3 -4
- package/lib/components/UIShell/SideNavLink.js +8 -3
- package/lib/components/UIShell/SideNavMenu.js +0 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +0 -1
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +13 -11
- package/lib/internal/FloatingMenu.js +2 -1
- package/lib/internal/clamp.d.ts +10 -0
- package/lib/internal/clamp.js +17 -0
- package/lib/internal/useEvent.d.ts +9 -0
- package/lib/internal/useEvent.js +8 -49
- package/lib/internal/useId.js +1 -1
- package/lib/internal/useMatchMedia.d.ts +7 -2
- package/lib/internal/useMatchMedia.js +9 -10
- package/lib/internal/useNoInteractiveChildren.js +4 -2
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/isRequiredOneOf.d.ts +16 -0
- package/lib/prop-types/isRequiredOneOf.js +11 -9
- package/lib/tools/setupGetInstanceId.d.ts +12 -0
- package/lib/tools/setupGetInstanceId.js +7 -8
- package/lib/tools/toggleClass.d.ts +14 -0
- package/lib/tools/toggleClass.js +9 -10
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/lib/types/common.d.ts +1 -6
- package/package.json +14 -14
- package/telemetry.yml +11 -12
- package/es/components/MultiSelect/index.js +0 -13
- package/es/internal/ClickListener.d.ts +0 -13
- package/es/internal/ClickListener.js +0 -47
- package/lib/components/MultiSelect/index.js +0 -19
- package/lib/internal/ClickListener.d.ts +0 -13
- package/lib/internal/ClickListener.js +0 -51
|
@@ -28,11 +28,13 @@ declare const Content: {
|
|
|
28
28
|
suppressContentEditableWarning?: boolean | undefined;
|
|
29
29
|
suppressHydrationWarning?: boolean | undefined;
|
|
30
30
|
accessKey?: string | undefined;
|
|
31
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
31
32
|
autoFocus?: boolean | undefined;
|
|
32
33
|
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
33
34
|
contextMenu?: string | undefined;
|
|
34
35
|
dir?: string | undefined;
|
|
35
36
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
37
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
36
38
|
hidden?: boolean | undefined;
|
|
37
39
|
id?: string | undefined;
|
|
38
40
|
lang?: string | undefined;
|
|
@@ -56,7 +58,6 @@ declare const Content: {
|
|
|
56
58
|
rev?: string | undefined;
|
|
57
59
|
typeof?: string | undefined;
|
|
58
60
|
vocab?: string | undefined;
|
|
59
|
-
autoCapitalize?: string | undefined;
|
|
60
61
|
autoCorrect?: string | undefined;
|
|
61
62
|
autoSave?: string | undefined;
|
|
62
63
|
color?: string | undefined;
|
|
@@ -68,6 +69,10 @@ declare const Content: {
|
|
|
68
69
|
results?: number | undefined;
|
|
69
70
|
security?: string | undefined;
|
|
70
71
|
unselectable?: "on" | "off" | undefined;
|
|
72
|
+
popover?: "" | "auto" | "manual" | undefined;
|
|
73
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
74
|
+
popoverTarget?: string | undefined;
|
|
75
|
+
inert?: boolean | undefined;
|
|
71
76
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
72
77
|
is?: string | undefined;
|
|
73
78
|
"aria-activedescendant"?: string | undefined;
|
|
@@ -284,8 +289,16 @@ declare const Content: {
|
|
|
284
289
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
285
290
|
onAnimationIteration?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
286
291
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
292
|
+
onToggle?: React.ToggleEventHandler<HTMLElement> | undefined;
|
|
293
|
+
onBeforeToggle?: React.ToggleEventHandler<HTMLElement> | undefined;
|
|
294
|
+
onTransitionCancel?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
295
|
+
onTransitionCancelCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
287
296
|
onTransitionEnd?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
288
297
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
298
|
+
onTransitionRun?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
299
|
+
onTransitionRunCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
300
|
+
onTransitionStart?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
301
|
+
onTransitionStartCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
289
302
|
}, Element>;
|
|
290
303
|
propTypes: {
|
|
291
304
|
/**
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Generic container for `HeaderGlobalAction` components
|
|
9
9
|
*/
|
|
10
|
-
declare const HeaderGlobalBar: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement
|
|
10
|
+
declare const HeaderGlobalBar: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
|
|
11
11
|
export default HeaderGlobalBar;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { type JSX } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
/**
|
|
10
10
|
* `HeaderMenu` is used to render submenu's in the `Header`. Most often children
|
|
@@ -117,106 +117,9 @@ declare class HeaderMenu extends React.Component<HeaderMenuProps, HeaderMenuStat
|
|
|
117
117
|
* Optionally provide a tabIndex for the underlying menu button
|
|
118
118
|
*/
|
|
119
119
|
tabIndex: PropTypes.Requireable<number>;
|
|
120
|
-
0: string;
|
|
121
|
-
length: 1;
|
|
122
|
-
toString(): string;
|
|
123
|
-
toLocaleString(): string;
|
|
124
|
-
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
125
|
-
pop(): string | undefined;
|
|
126
|
-
push(...items: string[]): number;
|
|
127
|
-
concat(...items: ConcatArray<string>[]): string[];
|
|
128
|
-
concat(...items: (string | ConcatArray<string>)[]): string[];
|
|
129
|
-
join(separator?: string): string;
|
|
130
|
-
reverse(): string[];
|
|
131
|
-
shift(): string | undefined;
|
|
132
|
-
slice(start?: number, end?: number): string[];
|
|
133
|
-
sort(compareFn?: ((a: string, b: string) => number) | undefined): [key: string];
|
|
134
|
-
splice(start: number, deleteCount?: number): string[];
|
|
135
|
-
splice(start: number, deleteCount: number, ...items: string[]): string[];
|
|
136
|
-
unshift(...items: string[]): number;
|
|
137
|
-
indexOf(searchElement: string, fromIndex?: number): number;
|
|
138
|
-
lastIndexOf(searchElement: string, fromIndex?: number): number;
|
|
139
|
-
every<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
|
|
140
|
-
every(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
141
|
-
some(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
142
|
-
forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void;
|
|
143
|
-
map<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[];
|
|
144
|
-
filter<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
|
|
145
|
-
filter(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
|
|
146
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
147
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
148
|
-
reduce<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
149
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
150
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
151
|
-
reduceRight<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
152
|
-
find<S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
|
|
153
|
-
find(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
|
|
154
|
-
findIndex(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): number;
|
|
155
|
-
fill(value: string, start?: number, end?: number): [key: string];
|
|
156
|
-
copyWithin(target: number, start: number, end?: number): [key: string];
|
|
157
|
-
entries(): ArrayIterator<[number, string]>;
|
|
158
|
-
keys(): ArrayIterator<number>;
|
|
159
|
-
values(): ArrayIterator<string>;
|
|
160
|
-
includes(searchElement: string, fromIndex?: number): boolean;
|
|
161
|
-
flatMap<U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
162
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
163
|
-
at(index: number): string | undefined;
|
|
164
|
-
findLast<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
|
|
165
|
-
findLast(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
|
|
166
|
-
findLastIndex(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): number;
|
|
167
|
-
toReversed(): string[];
|
|
168
|
-
toSorted(compareFn?: ((a: string, b: string) => number) | undefined): string[];
|
|
169
|
-
toSpliced(start: number, deleteCount: number, ...items: string[]): string[];
|
|
170
|
-
toSpliced(start: number, deleteCount?: number): string[];
|
|
171
|
-
with(index: number, value: string): string[];
|
|
172
|
-
[Symbol.iterator](): ArrayIterator<string>;
|
|
173
|
-
[Symbol.unscopables]: {
|
|
174
|
-
[x: number]: boolean | undefined;
|
|
175
|
-
length?: boolean | undefined;
|
|
176
|
-
toString?: boolean | undefined;
|
|
177
|
-
toLocaleString?: boolean | undefined;
|
|
178
|
-
pop?: boolean | undefined;
|
|
179
|
-
push?: boolean | undefined;
|
|
180
|
-
concat?: boolean | undefined;
|
|
181
|
-
join?: boolean | undefined;
|
|
182
|
-
reverse?: boolean | undefined;
|
|
183
|
-
shift?: boolean | undefined;
|
|
184
|
-
slice?: boolean | undefined;
|
|
185
|
-
sort?: boolean | undefined;
|
|
186
|
-
splice?: boolean | undefined;
|
|
187
|
-
unshift?: boolean | undefined;
|
|
188
|
-
indexOf?: boolean | undefined;
|
|
189
|
-
lastIndexOf?: boolean | undefined;
|
|
190
|
-
every?: boolean | undefined;
|
|
191
|
-
some?: boolean | undefined;
|
|
192
|
-
forEach?: boolean | undefined;
|
|
193
|
-
map?: boolean | undefined;
|
|
194
|
-
filter?: boolean | undefined;
|
|
195
|
-
reduce?: boolean | undefined;
|
|
196
|
-
reduceRight?: boolean | undefined;
|
|
197
|
-
find?: boolean | undefined;
|
|
198
|
-
findIndex?: boolean | undefined;
|
|
199
|
-
fill?: boolean | undefined;
|
|
200
|
-
copyWithin?: boolean | undefined;
|
|
201
|
-
entries?: boolean | undefined;
|
|
202
|
-
keys?: boolean | undefined;
|
|
203
|
-
values?: boolean | undefined;
|
|
204
|
-
includes?: boolean | undefined;
|
|
205
|
-
flatMap?: boolean | undefined;
|
|
206
|
-
flat?: boolean | undefined;
|
|
207
|
-
at?: boolean | undefined;
|
|
208
|
-
findLast?: boolean | undefined;
|
|
209
|
-
findLastIndex?: boolean | undefined;
|
|
210
|
-
toReversed?: boolean | undefined;
|
|
211
|
-
toSorted?: boolean | undefined;
|
|
212
|
-
toSpliced?: boolean | undefined;
|
|
213
|
-
with?: boolean | undefined;
|
|
214
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
215
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
216
|
-
};
|
|
217
120
|
};
|
|
218
121
|
static contextType: React.Context<string>;
|
|
219
|
-
_subMenus: React.RefObject<HTMLUListElement>;
|
|
122
|
+
_subMenus: React.RefObject<HTMLUListElement | null>;
|
|
220
123
|
private items;
|
|
221
124
|
private menuButtonRef;
|
|
222
125
|
constructor(props: any);
|
|
@@ -167,9 +167,15 @@ class HeaderMenu extends React__default["default"].Component {
|
|
|
167
167
|
onKeyDown,
|
|
168
168
|
...rest
|
|
169
169
|
} = this.props;
|
|
170
|
-
const hasActiveDescendant = childrenArg => React__default["default"].Children.toArray(childrenArg).some(child =>
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
const hasActiveDescendant = childrenArg => React__default["default"].Children.toArray(childrenArg).some(child => {
|
|
171
|
+
if (! /*#__PURE__*/React__default["default"].isValidElement(child)) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Explicitly type the element to access props safely
|
|
176
|
+
const element = child;
|
|
177
|
+
return element.props.isActive || element.props.isCurrentPage || Array.isArray(element.props.children) && hasActiveDescendant(element.props.children);
|
|
178
|
+
});
|
|
173
179
|
const accessibilityLabel = {
|
|
174
180
|
'aria-label': ariaLabel,
|
|
175
181
|
'aria-labelledby': ariaLabelledBy
|
|
@@ -213,6 +219,7 @@ class HeaderMenu extends React__default["default"].Component {
|
|
|
213
219
|
className: `${this.context}--header__menu-arrow`
|
|
214
220
|
})), /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({}, accessibilityLabel, {
|
|
215
221
|
ref: this._subMenus,
|
|
222
|
+
onClick: this.handleOnClick,
|
|
216
223
|
className: `${prefix}--header__menu`
|
|
217
224
|
}), React__default["default"].Children.map(children, this._renderMenuItem)));
|
|
218
225
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { type ComponentProps } from 'react';
|
|
7
|
+
import { type ComponentProps, type JSX } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
type HeaderMenuButtonBaseProps = Omit<ComponentProps<'button'>, 'title' | 'type'>;
|
|
10
10
|
export interface HeaderMenuButtonProps extends HeaderMenuButtonBaseProps {
|
|
@@ -37,103 +37,6 @@ declare namespace HeaderMenuButton {
|
|
|
37
37
|
* button fires it's onclick event
|
|
38
38
|
*/
|
|
39
39
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
-
0: string;
|
|
41
|
-
length: 1;
|
|
42
|
-
toString(): string;
|
|
43
|
-
toLocaleString(): string;
|
|
44
|
-
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
45
|
-
pop(): string | undefined;
|
|
46
|
-
push(...items: string[]): number;
|
|
47
|
-
concat(...items: ConcatArray<string>[]): string[];
|
|
48
|
-
concat(...items: (string | ConcatArray<string>)[]): string[];
|
|
49
|
-
join(separator?: string): string;
|
|
50
|
-
reverse(): string[];
|
|
51
|
-
shift(): string | undefined;
|
|
52
|
-
slice(start?: number, end?: number): string[];
|
|
53
|
-
sort(compareFn?: ((a: string, b: string) => number) | undefined): [key: string];
|
|
54
|
-
splice(start: number, deleteCount?: number): string[];
|
|
55
|
-
splice(start: number, deleteCount: number, ...items: string[]): string[];
|
|
56
|
-
unshift(...items: string[]): number;
|
|
57
|
-
indexOf(searchElement: string, fromIndex?: number): number;
|
|
58
|
-
lastIndexOf(searchElement: string, fromIndex?: number): number;
|
|
59
|
-
every<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
|
|
60
|
-
every(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
61
|
-
some(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
62
|
-
forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void;
|
|
63
|
-
map<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[];
|
|
64
|
-
filter<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
|
|
65
|
-
filter(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
|
|
66
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
67
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
68
|
-
reduce<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
69
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
70
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
71
|
-
reduceRight<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
72
|
-
find<S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
|
|
73
|
-
find(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
|
|
74
|
-
findIndex(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): number;
|
|
75
|
-
fill(value: string, start?: number, end?: number): [key: string];
|
|
76
|
-
copyWithin(target: number, start: number, end?: number): [key: string];
|
|
77
|
-
entries(): ArrayIterator<[number, string]>;
|
|
78
|
-
keys(): ArrayIterator<number>;
|
|
79
|
-
values(): ArrayIterator<string>;
|
|
80
|
-
includes(searchElement: string, fromIndex?: number): boolean;
|
|
81
|
-
flatMap<U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
82
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
83
|
-
at(index: number): string | undefined;
|
|
84
|
-
findLast<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
|
|
85
|
-
findLast(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
|
|
86
|
-
findLastIndex(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): number;
|
|
87
|
-
toReversed(): string[];
|
|
88
|
-
toSorted(compareFn?: ((a: string, b: string) => number) | undefined): string[];
|
|
89
|
-
toSpliced(start: number, deleteCount: number, ...items: string[]): string[];
|
|
90
|
-
toSpliced(start: number, deleteCount?: number): string[];
|
|
91
|
-
with(index: number, value: string): string[];
|
|
92
|
-
[Symbol.iterator](): ArrayIterator<string>;
|
|
93
|
-
[Symbol.unscopables]: {
|
|
94
|
-
[x: number]: boolean | undefined;
|
|
95
|
-
length?: boolean | undefined;
|
|
96
|
-
toString?: boolean | undefined;
|
|
97
|
-
toLocaleString?: boolean | undefined;
|
|
98
|
-
pop?: boolean | undefined;
|
|
99
|
-
push?: boolean | undefined;
|
|
100
|
-
concat?: boolean | undefined;
|
|
101
|
-
join?: boolean | undefined;
|
|
102
|
-
reverse?: boolean | undefined;
|
|
103
|
-
shift?: boolean | undefined;
|
|
104
|
-
slice?: boolean | undefined;
|
|
105
|
-
sort?: boolean | undefined;
|
|
106
|
-
splice?: boolean | undefined;
|
|
107
|
-
unshift?: boolean | undefined;
|
|
108
|
-
indexOf?: boolean | undefined;
|
|
109
|
-
lastIndexOf?: boolean | undefined;
|
|
110
|
-
every?: boolean | undefined;
|
|
111
|
-
some?: boolean | undefined;
|
|
112
|
-
forEach?: boolean | undefined;
|
|
113
|
-
map?: boolean | undefined;
|
|
114
|
-
filter?: boolean | undefined;
|
|
115
|
-
reduce?: boolean | undefined;
|
|
116
|
-
reduceRight?: boolean | undefined;
|
|
117
|
-
find?: boolean | undefined;
|
|
118
|
-
findIndex?: boolean | undefined;
|
|
119
|
-
fill?: boolean | undefined;
|
|
120
|
-
copyWithin?: boolean | undefined;
|
|
121
|
-
entries?: boolean | undefined;
|
|
122
|
-
keys?: boolean | undefined;
|
|
123
|
-
values?: boolean | undefined;
|
|
124
|
-
includes?: boolean | undefined;
|
|
125
|
-
flatMap?: boolean | undefined;
|
|
126
|
-
flat?: boolean | undefined;
|
|
127
|
-
at?: boolean | undefined;
|
|
128
|
-
findLast?: boolean | undefined;
|
|
129
|
-
findLastIndex?: boolean | undefined;
|
|
130
|
-
toReversed?: boolean | undefined;
|
|
131
|
-
toSorted?: boolean | undefined;
|
|
132
|
-
toSpliced?: boolean | undefined;
|
|
133
|
-
with?: boolean | undefined;
|
|
134
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
135
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
136
|
-
};
|
|
137
40
|
};
|
|
138
41
|
}
|
|
139
42
|
export default HeaderMenuButton;
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { WeakValidationMap } from 'prop-types';
|
|
8
|
+
import { type ComponentProps, type ReactNode, ElementType, JSX } from 'react';
|
|
8
9
|
import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
|
|
9
10
|
export interface HeaderMenuItemBaseProps {
|
|
10
11
|
className?: string | undefined;
|
|
@@ -17,9 +18,7 @@ export interface HeaderMenuItemBaseProps {
|
|
|
17
18
|
}
|
|
18
19
|
export type HeaderMenuItemProps<E extends ElementType = 'a'> = PolymorphicComponentPropWithRef<E, HeaderMenuItemBaseProps>;
|
|
19
20
|
export interface HeaderMenuItemComponent {
|
|
20
|
-
<E extends ElementType = 'a'>(props: HeaderMenuItemProps<E>
|
|
21
|
-
ref?: ForwardedRef<ElementType>;
|
|
22
|
-
}): JSX.Element | null;
|
|
21
|
+
<E extends ElementType = 'a'>(props: HeaderMenuItemProps<E>): JSX.Element | null;
|
|
23
22
|
displayName?: string;
|
|
24
23
|
propTypes?: WeakValidationMap<HeaderMenuItemProps<any>>;
|
|
25
24
|
}
|
|
@@ -23,7 +23,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
|
-
const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function
|
|
26
|
+
const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItem(_ref, ref) {
|
|
27
27
|
let {
|
|
28
28
|
className,
|
|
29
29
|
isActive,
|
|
@@ -31,7 +31,7 @@ const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItemRend
|
|
|
31
31
|
'aria-current': ariaCurrent,
|
|
32
32
|
children,
|
|
33
33
|
role,
|
|
34
|
-
tabIndex
|
|
34
|
+
tabIndex,
|
|
35
35
|
...rest
|
|
36
36
|
} = _ref;
|
|
37
37
|
const prefix = usePrefix.usePrefix();
|
|
@@ -47,7 +47,7 @@ const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItemRend
|
|
|
47
47
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
48
48
|
className: className,
|
|
49
49
|
role: role
|
|
50
|
-
}, /*#__PURE__*/React__default["default"].createElement(Link
|
|
50
|
+
}, /*#__PURE__*/React__default["default"].createElement(Link["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
51
51
|
"aria-current": ariaCurrent,
|
|
52
52
|
className: linkClassName,
|
|
53
53
|
ref: ref,
|
|
@@ -31,7 +31,7 @@ function HeaderName(_ref) {
|
|
|
31
31
|
} = _ref;
|
|
32
32
|
const selectorPrefix = usePrefix.usePrefix();
|
|
33
33
|
const className = cx__default["default"](`${selectorPrefix}--header__name`, customClassName);
|
|
34
|
-
return /*#__PURE__*/React__default["default"].createElement(Link
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(Link["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
35
35
|
className: className
|
|
36
36
|
}), prefix && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
37
37
|
className: `${selectorPrefix}--header__name--prefix`
|
|
@@ -19,103 +19,6 @@ declare namespace HeaderNavigation {
|
|
|
19
19
|
* Optionally provide a custom class to apply to the underlying <nav> node
|
|
20
20
|
*/
|
|
21
21
|
className: PropTypes.Requireable<string>;
|
|
22
|
-
0: string;
|
|
23
|
-
length: 1;
|
|
24
|
-
toString(): string;
|
|
25
|
-
toLocaleString(): string;
|
|
26
|
-
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
27
|
-
pop(): string | undefined;
|
|
28
|
-
push(...items: string[]): number;
|
|
29
|
-
concat(...items: ConcatArray<string>[]): string[];
|
|
30
|
-
concat(...items: (string | ConcatArray<string>)[]): string[];
|
|
31
|
-
join(separator?: string): string;
|
|
32
|
-
reverse(): string[];
|
|
33
|
-
shift(): string | undefined;
|
|
34
|
-
slice(start?: number, end?: number): string[];
|
|
35
|
-
sort(compareFn?: ((a: string, b: string) => number) | undefined): [key: string];
|
|
36
|
-
splice(start: number, deleteCount?: number): string[];
|
|
37
|
-
splice(start: number, deleteCount: number, ...items: string[]): string[];
|
|
38
|
-
unshift(...items: string[]): number;
|
|
39
|
-
indexOf(searchElement: string, fromIndex?: number): number;
|
|
40
|
-
lastIndexOf(searchElement: string, fromIndex?: number): number;
|
|
41
|
-
every<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
|
|
42
|
-
every(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
43
|
-
some(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
44
|
-
forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void;
|
|
45
|
-
map<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[];
|
|
46
|
-
filter<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
|
|
47
|
-
filter(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
|
|
48
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
49
|
-
reduce(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
50
|
-
reduce<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
51
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
52
|
-
reduceRight(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
53
|
-
reduceRight<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
54
|
-
find<S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
|
|
55
|
-
find(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
|
|
56
|
-
findIndex(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): number;
|
|
57
|
-
fill(value: string, start?: number, end?: number): [key: string];
|
|
58
|
-
copyWithin(target: number, start: number, end?: number): [key: string];
|
|
59
|
-
entries(): ArrayIterator<[number, string]>;
|
|
60
|
-
keys(): ArrayIterator<number>;
|
|
61
|
-
values(): ArrayIterator<string>;
|
|
62
|
-
includes(searchElement: string, fromIndex?: number): boolean;
|
|
63
|
-
flatMap<U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
64
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
65
|
-
at(index: number): string | undefined;
|
|
66
|
-
findLast<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
|
|
67
|
-
findLast(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
|
|
68
|
-
findLastIndex(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): number;
|
|
69
|
-
toReversed(): string[];
|
|
70
|
-
toSorted(compareFn?: ((a: string, b: string) => number) | undefined): string[];
|
|
71
|
-
toSpliced(start: number, deleteCount: number, ...items: string[]): string[];
|
|
72
|
-
toSpliced(start: number, deleteCount?: number): string[];
|
|
73
|
-
with(index: number, value: string): string[];
|
|
74
|
-
[Symbol.iterator](): ArrayIterator<string>;
|
|
75
|
-
[Symbol.unscopables]: {
|
|
76
|
-
[x: number]: boolean | undefined;
|
|
77
|
-
length?: boolean | undefined;
|
|
78
|
-
toString?: boolean | undefined;
|
|
79
|
-
toLocaleString?: boolean | undefined;
|
|
80
|
-
pop?: boolean | undefined;
|
|
81
|
-
push?: boolean | undefined;
|
|
82
|
-
concat?: boolean | undefined;
|
|
83
|
-
join?: boolean | undefined;
|
|
84
|
-
reverse?: boolean | undefined;
|
|
85
|
-
shift?: boolean | undefined;
|
|
86
|
-
slice?: boolean | undefined;
|
|
87
|
-
sort?: boolean | undefined;
|
|
88
|
-
splice?: boolean | undefined;
|
|
89
|
-
unshift?: boolean | undefined;
|
|
90
|
-
indexOf?: boolean | undefined;
|
|
91
|
-
lastIndexOf?: boolean | undefined;
|
|
92
|
-
every?: boolean | undefined;
|
|
93
|
-
some?: boolean | undefined;
|
|
94
|
-
forEach?: boolean | undefined;
|
|
95
|
-
map?: boolean | undefined;
|
|
96
|
-
filter?: boolean | undefined;
|
|
97
|
-
reduce?: boolean | undefined;
|
|
98
|
-
reduceRight?: boolean | undefined;
|
|
99
|
-
find?: boolean | undefined;
|
|
100
|
-
findIndex?: boolean | undefined;
|
|
101
|
-
fill?: boolean | undefined;
|
|
102
|
-
copyWithin?: boolean | undefined;
|
|
103
|
-
entries?: boolean | undefined;
|
|
104
|
-
keys?: boolean | undefined;
|
|
105
|
-
values?: boolean | undefined;
|
|
106
|
-
includes?: boolean | undefined;
|
|
107
|
-
flatMap?: boolean | undefined;
|
|
108
|
-
flat?: boolean | undefined;
|
|
109
|
-
at?: boolean | undefined;
|
|
110
|
-
findLast?: boolean | undefined;
|
|
111
|
-
findLastIndex?: boolean | undefined;
|
|
112
|
-
toReversed?: boolean | undefined;
|
|
113
|
-
toSorted?: boolean | undefined;
|
|
114
|
-
toSpliced?: boolean | undefined;
|
|
115
|
-
with?: boolean | undefined;
|
|
116
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
117
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
118
|
-
};
|
|
119
22
|
};
|
|
120
23
|
}
|
|
121
24
|
export default HeaderNavigation;
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import
|
|
7
|
+
import PropTypes, { WeakValidationMap } from 'prop-types';
|
|
8
|
+
import { JSX, type ElementType } from 'react';
|
|
9
9
|
import { PolymorphicProps } from '../../types/common';
|
|
10
|
-
import { HeaderMenuItemBaseProps } from './HeaderMenuItem';
|
|
11
10
|
export interface LinkBaseProps {
|
|
12
11
|
/**
|
|
13
12
|
* @deprecated Use `as` instead
|
|
14
13
|
*/
|
|
15
|
-
element?: undefined;
|
|
16
|
-
|
|
14
|
+
element?: ElementType | undefined;
|
|
15
|
+
as?: ElementType | undefined;
|
|
16
|
+
isSideNavExpanded?: boolean | undefined;
|
|
17
17
|
}
|
|
18
|
-
export type LinkProps<E extends
|
|
18
|
+
export type LinkProps<E extends ElementType = 'a'> = PolymorphicProps<E, LinkBaseProps>;
|
|
19
19
|
export interface LinkComponent {
|
|
20
|
-
<E extends ElementType = 'a'>(props: LinkProps<E>
|
|
20
|
+
<E extends ElementType = 'a'>(props: LinkProps<E>): JSX.Element | null;
|
|
21
21
|
displayName?: string;
|
|
22
22
|
propTypes?: WeakValidationMap<LinkProps<any>>;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
declare const Link: LinkComponent;
|
|
25
25
|
/**
|
|
26
26
|
* Link is a custom component that allows us to supporting rendering elements
|
|
27
27
|
* other than `a` in our markup. The goal is to allow users to support passing
|
|
@@ -19,10 +19,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
19
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
21
|
|
|
22
|
-
//
|
|
23
|
-
// standard and is used in other places in this project.
|
|
22
|
+
// First define the component without generics
|
|
24
23
|
|
|
25
|
-
const
|
|
24
|
+
const LinkBase = (_ref, ref) => {
|
|
26
25
|
let {
|
|
27
26
|
element,
|
|
28
27
|
as: BaseComponent,
|
|
@@ -35,7 +34,11 @@ const Link = /*#__PURE__*/React__default["default"].forwardRef(function LinkRend
|
|
|
35
34
|
return /*#__PURE__*/React__default["default"].createElement(BaseComponentAsAny, _rollupPluginBabelHelpers["extends"]({
|
|
36
35
|
ref: ref
|
|
37
36
|
}, rest));
|
|
38
|
-
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Use forwardRef with the non-generic function
|
|
40
|
+
const Link = /*#__PURE__*/React__default["default"].forwardRef(LinkBase);
|
|
41
|
+
|
|
39
42
|
/**
|
|
40
43
|
* Link is a custom component that allows us to supporting rendering elements
|
|
41
44
|
* other than `a` in our markup. The goal is to allow users to support passing
|
|
@@ -65,6 +68,5 @@ const LinkPropTypes = {
|
|
|
65
68
|
Link.displayName = 'Link';
|
|
66
69
|
Link.propTypes = LinkPropTypes;
|
|
67
70
|
|
|
68
|
-
exports.Link = Link;
|
|
69
71
|
exports.LinkPropTypes = LinkPropTypes;
|
|
70
72
|
exports["default"] = Link;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { type
|
|
8
|
-
export interface SideNavProps
|
|
7
|
+
import React, { type FocusEvent, type KeyboardEvent, type MouseEventHandler } from 'react';
|
|
8
|
+
export interface SideNavProps {
|
|
9
9
|
expanded?: boolean | undefined;
|
|
10
10
|
defaultExpanded?: boolean | undefined;
|
|
11
11
|
isChildOfHeader?: boolean | undefined;
|
|
@@ -25,5 +25,5 @@ interface SideNavContextData {
|
|
|
25
25
|
isRail?: boolean | undefined;
|
|
26
26
|
}
|
|
27
27
|
export declare const SideNavContext: React.Context<SideNavContextData>;
|
|
28
|
-
declare const SideNav: React.ForwardRefExoticComponent<Omit<SideNavProps
|
|
28
|
+
declare const SideNav: React.ForwardRefExoticComponent<Omit<SideNavProps & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
29
29
|
export default SideNav;
|
|
@@ -181,7 +181,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
181
181
|
tabIndex: -1,
|
|
182
182
|
ref: navRef,
|
|
183
183
|
className: `${prefix}--side-nav__navigation ${className}`,
|
|
184
|
-
inert: !isRail ? expanded || isLg
|
|
184
|
+
inert: !isRail ? !(expanded || isLg) : undefined
|
|
185
185
|
}, accessibilityLabel, eventHandlers, other), childrenToRender));
|
|
186
186
|
}
|
|
187
187
|
const SideNav = /*#__PURE__*/React__default["default"].forwardRef(SideNavRenderFunction);
|
|
@@ -51,7 +51,6 @@ SideNavHeader.propTypes = {
|
|
|
51
51
|
/**
|
|
52
52
|
* A component used to render an icon.
|
|
53
53
|
*/
|
|
54
|
-
// @ts-expect-error - PropTypes are unable to cover this case.
|
|
55
54
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]).isRequired
|
|
56
55
|
};
|
|
57
56
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { WeakValidationMap } from 'prop-types';
|
|
8
|
+
import { ComponentType, ElementType, JSX, ReactNode } from 'react';
|
|
8
9
|
import { LinkProps } from './Link';
|
|
9
10
|
export type SideNavLinkProps<E extends ElementType> = LinkProps<E> & {
|
|
10
11
|
/**
|
|
@@ -46,9 +47,7 @@ export type SideNavLinkProps<E extends ElementType> = LinkProps<E> & {
|
|
|
46
47
|
tabIndex?: number;
|
|
47
48
|
};
|
|
48
49
|
export interface SideNavLinkComponent {
|
|
49
|
-
<E extends ElementType = 'a'>(props: SideNavLinkProps<E>
|
|
50
|
-
ref?: ForwardedRef<ElementType>;
|
|
51
|
-
}): JSX.Element | null;
|
|
50
|
+
<E extends ElementType = 'a'>(props: SideNavLinkProps<E>): JSX.Element | null;
|
|
52
51
|
displayName?: string;
|
|
53
52
|
propTypes?: WeakValidationMap<SideNavLinkProps<any>>;
|
|
54
53
|
}
|
|
@@ -26,7 +26,9 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
26
26
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
27
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// First define a non-generic base component to work with forwardRef
|
|
30
|
+
|
|
31
|
+
const SideNavLinkBase = (_ref, ref) => {
|
|
30
32
|
let {
|
|
31
33
|
children,
|
|
32
34
|
className: customClassName,
|
|
@@ -46,14 +48,17 @@ const SideNavLink = /*#__PURE__*/React.forwardRef(function SideNavLink(_ref, ref
|
|
|
46
48
|
});
|
|
47
49
|
return /*#__PURE__*/React__default["default"].createElement(SideNavItem["default"], {
|
|
48
50
|
large: large
|
|
49
|
-
}, /*#__PURE__*/React__default["default"].createElement(Link
|
|
51
|
+
}, /*#__PURE__*/React__default["default"].createElement(Link["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
50
52
|
className: className,
|
|
51
53
|
ref: ref,
|
|
52
54
|
tabIndex: tabIndex === undefined ? !isSideNavExpanded && !isRail ? -1 : 0 : tabIndex
|
|
53
55
|
}), IconElement && /*#__PURE__*/React__default["default"].createElement(SideNavIcon["default"], {
|
|
54
56
|
small: true
|
|
55
57
|
}, /*#__PURE__*/React__default["default"].createElement(IconElement, null)), /*#__PURE__*/React__default["default"].createElement(SideNavLinkText["default"], null, children)));
|
|
56
|
-
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Use forwardRef with the non-generic function and cast to the generic component type
|
|
61
|
+
const SideNavLink = /*#__PURE__*/React.forwardRef(SideNavLinkBase);
|
|
57
62
|
SideNavLink.displayName = 'SideNavLink';
|
|
58
63
|
SideNavLink.propTypes = {
|
|
59
64
|
...Link.LinkPropTypes,
|