@digital-ai/dot-components 3.17.1 → 3.18.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/index.esm.js CHANGED
@@ -3933,6 +3933,38 @@ const styledListItemElement = elementType => {
3933
3933
  .dot-icon i:before {
3934
3934
  color: ${theme.palette.figma.icon.black};
3935
3935
  }
3936
+
3937
+ .left-border-with-arrow {
3938
+ position: absolute;
3939
+ left: 0;
3940
+ top: 0;
3941
+ bottom: 0;
3942
+ display: flex;
3943
+ flex-direction: row;
3944
+ align-items: center;
3945
+ padding: 3px 0;
3946
+ gap: 0;
3947
+
3948
+ .left-border,
3949
+ .left-arrow {
3950
+ width: 3px;
3951
+ background-color: ${({
3952
+ leftBorderAndArrow: color
3953
+ }) => {
3954
+ return color && theme.palette.avatarColors[color] ? theme.palette.avatarColors[color].backgroundColor : theme.palette.figma.typography.disabled; // grey
3955
+ }};
3956
+ }
3957
+
3958
+ .left-border {
3959
+ height: 100%;
3960
+ border-radius: ${theme.spacing(0, 0.5, 0.5, 0)};
3961
+ }
3962
+
3963
+ .left-arrow {
3964
+ height: 6px;
3965
+ clip-path: polygon(0 0, 0 100%, 100% 50%);
3966
+ }
3967
+ }
3936
3968
  }
3937
3969
  `}
3938
3970
  `;
@@ -4059,6 +4091,7 @@ const DotListItem = ({
4059
4091
  onHrefClick,
4060
4092
  onMenuLeave,
4061
4093
  items = [],
4094
+ leftBorderAndArrow,
4062
4095
  menuPlacement,
4063
4096
  nestedDrawerLeftSpacing,
4064
4097
  nestedListType,
@@ -4125,7 +4158,7 @@ const DotListItem = ({
4125
4158
  });
4126
4159
  const ListItem = onClick || href ? StyledListItemButton : StyledListItem;
4127
4160
  return jsxs(Fragment, {
4128
- children: [jsx(ListItem, {
4161
+ children: [jsxs(ListItem, {
4129
4162
  "aria-label": ariaLabel || tooltip,
4130
4163
  autoFocus: autoFocus,
4131
4164
  classes: {
@@ -4136,13 +4169,21 @@ const DotListItem = ({
4136
4169
  "data-testid": dataTestId,
4137
4170
  divider: divider,
4138
4171
  href: onClick ? null : href,
4172
+ leftBorderAndArrow: leftBorderAndArrow,
4139
4173
  onClick: !isLink ? handleClick : null,
4140
4174
  onKeyDown: onKeyDown,
4141
4175
  role: ariaRole,
4142
4176
  selected: isFlyout ? false : selected,
4143
4177
  tabIndex: isLink ? -1 : 0,
4144
4178
  target: target,
4145
- children: jsx(DotTooltip, {
4179
+ children: [leftBorderAndArrow && jsxs("div", {
4180
+ className: "left-border-with-arrow",
4181
+ children: [jsx("div", {
4182
+ className: "left-border"
4183
+ }), jsx("div", {
4184
+ className: "left-arrow"
4185
+ })]
4186
+ }), jsx(DotTooltip, {
4146
4187
  "data-testid": `${dataTestId}-tooltip`,
4147
4188
  placement: tooltipPlacement,
4148
4189
  title: tooltip,
@@ -4151,7 +4192,7 @@ const DotListItem = ({
4151
4192
  children: startIcon
4152
4193
  }), renderListItemText(), showEndIcon && renderListItemEndIcon()]
4153
4194
  })
4154
- })
4195
+ })]
4155
4196
  }), hasChildren && jsx(NestedList, {
4156
4197
  anchorEl: anchorEl,
4157
4198
  ariaLabel: "nested list",
@@ -4280,7 +4321,8 @@ const DotList = ({
4280
4321
  target: item.target,
4281
4322
  text: item.text,
4282
4323
  tooltip: item.tooltip,
4283
- tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
4324
+ tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT,
4325
+ leftBorderAndArrow: item.leftBorderAndArrow
4284
4326
  }, item.id || item.text);
4285
4327
  }), children]
4286
4328
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "3.17.1",
3
+ "version": "3.18.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -15,7 +15,7 @@ export type { ConditionFunction, ControlClickHandler, DisabledConditionFunction,
15
15
  export type { InputTextProps } from './input-form-fields/InputText';
16
16
  export type { InputSelectProps, InputSelectOption, OptionType, } from './input-form-fields/InputSelect';
17
17
  export type { LinkUnderline } from './link/Link';
18
- export type { ListItemProps } from './list';
18
+ export type { LeftBorderAndArrowColor, ListItemProps } from './list';
19
19
  export type { MenuItemProps } from './menu/Menu';
20
20
  export type { RailItem, RailItemsPosition } from './navigation-rail';
21
21
  export type { RadioButtonProps } from './radio/RadioButton';
@@ -1,2 +1,2 @@
1
1
  import { ListItemProps } from './utils/models';
2
- export declare const DotListItem: ({ ariaLabel, ariaRole, autoFocus, className, component, "data-pendoid": dataPendoId, "data-testid": dataTestId, divider, endIcon, href, isOpened, onClick, onKeyDown, onHrefClick, onMenuLeave, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, target, text, tooltip, tooltipPlacement, }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DotListItem: ({ ariaLabel, ariaRole, autoFocus, className, component, "data-pendoid": dataPendoId, "data-testid": dataTestId, divider, endIcon, href, isOpened, onClick, onKeyDown, onHrefClick, onMenuLeave, items, leftBorderAndArrow, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, target, text, tooltip, tooltipPlacement, }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ import { LinkTarget } from '../../link/Link';
5
5
  import { TooltipPlacement } from '../../tooltip';
6
6
  export declare const DEFAULT_TOOLTIP_PLACEMENT = "top-start";
7
7
  export type NestedListType = 'drawer' | 'expandable' | 'menu';
8
+ export type LeftBorderAndArrowColor = 'blue' | 'red' | 'orange' | 'green' | 'grey' | 'purple' | 'yellow';
8
9
  export interface ListProps extends CommonProps {
9
10
  /** string or JSX element that is displayed inside the list */
10
11
  children?: ReactNode;
@@ -44,6 +45,8 @@ export interface ListItemProps extends CommonProps {
44
45
  isOpened?: boolean;
45
46
  /** If provided, the menu item will display a nested list */
46
47
  items?: Array<ListItemProps>;
48
+ /** If defined, shows border with arrow on the left side of the list element */
49
+ leftBorderAndArrow?: LeftBorderAndArrowColor;
47
50
  /** If nested list type is 'menu', determines the placement of the menu */
48
51
  menuPlacement?: PopperPlacement;
49
52
  /** If nested type is 'drawer', determines the width of the left spacing */