@digital-ai/dot-components 1.5.0 → 1.5.4
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/CHANGE_LOG.md +74 -37
- package/dot-components.esm.js +790 -739
- package/dot-components.umd.js +774 -723
- package/lib/components/accordion/Accordion.d.ts +2 -2
- package/lib/components/app-toolbar/AppToolbar.d.ts +4 -2
- package/lib/components/breadcrumbs/utils/helpers.d.ts +8 -2
- package/lib/components/breadcrumbs/utils/useBreadcrumbsObserver.d.ts +0 -2
- package/lib/components/breadcrumbs/utils/useBreadcrumbsResizer.d.ts +2 -0
- package/lib/components/helpers.d.ts +1 -0
- package/lib/components/index.d.ts +2 -2
- package/lib/components/list/List.d.ts +3 -86
- package/lib/components/list/List.stories.data.d.ts +1 -1
- package/lib/components/list/List.styles.d.ts +0 -42
- package/lib/components/list/ListItem.styles.d.ts +42 -0
- package/lib/components/list/NestedList.styles.d.ts +2 -0
- package/lib/components/list/index.d.ts +2 -0
- package/lib/components/list/utils/helpers.d.ts +2 -0
- package/lib/components/list/utils/models.d.ts +86 -0
- package/lib/components/menu/Menu.d.ts +5 -0
- package/lib/components/menu/Menu.stories.data.d.ts +23 -0
- package/lib/components/menu/utils/helpers.d.ts +5 -0
- package/lib/components/sidebar/Sidebar.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent,
|
|
1
|
+
import { ChangeEvent, ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export interface AccordionProps extends CommonProps {
|
|
4
4
|
/** actionable components (ex: checkbox, button) that can be nested within the expanded Accordion component */
|
|
@@ -25,6 +25,6 @@ export interface AccordionProps extends CommonProps {
|
|
|
25
25
|
/** Icon placed before the children. */
|
|
26
26
|
startIcon?: ReactNode;
|
|
27
27
|
/** The text within the expanded Accordion */
|
|
28
|
-
summary:
|
|
28
|
+
summary: ReactNode | string;
|
|
29
29
|
}
|
|
30
30
|
export declare const DotAccordion: ({ actions, ariaLabel, children, className, "data-testid": dataTestId, defaultExpanded, disabled, expanded, hasElevation, onChange, square, startIcon, summary, noWrap, }: AccordionProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
import { IconButtonProps } from '../button/IconButton';
|
|
4
|
-
import { ListItemProps } from '../list
|
|
4
|
+
import { ListItemProps } from '../list';
|
|
5
5
|
export interface AppToolbarProps extends CommonProps {
|
|
6
6
|
/** If provided will display application logo */
|
|
7
7
|
appLogo?: ReactNode;
|
|
@@ -27,5 +27,7 @@ export interface AppToolbarProps extends CommonProps {
|
|
|
27
27
|
mainMenuWidth?: number;
|
|
28
28
|
/** Array of nav items to be displayed on the right side */
|
|
29
29
|
navItems?: Array<IconButtonProps>;
|
|
30
|
+
/** URL of the page the primary logo link will go to */
|
|
31
|
+
primaryLogoHref?: string;
|
|
30
32
|
}
|
|
31
|
-
export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, }: AppToolbarProps) => JSX.Element;
|
|
33
|
+
export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
1
|
+
import React, { MutableRefObject, ReactElement } from 'react';
|
|
2
2
|
import { BreadcrumbItem } from '../Breadcrumbs';
|
|
3
3
|
export interface BreadcrumbItemRefs {
|
|
4
4
|
firstItemRef: MutableRefObject<HTMLDivElement>;
|
|
5
5
|
lastItemRef: MutableRefObject<HTMLSpanElement>;
|
|
6
6
|
}
|
|
7
|
+
export interface BreadcrumbItemsConfig {
|
|
8
|
+
isLastItemFullyVisible: boolean;
|
|
9
|
+
itemsAfterCollapse: number;
|
|
10
|
+
}
|
|
7
11
|
export declare const getItemsAfterCollapse: (adjustMaxItems: boolean, visibleItemsNumber: number, maxItems?: number) => number | undefined;
|
|
8
12
|
export declare const getMaxItems: (adjustMaxItems: boolean, visibleItemsNumber: number, maxItems?: number) => number | undefined;
|
|
9
13
|
export declare const getWidthFromRef: <T extends HTMLElement>(ref: React.MutableRefObject<T>) => number | undefined;
|
|
@@ -16,4 +20,6 @@ export declare const getMenuItems: (items: BreadcrumbItem[], itemsAfterCollapse:
|
|
|
16
20
|
}[];
|
|
17
21
|
export declare const addListenersToMenu: (expandElement: Element, eventListener: EventListener) => void;
|
|
18
22
|
export declare const removeListenersFromMenu: (expandElement: Element, eventListener: EventListener) => void;
|
|
19
|
-
export declare const
|
|
23
|
+
export declare const getLastItemElement: ({ ariaLabel, text }: BreadcrumbItem, lastItemRef: MutableRefObject<HTMLSpanElement>, index?: number) => ReactElement;
|
|
24
|
+
export declare const mapBreadcrumbItems: (items: BreadcrumbItem[], refs: BreadcrumbItemRefs, { isLastItemFullyVisible, itemsAfterCollapse }: BreadcrumbItemsConfig) => JSX.Element[];
|
|
25
|
+
export declare const checkIfLastItemFullyVisible: (breadcrumbRef: MutableRefObject<HTMLElement>, lastItemRef: MutableRefObject<HTMLSpanElement>) => boolean;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
import { BreadcrumbItem } from '../Breadcrumbs';
|
|
3
|
-
export declare const MIN_AVAILABLE_SPACE = 60;
|
|
4
|
-
export declare const ITEMS_SEPARATOR_SPACE = 20;
|
|
5
3
|
interface BreadcrumbsObserverRefs {
|
|
6
4
|
breadcrumbRef: MutableRefObject<HTMLElement>;
|
|
7
5
|
firstItemRef: MutableRefObject<HTMLDivElement>;
|
|
@@ -12,5 +12,7 @@ interface BreadcrumbItemsProps {
|
|
|
12
12
|
items: Array<BreadcrumbItem>;
|
|
13
13
|
maxItems?: number;
|
|
14
14
|
}
|
|
15
|
+
export declare const MIN_AVAILABLE_SPACE = 60;
|
|
16
|
+
export declare const ITEMS_SEPARATOR_SPACE = 20;
|
|
15
17
|
export declare const useBreadcrumbsResizer: (breadcrumbsRightCoord: number, breadcrumbItemsProps: BreadcrumbItemsProps, refs: BreadcrumbsResizerRefs) => [MaxVisibleItems];
|
|
16
18
|
export {};
|
|
@@ -12,7 +12,7 @@ export type { IconButtonProps } from './button/IconButton';
|
|
|
12
12
|
export type { InputTextProps } from './input-form-fields/InputText';
|
|
13
13
|
export type { InputSelectProps } from './input-form-fields/InputSelect';
|
|
14
14
|
export type { LinkUnderline } from './link/Link';
|
|
15
|
-
export type { ListItemProps } from './list
|
|
15
|
+
export type { ListItemProps } from './list';
|
|
16
16
|
export type { MenuItemProps } from './menu/Menu';
|
|
17
17
|
export type { RailItem } from './navigation-rail/NavigationRail';
|
|
18
18
|
export type { RadioButtonProps } from './radio/RadioButton';
|
|
@@ -62,7 +62,7 @@ export { DotInlineEdit } from './inline-edit/InlineEdit';
|
|
|
62
62
|
export { DotInputText } from './input-form-fields/InputText';
|
|
63
63
|
export { DotInputSelect } from './input-form-fields/InputSelect';
|
|
64
64
|
export { DotLink } from './link/Link';
|
|
65
|
-
export { DotList } from './list
|
|
65
|
+
export { DotList } from './list';
|
|
66
66
|
export { DotMenu } from './menu/Menu';
|
|
67
67
|
export { DotNavigationRail } from './navigation-rail/NavigationRail';
|
|
68
68
|
export { DotPill } from './pill/Pill';
|
|
@@ -1,88 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { LinkTarget } from '../link/Link';
|
|
4
|
-
import { PopperPlacement } from '../menu/Menu';
|
|
5
|
-
export declare type NestedListType = 'drawer' | 'expandable' | 'menu';
|
|
6
|
-
export interface NestedListProps extends CommonProps {
|
|
7
|
-
/** Element that menu is attached to */
|
|
8
|
-
anchorEl?: Element;
|
|
9
|
-
/** Array of list items displayed */
|
|
10
|
-
items: Array<ListItemProps>;
|
|
11
|
-
/** If nested list type is 'menu', determines the placement of the menu */
|
|
12
|
-
menuPlacement?: PopperPlacement;
|
|
13
|
-
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
14
|
-
nestedDrawerLeftSpacing?: number;
|
|
15
|
-
/** Event callback when leaving menu via tab or clicking away */
|
|
16
|
-
onMenuLeave?: (event: KeyboardEvent | MouseEvent) => void;
|
|
17
|
-
/** if true the nested list is visible */
|
|
18
|
-
open: boolean;
|
|
19
|
-
/** Index of the parent list item */
|
|
20
|
-
parentItemIndex?: number;
|
|
21
|
-
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
22
|
-
type?: NestedListType;
|
|
23
|
-
}
|
|
24
|
-
export interface ListProps extends CommonProps {
|
|
25
|
-
/** string or JSX element that is displayed inside the list */
|
|
26
|
-
children?: ReactNode;
|
|
27
|
-
/** The component used for the root node. Either a string to use a HTML element or a component. */
|
|
28
|
-
component?: ElementType;
|
|
29
|
-
/** If true, compact vertical padding designed for keyboard and mouse input will be used for the list and list items. */
|
|
30
|
-
dense?: boolean;
|
|
31
|
-
/** If true, vertical padding will be removed from the list. */
|
|
32
|
-
disablePadding?: boolean;
|
|
33
|
-
/** Array of list items displayed */
|
|
34
|
-
items?: Array<ListItemProps>;
|
|
35
|
-
/** If nested list type is 'menu', determines the placement of the menu */
|
|
36
|
-
menuPlacement?: PopperPlacement;
|
|
37
|
-
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
38
|
-
nestedDrawerLeftSpacing?: number;
|
|
39
|
-
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
40
|
-
nestedListType?: NestedListType;
|
|
41
|
-
/** Width of list, defaults to 240px */
|
|
42
|
-
width?: number | string;
|
|
43
|
-
}
|
|
44
|
-
export interface ListItemProps extends CommonProps {
|
|
45
|
-
/** string or JSX element that is displayed inside the list */
|
|
46
|
-
child?: ReactNode;
|
|
47
|
-
/** The component used for the root node. Either a string to use a HTML element or a component. */
|
|
48
|
-
component?: ElementType;
|
|
49
|
-
/** If true, a 1px light border is added to the bottom of the list item. */
|
|
50
|
-
divider?: boolean;
|
|
51
|
-
/** If provided, the icon ID which is displayed at the end of the list item */
|
|
52
|
-
endIconId?: string;
|
|
53
|
-
/** If provided, the list item will be rendered as a link */
|
|
54
|
-
href?: string;
|
|
55
|
-
/** DEPRECATED, DO NOT USE */
|
|
56
|
-
index?: number;
|
|
57
|
-
isOpened?: boolean;
|
|
58
|
-
/** If provided, the menu item will display a nested list */
|
|
59
|
-
items?: Array<ListItemProps>;
|
|
60
|
-
/** If nested list type is 'menu', determines the placement of the menu */
|
|
61
|
-
menuPlacement?: PopperPlacement;
|
|
62
|
-
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
63
|
-
nestedDrawerLeftSpacing?: number;
|
|
64
|
-
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
65
|
-
nestedListType?: NestedListType;
|
|
66
|
-
/** Event callback */
|
|
67
|
-
onClick?: (event: MouseEvent) => void;
|
|
68
|
-
/** Menu leave event callback */
|
|
69
|
-
onMenuLeave?: () => void;
|
|
70
|
-
/** The main content element */
|
|
71
|
-
primaryText?: string;
|
|
72
|
-
/** The secondary content element */
|
|
73
|
-
secondaryText?: string;
|
|
74
|
-
/** Selected list item */
|
|
75
|
-
selected?: boolean;
|
|
76
|
-
/** If provided, the icon ID which is displayed on the front of the list item */
|
|
77
|
-
startIconId?: string;
|
|
78
|
-
/** where to open the link */
|
|
79
|
-
target?: LinkTarget;
|
|
80
|
-
/** Text which is displayed in the list item */
|
|
81
|
-
text?: string;
|
|
82
|
-
/** DEPRECATED, DO NOT USE */
|
|
83
|
-
title?: string;
|
|
84
|
-
/** Tooltip text displayed on hover */
|
|
85
|
-
tooltip?: string;
|
|
86
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ListItemProps, ListProps, NestedListProps } from './utils/models';
|
|
87
3
|
export declare const DotList: ({ ariaLabel, children, className, component, "data-testid": dataTestId, dense, disablePadding, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, width, }: ListProps) => JSX.Element;
|
|
88
4
|
export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIconId, target, text, title, tooltip, }: ListItemProps) => JSX.Element;
|
|
5
|
+
export declare const NestedList: ({ ariaLabel, anchorEl, items, menuPlacement, nestedDrawerLeftSpacing, onMenuLeave, open, parentItemIndex, type, }: NestedListProps) => JSX.Element;
|
|
@@ -1,47 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const rootClassName = "dot-list";
|
|
3
2
|
export declare const listItemRootClass = "dot-list-item";
|
|
4
3
|
export declare const nestedListClassName = "dot-nested-list";
|
|
5
4
|
export declare const nestedDrawerClassName = "dot-nested-drawer";
|
|
6
|
-
export declare const flyoutListItemClassName = "dot-flyout-list-item";
|
|
7
|
-
export declare const flyoutItemLinkClassName = "dot-flyout-item-link";
|
|
8
|
-
export declare const listItemLinkClassName = "dot-list-item-link";
|
|
9
5
|
export declare const StyledList: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ListTypeMap<{}, "ul">>;
|
|
10
|
-
export declare const StyledListItem: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ListItemTypeMap<{
|
|
11
|
-
button?: false;
|
|
12
|
-
}, "li">> & ((props: {
|
|
13
|
-
href: string;
|
|
14
|
-
} & {
|
|
15
|
-
button: true;
|
|
16
|
-
} & {
|
|
17
|
-
alignItems?: "center" | "flex-start";
|
|
18
|
-
autoFocus?: boolean;
|
|
19
|
-
button?: boolean;
|
|
20
|
-
ContainerComponent?: import("react").ElementType<import("react").HTMLAttributes<HTMLDivElement>>;
|
|
21
|
-
ContainerProps?: import("react").HTMLAttributes<HTMLDivElement>;
|
|
22
|
-
dense?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
disableGutters?: boolean;
|
|
25
|
-
divider?: boolean;
|
|
26
|
-
focusVisibleClassName?: string;
|
|
27
|
-
selected?: boolean;
|
|
28
|
-
} & {
|
|
29
|
-
action?: import("react").Ref<import("@material-ui/core").ButtonBaseActions>;
|
|
30
|
-
buttonRef?: import("react").Ref<unknown>;
|
|
31
|
-
centerRipple?: boolean;
|
|
32
|
-
children?: import("react").ReactNode;
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
disableRipple?: boolean;
|
|
35
|
-
disableTouchRipple?: boolean;
|
|
36
|
-
focusRipple?: boolean;
|
|
37
|
-
focusVisibleClassName?: string;
|
|
38
|
-
onFocusVisible?: import("react").FocusEventHandler<any>;
|
|
39
|
-
tabIndex?: string | number;
|
|
40
|
-
TouchRippleProps?: Partial<import("@material-ui/core/ButtonBase/TouchRipple").TouchRippleProps>;
|
|
41
|
-
} & import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
|
|
42
|
-
button: true;
|
|
43
|
-
}, "div">>> & Pick<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
44
|
-
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
45
|
-
}, "slot" | "title" | "type" | "ref" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy">) => JSX.Element) & import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
|
|
46
|
-
button: true;
|
|
47
|
-
}, "div">>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const flyoutListItemClassName = "dot-flyout-list-item";
|
|
3
|
+
export declare const flyoutItemLinkClassName = "dot-flyout-item-link";
|
|
4
|
+
export declare const listItemLinkClassName = "dot-list-item-link";
|
|
5
|
+
export declare const StyledListItem: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ListItemTypeMap<{
|
|
6
|
+
button?: false;
|
|
7
|
+
}, "li">> & ((props: {
|
|
8
|
+
href: string;
|
|
9
|
+
} & {
|
|
10
|
+
button: true;
|
|
11
|
+
} & {
|
|
12
|
+
alignItems?: "center" | "flex-start";
|
|
13
|
+
autoFocus?: boolean;
|
|
14
|
+
button?: boolean;
|
|
15
|
+
ContainerComponent?: import("react").ElementType<import("react").HTMLAttributes<HTMLDivElement>>;
|
|
16
|
+
ContainerProps?: import("react").HTMLAttributes<HTMLDivElement>;
|
|
17
|
+
dense?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
disableGutters?: boolean;
|
|
20
|
+
divider?: boolean;
|
|
21
|
+
focusVisibleClassName?: string;
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
} & {
|
|
24
|
+
action?: import("react").Ref<import("@material-ui/core").ButtonBaseActions>;
|
|
25
|
+
buttonRef?: import("react").Ref<unknown>;
|
|
26
|
+
centerRipple?: boolean;
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
disableRipple?: boolean;
|
|
30
|
+
disableTouchRipple?: boolean;
|
|
31
|
+
focusRipple?: boolean;
|
|
32
|
+
focusVisibleClassName?: string;
|
|
33
|
+
onFocusVisible?: import("react").FocusEventHandler<any>;
|
|
34
|
+
tabIndex?: string | number;
|
|
35
|
+
TouchRippleProps?: Partial<import("@material-ui/core/ButtonBase/TouchRipple").TouchRippleProps>;
|
|
36
|
+
} & import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
|
|
37
|
+
button: true;
|
|
38
|
+
}, "div">>> & Pick<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
39
|
+
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
40
|
+
}, "slot" | "title" | "type" | "ref" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy">) => JSX.Element) & import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
|
|
41
|
+
button: true;
|
|
42
|
+
}, "div">>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledDotDrawer: import("styled-components").StyledComponent<({ anchor, ariaLabel, className, children, "data-testid": dataTestId, height, ModalProps, onClose, open, PaperProps, variant, width, }: import("../drawer/Drawer").DrawerProps) => JSX.Element, any, {}, never>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ElementType, KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '../../CommonProps';
|
|
3
|
+
import { PopperPlacement } from '../../menu/Menu';
|
|
4
|
+
import { LinkTarget } from '../../link/Link';
|
|
5
|
+
export declare type NestedListType = 'drawer' | 'expandable' | 'menu';
|
|
6
|
+
export interface ListProps extends CommonProps {
|
|
7
|
+
/** string or JSX element that is displayed inside the list */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** The component used for the root node. Either a string to use a HTML element or a component. */
|
|
10
|
+
component?: ElementType;
|
|
11
|
+
/** If true, compact vertical padding designed for keyboard and mouse input will be used for the list and list items. */
|
|
12
|
+
dense?: boolean;
|
|
13
|
+
/** If true, vertical padding will be removed from the list. */
|
|
14
|
+
disablePadding?: boolean;
|
|
15
|
+
/** Array of list items displayed */
|
|
16
|
+
items?: Array<ListItemProps>;
|
|
17
|
+
/** If nested list type is 'menu', determines the placement of the menu */
|
|
18
|
+
menuPlacement?: PopperPlacement;
|
|
19
|
+
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
20
|
+
nestedDrawerLeftSpacing?: number;
|
|
21
|
+
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
22
|
+
nestedListType?: NestedListType;
|
|
23
|
+
/** Width of list, defaults to 240px */
|
|
24
|
+
width?: number | string;
|
|
25
|
+
}
|
|
26
|
+
export interface ListItemProps extends CommonProps {
|
|
27
|
+
/** string or JSX element that is displayed inside the list */
|
|
28
|
+
child?: ReactNode;
|
|
29
|
+
/** The component used for the root node. Either a string to use a HTML element or a component. */
|
|
30
|
+
component?: ElementType;
|
|
31
|
+
/** If true, a 1px light border is added to the bottom of the list item. */
|
|
32
|
+
divider?: boolean;
|
|
33
|
+
/** If provided, the icon ID which is displayed at the end of the list item */
|
|
34
|
+
endIconId?: string;
|
|
35
|
+
/** If provided, the list item will be rendered as a link */
|
|
36
|
+
href?: string;
|
|
37
|
+
/** DEPRECATED, DO NOT USE */
|
|
38
|
+
index?: number;
|
|
39
|
+
isOpened?: boolean;
|
|
40
|
+
/** If provided, the menu item will display a nested list */
|
|
41
|
+
items?: Array<ListItemProps>;
|
|
42
|
+
/** If nested list type is 'menu', determines the placement of the menu */
|
|
43
|
+
menuPlacement?: PopperPlacement;
|
|
44
|
+
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
45
|
+
nestedDrawerLeftSpacing?: number;
|
|
46
|
+
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
47
|
+
nestedListType?: NestedListType;
|
|
48
|
+
/** Event callback */
|
|
49
|
+
onClick?: (event: MouseEvent) => void;
|
|
50
|
+
/** Menu leave event callback */
|
|
51
|
+
onMenuLeave?: () => void;
|
|
52
|
+
/** The main content element */
|
|
53
|
+
primaryText?: string;
|
|
54
|
+
/** The secondary content element */
|
|
55
|
+
secondaryText?: string;
|
|
56
|
+
/** Selected list item */
|
|
57
|
+
selected?: boolean;
|
|
58
|
+
/** If provided, the icon ID which is displayed on the front of the list item */
|
|
59
|
+
startIconId?: string;
|
|
60
|
+
/** where to open the link */
|
|
61
|
+
target?: LinkTarget;
|
|
62
|
+
/** Text which is displayed in the list item */
|
|
63
|
+
text?: string;
|
|
64
|
+
/** DEPRECATED, DO NOT USE */
|
|
65
|
+
title?: string;
|
|
66
|
+
/** Tooltip text displayed on hover */
|
|
67
|
+
tooltip?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface NestedListProps extends CommonProps {
|
|
70
|
+
/** Element that menu is attached to */
|
|
71
|
+
anchorEl?: Element;
|
|
72
|
+
/** Array of list items displayed */
|
|
73
|
+
items: Array<ListItemProps>;
|
|
74
|
+
/** If nested list type is 'menu', determines the placement of the menu */
|
|
75
|
+
menuPlacement?: PopperPlacement;
|
|
76
|
+
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
77
|
+
nestedDrawerLeftSpacing?: number;
|
|
78
|
+
/** Event callback when leaving menu via tab or clicking away */
|
|
79
|
+
onMenuLeave?: (event: KeyboardEvent | MouseEvent) => void;
|
|
80
|
+
/** if true the nested list is visible */
|
|
81
|
+
open: boolean;
|
|
82
|
+
/** Index of the parent list item */
|
|
83
|
+
parentItemIndex?: number;
|
|
84
|
+
/** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
|
|
85
|
+
type?: NestedListType;
|
|
86
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
+
export declare const MENU_ITEM_HEIGHT_NORMAL = 33;
|
|
4
|
+
export declare const MENU_ITEM_HEIGHT_DENSE = 28;
|
|
5
|
+
export declare const DEFAULT_MAX_VISIBLE_ITEMS = 7;
|
|
3
6
|
export declare type PopperPlacement = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
4
7
|
export interface MenuProps extends CommonProps {
|
|
5
8
|
/** Element that menu is attached to */
|
|
@@ -34,6 +37,8 @@ export interface MenuItemProps {
|
|
|
34
37
|
children?: ReactNode;
|
|
35
38
|
/** Space delimited CSS classes to be attributed to the menu item */
|
|
36
39
|
classes?: string;
|
|
40
|
+
/** Used to set custom item height (in pixels). This value has priority over "menuItemHeight" prop. */
|
|
41
|
+
height?: number;
|
|
37
42
|
/** A key that can be used to determine which item was clicked */
|
|
38
43
|
key?: string;
|
|
39
44
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuItemProps } from '../menu/Menu';
|
|
3
|
+
export declare const defaultMenuItems: ({
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
classes: string;
|
|
6
|
+
key: string;
|
|
7
|
+
} | {
|
|
8
|
+
children: string;
|
|
9
|
+
key: string;
|
|
10
|
+
classes?: undefined;
|
|
11
|
+
})[];
|
|
12
|
+
export declare const buttonMenuItems: {
|
|
13
|
+
children: string;
|
|
14
|
+
key: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const tableMenuItems: ({
|
|
17
|
+
children: string;
|
|
18
|
+
key: string;
|
|
19
|
+
} | {
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
key: string;
|
|
22
|
+
})[];
|
|
23
|
+
export declare const customHeightMenuItems: MenuItemProps[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MenuItemProps } from '../Menu';
|
|
2
|
+
export declare const getDefaultItemHeight: (isDense: boolean) => 28 | 33;
|
|
3
|
+
export declare const calculateItemHeight: (isDense: boolean, customItemHeight?: number, menuItemHeight?: number | string) => number | string;
|
|
4
|
+
export declare const getNumberOfVisibleItems: (numberOfItems: number, maxVisibleItems?: number) => number;
|
|
5
|
+
export declare const calculateMaxHeight: (isDense: boolean, menuItems: MenuItemProps[], menuItemHeight?: number | string) => number | string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { AvatarProps } from '../avatar/Avatar';
|
|
3
|
-
import { ListItemProps, NestedListType } from '../list
|
|
3
|
+
import { ListItemProps, NestedListType } from '../list';
|
|
4
4
|
import { CommonProps } from '../CommonProps';
|
|
5
5
|
export interface BackItemProps extends CommonProps {
|
|
6
6
|
/** If provided, the icon ID which is displayed on the front of the list item */
|