@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/cjs/index.js
CHANGED
|
@@ -4094,17 +4094,18 @@ const MENU_ITEM_STYLES = theme.createStyles((theme) => {
|
|
|
4094
4094
|
display: 'flex',
|
|
4095
4095
|
alignItems: 'center',
|
|
4096
4096
|
gap: theme.spacing.sm,
|
|
4097
|
-
paddingLeft: theme.spacing.md
|
|
4097
|
+
paddingLeft: `calc(${theme.spacing.md} - 2px)`,
|
|
4098
4098
|
paddingRight: theme.spacing.md,
|
|
4099
4099
|
...(size === 'default'
|
|
4100
4100
|
? { height: DEFAULT_DRAWER_ITEM_SIZE }
|
|
4101
4101
|
: { paddingTop: theme.spacing.xs, paddingBottom: theme.spacing.xs }),
|
|
4102
|
+
borderLeft: '2px solid transparent',
|
|
4102
4103
|
cursor: 'pointer',
|
|
4103
4104
|
userSelect: 'none',
|
|
4104
4105
|
color: c.textPrimary,
|
|
4105
4106
|
fontSize: theme.fontSize.sm,
|
|
4106
4107
|
listStyle: 'none',
|
|
4107
|
-
transition: `background-color ${theme.transition.fast}`,
|
|
4108
|
+
transition: `background-color ${theme.transition.fast}, border-color ${theme.transition.fast}`,
|
|
4108
4109
|
'&[data-selected]': {
|
|
4109
4110
|
backgroundColor: c.primarySubtle,
|
|
4110
4111
|
color: c.primaryMain,
|
|
@@ -4116,6 +4117,14 @@ const MENU_ITEM_STYLES = theme.createStyles((theme) => {
|
|
|
4116
4117
|
'&[data-focused][data-selected]': {
|
|
4117
4118
|
backgroundColor: c.primarySubtleHover,
|
|
4118
4119
|
},
|
|
4120
|
+
'&[data-submenu-open]': {
|
|
4121
|
+
backgroundColor: c.primarySubtle,
|
|
4122
|
+
color: c.primaryMain,
|
|
4123
|
+
borderLeftColor: c.primaryMain,
|
|
4124
|
+
},
|
|
4125
|
+
'&[data-submenu-open]:hover:not([data-disabled])': {
|
|
4126
|
+
backgroundColor: c.primarySubtleHover,
|
|
4127
|
+
},
|
|
4119
4128
|
'&[data-disabled]': {
|
|
4120
4129
|
cursor: 'not-allowed',
|
|
4121
4130
|
opacity: theme.opacity.high,
|
|
@@ -4173,7 +4182,7 @@ const MenuItem = ({ ref, id, label, icon, iconColor, role = 'menuitem', checked,
|
|
|
4173
4182
|
const isFocused = focused || focusedId === itemId;
|
|
4174
4183
|
const { liRef, mergedRef, submenuOpen, handleClick, scheduleOpen, scheduleClose, clearTimers, closeSubmenu, } = useMenuItem({ ref, role, hasSubmenu, disabled, onClick, closeOnClick, submenuTrigger });
|
|
4175
4184
|
const isHoverTrigger = submenuTrigger === 'hover';
|
|
4176
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.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 && (jsxRuntime.jsxs("span", { className: MENU_ITEM_STYLES.indicator, "aria-hidden": true, children: [checked && role === 'menuitemcheckbox' && (jsxRuntime.jsx(Icon, { icon: CheckIcon, size: size === 'default' ? 'sm' : 'md', strokeColor: 'primaryMain' })), checked && role === 'menuitemradio' && (jsxRuntime.jsx("span", { className: MENU_ITEM_STYLES.radioDot }))] })), icon !== undefined && (jsxRuntime.jsx(Icon, { icon: icon, size: 'sm', strokeColor: iconColor ?? (isHighlighted ? 'primaryMain' : 'textSecondary') })), jsxRuntime.jsx(Text, { variant: 'span', fontSize: 'sm', className: MENU_ITEM_STYLES.label, children: label }), hasSubmenu && (jsxRuntime.jsx("span", { className: MENU_ITEM_STYLES.submenuChevron, "aria-hidden": true, children: jsxRuntime.jsx(Icon, { icon: ChevronRightIcon, size: 'sm', strokeColor: 'textTertiary' }) }))] }), hasSubmenu && (jsxRuntime.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 }))] }));
|
|
4185
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.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 && (jsxRuntime.jsxs("span", { className: MENU_ITEM_STYLES.indicator, "aria-hidden": true, children: [checked && role === 'menuitemcheckbox' && (jsxRuntime.jsx(Icon, { icon: CheckIcon, size: size === 'default' ? 'sm' : 'md', strokeColor: 'primaryMain' })), checked && role === 'menuitemradio' && (jsxRuntime.jsx("span", { className: MENU_ITEM_STYLES.radioDot }))] })), icon !== undefined && (jsxRuntime.jsx(Icon, { icon: icon, size: 'sm', strokeColor: iconColor ?? (isHighlighted ? 'primaryMain' : 'textSecondary') })), jsxRuntime.jsx(Text, { variant: 'span', fontSize: 'sm', className: MENU_ITEM_STYLES.label, children: label }), hasSubmenu && (jsxRuntime.jsx("span", { className: MENU_ITEM_STYLES.submenuChevron, "aria-hidden": true, children: jsxRuntime.jsx(Icon, { icon: ChevronRightIcon, size: 'sm', strokeColor: 'textTertiary' }) }))] }), hasSubmenu && (jsxRuntime.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 }))] }));
|
|
4177
4186
|
};
|
|
4178
4187
|
MenuItem.displayName = 'MenuItem';
|
|
4179
4188
|
|