UNPKG

carbon-react

Version:

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

2 lines (1 loc) 3.9 kB
"use strict";var e=require("styled-components"),t=require("../../scrollable-block/scrollable-block.style.js"),r=require("../../../../style/themes/apply-base-theme.js"),i=require("../../../link/link.style.js"),o=require("../../menu.style.js"),a=require("../../../box/box.style.js"),d=require("../../menu-item/menu-item.style.js"),s=require("../../../icon/icon.style.js"),u=require("../../menu.config.js"),n=require("../../menu-segment-title/menu-segment-title.style.js");function l(e){return e&&e.__esModule?e:{default:e}}var b=l(e);const m=b.default.div.attrs(r.default).withConfig({displayName:"submenu.style__StyledSubmenuWrapper",componentId:"sc-49c71dfb-0"})(["position:relative;width:fit-content;max-width:inherit;height:inherit;"," ",""],(({isSubmenuOpen:t,theme:r})=>t&&e.css(["z-index:",";"],r.zIndex.popover)),(({inFullscreenView:t,menuType:r,asPassiveItem:i})=>e.css([""," ",""],t&&e.css(["width:100%;",""],i&&r&&e.css(["","{outline:none;color:",";}"],d.default,u.default[r].title)),!t&&e.css(["display:flex;"])))),c=b.default.ul.withConfig({displayName:"submenu.style__StyledSubmenu",componentId:"sc-49c71dfb-1"})(["",""],(({menuType:r,submenuDirection:l,variant:b,inFullscreenView:m,maxHeight:c,applyFocusRadiusStyling:h,applyFocusRadiusStylingToLastItem:p,submenuMaxWidth:f,submenuMinWidth:g})=>e.css([""," "," "," 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%;}',""],!m&&r&&e.css(["box-shadow:var(--boxShadow100);position:absolute;top:100%;background-color:",";min-width:",";"," a,button,"," a,"," button{width:100%;}"],"default"===b?u.default[r].submenuItemBackground:u.default[r].background,null!=g?g:"100%",f&&e.css(["width:max-content;max-width:",";li{max-width:",";}&&&{a,button,"," a,"," button{white-space:normal;height:auto;}}"],f,f,i.StyledLink,i.StyledLink),i.StyledLink,i.StyledLink),m&&e.css(["min-width:100%;","{width:100%;}"],o.StyledMenuItem),!m&&e.css(["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:",";}}}"],c&&`max-height: ${c};`,n.StyledSegmentChildren,o.StyledMenuItem,t.default,a.default,h?"var(--borderRadius100)":"var(--borderRadius000)",o.StyledMenuItem,i.StyledLink,o.StyledMenuItem,o.StyledMenuItem,p?"var(--borderRadius100)":"var(--borderRadius000)"),d.default,d.default,d.default,m&&e.css(["white-space:normal;height:auto;"]),f&&e.css(["height:auto;min-height:40px;"]),!m&&r&&e.css(["background-color:",";> a:focus,> button:focus{background-color:",";}> a,> button{padding:11px 16px 12px;}"],u.default[r].submenuItemBackground,u.default[r].submenuItemBackground),s.default,"left"===l&&e.css(["right:0;"]))));exports.StyledSubmenu=c,exports.StyledSubmenuWrapper=m;