@aurora-ds/components 1.8.0 → 1.8.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.
- package/dist/cjs/index.js +12 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +12 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4074,17 +4074,18 @@ const MENU_ITEM_STYLES = createStyles((theme) => {
|
|
|
4074
4074
|
display: 'flex',
|
|
4075
4075
|
alignItems: 'center',
|
|
4076
4076
|
gap: theme.spacing.sm,
|
|
4077
|
-
paddingLeft: theme.spacing.md
|
|
4077
|
+
paddingLeft: `calc(${theme.spacing.md} - 2px)`,
|
|
4078
4078
|
paddingRight: theme.spacing.md,
|
|
4079
4079
|
...(size === 'default'
|
|
4080
4080
|
? { height: DEFAULT_DRAWER_ITEM_SIZE }
|
|
4081
4081
|
: { paddingTop: theme.spacing.xs, paddingBottom: theme.spacing.xs }),
|
|
4082
|
+
borderLeft: '2px solid transparent',
|
|
4082
4083
|
cursor: 'pointer',
|
|
4083
4084
|
userSelect: 'none',
|
|
4084
4085
|
color: c.textPrimary,
|
|
4085
4086
|
fontSize: theme.fontSize.sm,
|
|
4086
4087
|
listStyle: 'none',
|
|
4087
|
-
transition: `background-color ${theme.transition.fast}`,
|
|
4088
|
+
transition: `background-color ${theme.transition.fast}, border-color ${theme.transition.fast}`,
|
|
4088
4089
|
'&[data-selected]': {
|
|
4089
4090
|
backgroundColor: c.primarySubtle,
|
|
4090
4091
|
color: c.primaryMain,
|
|
@@ -4096,6 +4097,14 @@ const MENU_ITEM_STYLES = createStyles((theme) => {
|
|
|
4096
4097
|
'&[data-focused][data-selected]': {
|
|
4097
4098
|
backgroundColor: c.primarySubtleHover,
|
|
4098
4099
|
},
|
|
4100
|
+
'&[data-submenu-open]': {
|
|
4101
|
+
backgroundColor: c.primarySubtle,
|
|
4102
|
+
color: c.primaryMain,
|
|
4103
|
+
borderLeftColor: c.primaryMain,
|
|
4104
|
+
},
|
|
4105
|
+
'&[data-submenu-open]:hover:not([data-disabled])': {
|
|
4106
|
+
backgroundColor: c.primarySubtleHover,
|
|
4107
|
+
},
|
|
4099
4108
|
'&[data-disabled]': {
|
|
4100
4109
|
cursor: 'not-allowed',
|
|
4101
4110
|
opacity: theme.opacity.high,
|
|
@@ -4153,7 +4162,7 @@ const MenuItem = ({ ref, id, label, icon, iconColor, role = 'menuitem', checked,
|
|
|
4153
4162
|
const isFocused = focused || focusedId === itemId;
|
|
4154
4163
|
const { liRef, mergedRef, submenuOpen, handleClick, scheduleOpen, scheduleClose, clearTimers, closeSubmenu, } = useMenuItem({ ref, role, hasSubmenu, disabled, onClick, closeOnClick, submenuTrigger });
|
|
4155
4164
|
const isHoverTrigger = submenuTrigger === 'hover';
|
|
4156
|
-
return (jsxs(Fragment$1, { children: [jsxs("li", { ref: mergedRef, id: itemId, role: role, "aria-checked": isCheckable ? Boolean(checked) : undefined, "aria-selected": isOption ? Boolean(selected) : undefined, "aria-disabled": disabled, "aria-haspopup": hasSubmenu ? 'menu' : undefined, "aria-expanded": hasSubmenu ? submenuOpen : undefined, "data-selected": isHighlighted || undefined, "data-focused": isFocused || undefined, "data-disabled": disabled || undefined, className: MENU_ITEM_STYLES.root({ size }), onClick: handleClick, onMouseEnter: hasSubmenu && !disabled && isHoverTrigger ? scheduleOpen : undefined, onMouseLeave: hasSubmenu && isHoverTrigger ? scheduleClose : undefined, ...rest, children: [isCheckable && (jsxs("span", { className: MENU_ITEM_STYLES.indicator, "aria-hidden": true, children: [checked && role === 'menuitemcheckbox' && (jsx(Icon, { icon: CheckIcon, size: size === 'default' ? 'sm' : 'md', strokeColor: 'primaryMain' })), checked && role === 'menuitemradio' && (jsx("span", { className: MENU_ITEM_STYLES.radioDot }))] })), icon !== undefined && (jsx(Icon, { icon: icon, size: 'sm', strokeColor: iconColor ?? (isHighlighted ? 'primaryMain' : 'textSecondary') })), jsx(Text, { variant: 'span', fontSize: 'sm', className: MENU_ITEM_STYLES.label, children: label }), hasSubmenu && (jsx("span", { className: MENU_ITEM_STYLES.submenuChevron, "aria-hidden": true, children: jsx(Icon, { icon: ChevronRightIcon, size: 'sm', strokeColor: 'textTertiary' }) }))] }), hasSubmenu && (jsx(MenuPanel, { open: submenuOpen, onClose: () => closeSubmenu(true), onArrowLeft: () => closeSubmenu(true), anchorEl: liRef.current, placement: submenuPlacement, isSubmenu: true, "aria-label": label, onMouseEnter: isHoverTrigger ? clearTimers : undefined, onMouseLeave: isHoverTrigger ? scheduleClose : undefined, children: submenu }))] }));
|
|
4165
|
+
return (jsxs(Fragment$1, { children: [jsxs("li", { ref: mergedRef, id: itemId, role: role, "aria-checked": isCheckable ? Boolean(checked) : undefined, "aria-selected": isOption ? Boolean(selected) : undefined, "aria-disabled": disabled, "aria-haspopup": hasSubmenu ? 'menu' : undefined, "aria-expanded": hasSubmenu ? submenuOpen : undefined, "data-selected": isHighlighted || undefined, "data-focused": isFocused || undefined, "data-disabled": disabled || undefined, "data-submenu-open": hasSubmenu && submenuOpen || undefined, className: MENU_ITEM_STYLES.root({ size }), onClick: handleClick, onMouseEnter: hasSubmenu && !disabled && isHoverTrigger ? scheduleOpen : undefined, onMouseLeave: hasSubmenu && isHoverTrigger ? scheduleClose : undefined, ...rest, children: [isCheckable && (jsxs("span", { className: MENU_ITEM_STYLES.indicator, "aria-hidden": true, children: [checked && role === 'menuitemcheckbox' && (jsx(Icon, { icon: CheckIcon, size: size === 'default' ? 'sm' : 'md', strokeColor: 'primaryMain' })), checked && role === 'menuitemradio' && (jsx("span", { className: MENU_ITEM_STYLES.radioDot }))] })), icon !== undefined && (jsx(Icon, { icon: icon, size: 'sm', strokeColor: iconColor ?? (isHighlighted ? 'primaryMain' : 'textSecondary') })), jsx(Text, { variant: 'span', fontSize: 'sm', className: MENU_ITEM_STYLES.label, children: label }), hasSubmenu && (jsx("span", { className: MENU_ITEM_STYLES.submenuChevron, "aria-hidden": true, children: jsx(Icon, { icon: ChevronRightIcon, size: 'sm', strokeColor: 'textTertiary' }) }))] }), hasSubmenu && (jsx(MenuPanel, { open: submenuOpen, onClose: () => closeSubmenu(true), onArrowLeft: () => closeSubmenu(true), anchorEl: liRef.current, placement: submenuPlacement, isSubmenu: true, "aria-label": label, onMouseEnter: isHoverTrigger ? clearTimers : undefined, onMouseLeave: isHoverTrigger ? scheduleClose : undefined, children: submenu }))] }));
|
|
4157
4166
|
};
|
|
4158
4167
|
MenuItem.displayName = 'MenuItem';
|
|
4159
4168
|
|