@digital-ai/dot-components 1.18.0 → 1.20.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.
@@ -9,9 +9,11 @@ export interface AlertBannerProps extends CommonProps {
9
9
  children: ReactNode | string;
10
10
  /** callback which is triggered when alert banner is closed */
11
11
  onClose?: (event: MouseEvent) => void;
12
+ /** If true, the alert banner will have rounded corners */
13
+ roundedCorners?: boolean;
12
14
  /** will determine color and icon being used */
13
15
  severity: AlertBannerSeverity;
14
16
  /** when specified, will control the text that is used inside the alert banner */
15
17
  textVariant?: TypographyVariant;
16
18
  }
17
- export declare const DotAlertBanner: ({ action, ariaLabel, children, className, "data-testid": dataTestId, onClose, severity, textVariant, }: AlertBannerProps) => JSX.Element;
19
+ export declare const DotAlertBanner: ({ action, ariaLabel, children, className, "data-testid": dataTestId, onClose, roundedCorners, severity, textVariant, }: AlertBannerProps) => JSX.Element;
@@ -15,6 +15,8 @@ export interface AppToolbarIconButtons extends IconButtonProps {
15
15
  export interface AppToolbarProps extends CommonProps {
16
16
  /** If provided will display application logo */
17
17
  appLogo?: ReactNode;
18
+ /** URL of the page the application logo link will go to */
19
+ appLogoHref?: string;
18
20
  /** If provided will display application logo */
19
21
  appLogoSmall?: ReactNode;
20
22
  /** DEPRECATED, DO NOT USE */
@@ -42,4 +44,4 @@ export interface AppToolbarProps extends CommonProps {
42
44
  /** URL of the page the primary logo link will go to */
43
45
  primaryLogoHref?: string;
44
46
  }
45
- export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, closeMenuOnItemClick, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
47
+ export declare const DotAppToolbar: ({ appName, appLogo, appLogoHref, appLogoSmall, ariaLabel, avatar, borderColor, children, className, closeMenuOnItemClick, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
@@ -37,17 +37,25 @@ export interface InputProps extends CommonProps {
37
37
  onKeyDown?: (event: KeyboardEvent) => void;
38
38
  /** A function that executes when a user releases a mouse button over an element. */
39
39
  onMouseUp?: (event: MouseEvent) => void;
40
+ /** If true, the label will be persistently displayed outside of the field */
41
+ persistentLabel?: boolean;
40
42
  /** If true, the label is displayed as required and the input element` will be required. */
41
43
  required?: boolean;
44
+ /** If specified, the label being shrunk/unshrunk must be controlled by the consumer */
45
+ shrink?: boolean;
42
46
  /** Size of the input */
43
47
  size?: inputSizeOptions;
44
48
  /** Icon placed before the children. */
45
49
  startIcon?: ReactNode;
50
+ /** If true, the label and field will be displayed in a success state */
51
+ success?: boolean;
46
52
  /**
47
53
  * Type of input should be a valid HTML 5 input type
48
54
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
49
55
  */
50
56
  type?: string;
57
+ /** value of input field */
58
+ value?: string;
51
59
  /** If true, the label will be displayed in an warning state. */
52
60
  warning?: boolean;
53
61
  }
@@ -1,7 +1,10 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { TextField, InputLabel } from '@material-ui/core';
2
2
  export declare const rootClassName = "dot-text-field";
3
3
  export declare const rootSelectClassName = "dot-select-field";
4
+ export declare const labelClassName = "dot-input-label";
4
5
  export declare const warningClassName = "dot-warning";
6
+ export declare const successClassName = "dot-success";
5
7
  export declare const adornmentIconClassName = "dot-adornment-icon";
6
8
  export declare const StyledAdornment: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").InputAdornmentTypeMap<{}, "div">>, any, {}, never>;
9
+ export declare const StyledInputLabel: import("styled-components").StyledComponent<typeof InputLabel, any, {}, never>;
7
10
  export declare const StyledTextField: import("styled-components").StyledComponent<typeof TextField, any, {}, never>;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export interface InputLabelProps {
3
+ /** If true, the input will be disabled. */
4
+ disabled?: boolean;
5
+ /** If true, the label will be displayed in an error state. */
6
+ error?: boolean;
7
+ /**
8
+ * id to identify the element, also used to create label "for" and helper text id attribute
9
+ * values while it's optional, it is considered required for accessiblity best practice.
10
+ */
11
+ id: string;
12
+ /** The label content. */
13
+ label?: string;
14
+ /** If true, the label is displayed as required and the input element` will be required. */
15
+ required?: boolean;
16
+ }
17
+ export declare const DotInputLabel: ({ disabled, error, id, label, required, }: InputLabelProps) => JSX.Element;
@@ -12,7 +12,5 @@ export interface InputSelectProps extends InputProps {
12
12
  defaultValue?: string;
13
13
  /** options of select dropdown */
14
14
  options: Array<OptionType>;
15
- /** value of input field */
16
- value?: string;
17
15
  }
18
- export declare const DotInputSelect: ({ ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, endIcon, error, fullWidth, helperText, id, inputRef, label, name, onBlur, onChange, onFocus, onKeyDown, options, required, size, startIcon, value, warning, }: InputSelectProps) => JSX.Element;
16
+ export declare const DotInputSelect: ({ ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, endIcon, error, fullWidth, helperText, id, inputRef, label, name, onBlur, onChange, onFocus, onKeyDown, options, persistentLabel, required, shrink, size, startIcon, success, value, warning, }: InputSelectProps) => JSX.Element;
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { InputProps } from './InputFormFields.propTypes';
3
3
  export declare const DELAY_MS = 300;
4
+ export declare type endAdornmentIconType = 'warning' | 'error' | 'check';
4
5
  export interface InputTextProps extends InputProps {
5
6
  /** The HTML autocomplete property to pass along to the input tag. Used for
6
7
  controlling autofill behavior in forms. This property follows this HTML spec:
@@ -20,7 +21,13 @@ export interface InputTextProps extends InputProps {
20
21
  rows?: number;
21
22
  /** max of rows for multiline line */
22
23
  rowsMax?: number;
23
- /** value of the InputText */
24
- value?: string;
25
24
  }
26
- export declare const DotInputText: ({ autoComplete, autoFocus, className, defaultValue, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, helperText, endIcon, id, inputRef, label, multiline, name, onBlur, onChange, onFocus, onKeyDown, onMouseUp, placeholder, readOnly, required, rows, rowsMax, startIcon, size, type, value, warning, }: InputTextProps) => JSX.Element;
25
+ export interface EndIconProps {
26
+ dataTestId?: string;
27
+ endAdornmentTooltip?: string;
28
+ endIcon?: ReactNode;
29
+ error?: boolean;
30
+ success?: boolean;
31
+ warning?: boolean;
32
+ }
33
+ export declare const DotInputText: ({ autoComplete, autoFocus, className, defaultValue, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, helperText, endIcon, id, inputRef, label, multiline, name, onBlur, onChange, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, rows, rowsMax, shrink, startIcon, size, success, type, value, warning, }: InputTextProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ListItemProps, ListProps, NestedListProps } from './utils/models';
3
3
  export declare const DotList: ({ ariaLabel, children, className, component, "data-testid": dataTestId, dense, disablePadding, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, width, }: ListProps) => JSX.Element;
4
- export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIcon, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, startIconId, target, text, title, tooltip, }: ListItemProps) => JSX.Element;
4
+ export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIcon, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, startIconId, target, text, title, tooltip, tooltipPlacement, }: ListItemProps) => JSX.Element;
5
5
  export declare const NestedList: ({ ariaLabel, anchorEl, "data-testid": dataTestId, items, menuPlacement, nestedDrawerLeftSpacing, onMenuLeave, open, parentItemIndex, type, }: NestedListProps) => JSX.Element;
@@ -2,6 +2,7 @@ import { ElementType, KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from '../../CommonProps';
3
3
  import { PopperPlacement } from '../../menu/Menu';
4
4
  import { LinkTarget } from '../../link/Link';
5
+ import { tooltipPlacement } from '../../tooltip/Tooltip';
5
6
  export declare type NestedListType = 'drawer' | 'expandable' | 'menu';
6
7
  export interface ListProps extends CommonProps {
7
8
  /** string or JSX element that is displayed inside the list */
@@ -69,6 +70,8 @@ export interface ListItemProps extends CommonProps {
69
70
  title?: string;
70
71
  /** Tooltip text displayed on hover */
71
72
  tooltip?: string;
73
+ /** Tooltip placement displayed on hover */
74
+ tooltipPlacement?: tooltipPlacement;
72
75
  }
73
76
  export interface NestedListProps extends CommonProps {
74
77
  /** Element that menu is attached to */
@@ -1,9 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { CommonProps } from '../CommonProps';
3
+ import { BadgeProps } from '../badge';
3
4
  export declare type RailItemsPosition = 'flex-start' | 'center' | 'flex-end';
5
+ export declare type RailIconBadge = Omit<BadgeProps, 'children'>;
4
6
  export interface RailItem {
5
7
  /** Defines a string value that labels the current element **/
6
8
  ariaLabel?: string;
9
+ /** Optional badge which will be displayed over an icon **/
10
+ iconBadge?: RailIconBadge;
7
11
  /** Id of the icon shown in the rail item */
8
12
  iconId: string;
9
13
  /** text displayed or title text if icon used */
@@ -0,0 +1,9 @@
1
+ import { RailItem } from './NavigationRail';
2
+ export interface BadgeCount {
3
+ activity: number;
4
+ conditions: number;
5
+ properties: number;
6
+ scheduling: number;
7
+ }
8
+ export declare const mockRailItems: Array<RailItem>;
9
+ export declare const getBadgeRailItems: ({ activity, conditions, properties, scheduling, }: BadgeCount) => RailItem[];
@@ -1,2 +1,4 @@
1
1
  export declare const programmaticNavigationClassName = "dot-programmatic-navigation-story";
2
+ export declare const withBadgesClassName = "dot-with-badges-story";
2
3
  export declare const StyledWithProgrammaticNavigation: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const StyledWithBadges: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,16 +1,16 @@
1
- import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
1
+ /// <reference types="react" />
2
2
  import { MenuItemProps } from '../menu/Menu';
3
3
  import { BaseButtonProps } from '../BaseButtonProps';
4
4
  export interface SplitButtonProps extends BaseButtonProps {
5
5
  /** accessibility label */
6
6
  ariaLabel: string;
7
- /** The text for the button. Button text should be in sentence case. */
8
- children: ReactNode;
7
+ /** Key of the option which will be rendered as main option */
8
+ defaultMainOptionKey?: string;
9
9
  /** Disable the portal behavior. If true, children stay within parent DOM hierarchy. */
10
10
  disablePortal?: boolean;
11
- /** Callback when menu item is selected */
12
- onSelect?: (event: MouseEvent | KeyboardEvent, menuId: string, itemKey: string) => void;
11
+ /** Callback function which executes when any option has been clicked */
12
+ onOptionClick: (itemKey: string) => void;
13
13
  /**The options within the button dropdown */
14
14
  options: Array<MenuItemProps>;
15
15
  }
16
- export declare const DotSplitButton: ({ autoFocus, ariaLabel, children, className, "data-testid": dataTestId, disabled, disablePortal, disableRipple, fullWidth, isSubmit, onClick, onSelect, options, size, titleTooltip, tooltip, type, }: SplitButtonProps) => JSX.Element;
16
+ export declare const DotSplitButton: ({ autoFocus, ariaLabel, className, "data-testid": dataTestId, defaultMainOptionKey, disabled, disablePortal, disableRipple, fullWidth, isSubmit, onOptionClick, options, size, titleTooltip, tooltip, type, }: SplitButtonProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { MenuItemProps } from '../../menu/Menu';
2
+ export declare const getMainOptionIndex: (options: MenuItemProps[], mainOptionKey?: string) => number | null;
@@ -6,9 +6,11 @@ export interface TypographyProps extends CommonProps {
6
6
  children: ReactNode;
7
7
  /** The component used for the root node. Either a string to use a HTML element or a component. */
8
8
  component?: ElementType;
9
+ /** If true, the typography will not have a bottom margin set */
10
+ noMarginBottom?: boolean;
9
11
  /** If true, the text will wrap and not be truncated */
10
12
  noWrap?: boolean;
11
13
  /** Applies the theme typography styles. */
12
14
  variant?: TypographyVariant;
13
15
  }
14
- export declare const DotTypography: ({ ariaLabel, className, "data-testid": dataTestId, children, component, noWrap, variant, }: TypographyProps) => JSX.Element;
16
+ export declare const DotTypography: ({ ariaLabel, className, "data-testid": dataTestId, children, component, noMarginBottom, noWrap, variant, }: TypographyProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [