UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 3.58 kB
import t,{css as e}from"styled-components";import o from"../../scrollable-block/scrollable-block.style.js";import r from"../../../../style/themes/apply-base-theme.js";import{StyledLink as i}from"../../../link/link.style.js";import{StyledMenuItem as a}from"../../menu.style.js";import d from"../../../box/box.style.js";import s from"../../menu-item/menu-item.style.js";import n from"../../../icon/icon.style.js";import u from"../../menu.config.js";import{StyledSegmentChildren as m}from"../../menu-segment-title/menu-segment-title.style.js";const b=t.div.attrs(r).withConfig({displayName:"submenu.style__StyledSubmenuWrapper",componentId:"sc-49c71dfb-0"})(["position:relative;width:fit-content;max-width:inherit;height:inherit;"," ",""],(({isSubmenuOpen:t,theme:o})=>t&&e(["z-index:",";"],o.zIndex.popover)),(({inFullscreenView:t,menuType:o,asPassiveItem:r})=>e([""," ",""],t&&e(["width:100%;",""],r&&o&&e(["","{outline:none;color:",";}"],s,u[o].title)),!t&&e(["display:flex;"])))),l=t.ul.withConfig({displayName:"submenu.style__StyledSubmenu",componentId:"sc-49c71dfb-1"})(["",""],(({menuType:t,submenuDirection:r,variant:b,inFullscreenView:l,maxHeight:p,applyFocusRadiusStyling:h,applyFocusRadiusStylingToLastItem:c,submenuMaxWidth:g,submenuMinWidth:f})=>e([""," "," "," display:block;list-style:none;margin:0;padding:0;",":after,",":hover:after{display:none;}","{display:flex;align-items:center;white-space:nowrap;"," "," "," a{text-decoration:none;}> ",'{width:16px;height:16px;margin-right:5px;}}[data-component="icon"]{line-height:20px;&:before{line-height:unset;}span{vertical-align:middle;svg{height:16px;width:16px;}}}&:before{background-color:transparent;border-radius:0 0 4px 4px;content:"";height:5px;position:absolute;top:-5px;width:100%;}',""],!l&&t&&e(["box-shadow:var(--boxShadow100);position:absolute;top:100%;background-color:",";min-width:",";"," a,button,"," a,"," button{width:100%;}"],"default"===b?u[t].submenuItemBackground:u[t].background,null!=f?f:"100%",g&&e(["width:max-content;max-width:",";li{max-width:",";}&&&{a,button,"," a,"," button{white-space:normal;height:auto;}}"],g,g,i,i),i,i),l&&e(["min-width:100%;","{width:100%;}"],a),!l&&e(["border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);overflow-y:auto;"," & "," > ",":last-of-type:not([data-last-visible-menu-item='true']){a,button,> span,> div{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:var(--borderRadius000);:focus{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:var(--borderRadius000);}}}[data-last-visible-menu-item=\"true\"]{a,button,> span,> div{border-bottom-left-radius:var(--borderRadius100);border-bottom-right-radius:var(--borderRadius100);:focus{border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);}}}&&&& ","{","{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:",";",":last-child ",",",":last-child a,",":last-child button{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:",";}}}"],p&&`max-height: ${p};`,m,a,o,d,h?"var(--borderRadius100)":"var(--borderRadius000)",a,i,a,a,c?"var(--borderRadius100)":"var(--borderRadius000)"),s,s,s,l&&e(["white-space:normal;height:auto;"]),g&&e(["height:auto;min-height:40px;"]),!l&&t&&e(["background-color:",";> a:focus,> button:focus{background-color:",";}> a,> button{padding:11px 16px 12px;}"],u[t].submenuItemBackground,u[t].submenuItemBackground),n,"left"===r&&e(["right:0;"]))));export{l as StyledSubmenu,b as StyledSubmenuWrapper};