@digital-ai/dot-components 2.27.0 → 2.27.1

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.
Files changed (2) hide show
  1. package/index.esm.js +23 -7
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -3667,6 +3667,14 @@ const styledListItemElement = elementType => {
3667
3667
  width: 100%;
3668
3668
  }
3669
3669
 
3670
+ &.link-item {
3671
+ padding: 0;
3672
+
3673
+ .${listItemLinkClassName} {
3674
+ padding: ${theme.spacing(1, 2)};
3675
+ }
3676
+ }
3677
+
3670
3678
  &.${flyoutListItemClassName} {
3671
3679
  padding: 0;
3672
3680
  }
@@ -3689,6 +3697,10 @@ const styledListItemElement = elementType => {
3689
3697
  align-items: center;
3690
3698
  display: flex;
3691
3699
  flex-grow: 2;
3700
+
3701
+ &:focus-visible {
3702
+ outline: none;
3703
+ }
3692
3704
  }
3693
3705
 
3694
3706
  .${flyoutItemLinkClassName} .MuiIcon-root {
@@ -3841,7 +3853,8 @@ const DotListItem = ({
3841
3853
  const hasChildren = items.length > 0;
3842
3854
  const isFlyout = nestedListType === 'menu' && hasChildren;
3843
3855
  const showEndIcon = endIcon || hasChildren;
3844
- const rootClasses = useStylesWithRootClass(listItemRootClass, className, nestedListType === 'expandable' && hasChildren ? 'expandable' : '', navIsOpened ? 'open' : '');
3856
+ const isLink = href && !onClick;
3857
+ const rootClasses = useStylesWithRootClass(listItemRootClass, className, nestedListType === 'expandable' && hasChildren ? 'expandable' : '', navIsOpened ? 'open' : '', isLink ? 'link-item' : '');
3845
3858
  const toggleOpen = event => {
3846
3859
  setAnchorEl(event.currentTarget);
3847
3860
  setNavIsOpened(!navIsOpened);
@@ -3895,15 +3908,16 @@ const DotListItem = ({
3895
3908
  "data-testid": dataTestId,
3896
3909
  divider: divider,
3897
3910
  href: onClick ? null : href,
3898
- onClick: onClick || !href ? handleClick : null,
3911
+ onClick: !isLink ? handleClick : null,
3899
3912
  role: ariaRole,
3900
3913
  selected: isFlyout ? navIsOpened : selected,
3914
+ tabIndex: isLink ? -1 : 0,
3901
3915
  target: target,
3902
3916
  children: jsx(DotTooltip, {
3903
3917
  "data-testid": `${dataTestId}-tooltip`,
3904
3918
  placement: tooltipPlacement,
3905
3919
  title: tooltip,
3906
- children: href && !onClick ? renderListItemLink : jsxs(Fragment, {
3920
+ children: isLink ? renderListItemLink : jsxs(Fragment, {
3907
3921
  children: [startIcon && jsx(ListItemIcon, {
3908
3922
  children: startIcon
3909
3923
  }), renderListItemText(), showEndIcon && renderListItemEndIcon()]
@@ -5276,6 +5290,12 @@ const StyledSidebar = styled.aside`
5276
5290
  margin: 0;
5277
5291
  padding: 0;
5278
5292
 
5293
+ .${listItemLinkClassName} {
5294
+ padding: 0;
5295
+ height: 100%;
5296
+ width: 100%;
5297
+ }
5298
+
5279
5299
  .dot-typography {
5280
5300
  margin-left: ${theme.spacing(1)};
5281
5301
  }
@@ -5337,10 +5357,6 @@ const StyledSidebar = styled.aside`
5337
5357
  border: 'none';
5338
5358
  }
5339
5359
 
5340
- .dot-list-item-link .dot-icon {
5341
- margin-right: ${theme.spacing(1)};
5342
- }
5343
-
5344
5360
  .dot-icon {
5345
5361
  border-radius: 50%;
5346
5362
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "2.27.0",
3
+ "version": "2.27.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [