2022-05-04 14:52:58 +00:00
|
|
|
import styled, { css } from "styled-components";
|
2022-05-27 18:57:59 +00:00
|
|
|
import Base from "../themes/base";
|
2022-02-07 11:47:21 +00:00
|
|
|
|
2022-02-04 10:21:10 +00:00
|
|
|
export const StyledSubmenu = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2022-02-17 14:01:04 +00:00
|
|
|
|
|
|
|
.scrollbar {
|
|
|
|
width: 100%;
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text {
|
|
|
|
width: auto;
|
|
|
|
display: inline-block;
|
|
|
|
position: absolute;
|
|
|
|
}
|
2022-05-01 20:55:18 +00:00
|
|
|
|
|
|
|
.sticky {
|
|
|
|
position: sticky;
|
2023-10-09 14:19:43 +00:00
|
|
|
top: ${(props) => (props.topProps ? props.topProps : 0)};
|
2022-05-01 20:55:18 +00:00
|
|
|
background: ${(props) => props.theme.submenu.backgroundColor};
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sticky-indent {
|
2023-09-11 12:09:38 +00:00
|
|
|
height: 20px;
|
2022-05-01 20:55:18 +00:00
|
|
|
}
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
|
|
|
|
2022-05-27 18:57:59 +00:00
|
|
|
StyledSubmenu.defaultProps = { theme: Base };
|
|
|
|
|
2022-02-04 10:21:10 +00:00
|
|
|
export const StyledSubmenuBottomLine = styled.div`
|
|
|
|
height: 1px;
|
|
|
|
width: 100%;
|
2022-05-01 20:55:18 +00:00
|
|
|
margin-top: -1px;
|
2022-03-30 18:14:53 +00:00
|
|
|
background: ${(props) => props.theme.submenu.lineColor};
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
|
|
|
|
2022-05-27 18:57:59 +00:00
|
|
|
StyledSubmenuBottomLine.defaultProps = { theme: Base };
|
|
|
|
|
2022-02-04 10:21:10 +00:00
|
|
|
export const StyledSubmenuContentWrapper = styled.div`
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const StyledSubmenuItems = styled.div`
|
2022-02-17 14:01:04 +00:00
|
|
|
overflow: scroll;
|
|
|
|
|
2022-02-04 10:21:10 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
gap: 4px;
|
2022-02-17 14:01:04 +00:00
|
|
|
|
2023-03-27 07:49:40 +00:00
|
|
|
width: max-content;
|
2022-03-30 18:05:29 +00:00
|
|
|
overflow: hidden;
|
2022-02-17 14:01:04 +00:00
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
|
|
|
|
2022-02-07 09:39:57 +00:00
|
|
|
export const StyledSubmenuItem = styled.div.attrs((props) => ({
|
2022-02-28 14:15:05 +00:00
|
|
|
id: props.id,
|
2022-02-07 09:39:57 +00:00
|
|
|
}))`
|
2022-02-17 22:59:46 +00:00
|
|
|
scroll-behavior: smooth;
|
2022-02-07 09:39:57 +00:00
|
|
|
cursor: pointer;
|
2022-02-04 10:21:10 +00:00
|
|
|
display: flex;
|
2022-03-01 11:45:14 +00:00
|
|
|
gap: 4px;
|
2022-02-04 10:21:10 +00:00
|
|
|
flex-direction: column;
|
2022-08-04 23:54:39 +00:00
|
|
|
padding-top: 4px;
|
2022-02-04 10:21:10 +00:00
|
|
|
line-height: 20px;
|
2023-07-21 10:48:00 +00:00
|
|
|
${(props) =>
|
|
|
|
props.theme.interfaceDirection === "rtl"
|
|
|
|
? css`
|
2023-09-07 08:18:24 +00:00
|
|
|
margin-left: 17px;
|
|
|
|
`
|
|
|
|
: css`
|
2023-09-06 10:06:16 +00:00
|
|
|
&:not(:last-child) {
|
|
|
|
margin-right: 17px;
|
|
|
|
}
|
2023-07-21 10:48:00 +00:00
|
|
|
`}
|
2022-09-15 09:02:50 +00:00
|
|
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const StyledSubmenuItemText = styled.div`
|
2023-03-27 07:49:40 +00:00
|
|
|
width: max-content;
|
2022-02-04 10:21:10 +00:00
|
|
|
display: flex;
|
2022-05-27 14:27:59 +00:00
|
|
|
|
2022-08-16 10:52:57 +00:00
|
|
|
.item-text {
|
2022-05-27 14:27:59 +00:00
|
|
|
color: ${(props) =>
|
2022-12-05 07:34:29 +00:00
|
|
|
props.isActive
|
|
|
|
? props.theme.submenu.activeTextColor
|
|
|
|
: props.theme.submenu.textColor};
|
2022-08-23 10:49:36 +00:00
|
|
|
font-weight: 600;
|
2022-08-16 10:52:57 +00:00
|
|
|
}
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
|
|
|
|
2022-05-27 18:57:59 +00:00
|
|
|
StyledSubmenuItemText.defaultProps = { theme: Base };
|
|
|
|
|
2022-02-04 10:21:10 +00:00
|
|
|
export const StyledSubmenuItemLabel = styled.div`
|
2022-03-01 11:45:14 +00:00
|
|
|
z-index: 1;
|
2022-08-04 23:54:39 +00:00
|
|
|
width: 100%;
|
2022-02-04 10:21:10 +00:00
|
|
|
height: 4px;
|
|
|
|
bottom: 0px;
|
|
|
|
border-radius: 4px 4px 0 0;
|
2022-08-16 10:52:57 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.isActive ? props.theme.submenu.bottomLineColor : ""};
|
2022-02-04 10:21:10 +00:00
|
|
|
`;
|
2022-05-27 18:57:59 +00:00
|
|
|
|
|
|
|
StyledSubmenuItemLabel.defaultProps = { theme: Base };
|
2023-03-27 07:49:40 +00:00
|
|
|
|
|
|
|
export const SubmenuScroller = styled.div`
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
white-space: nowrap;
|
|
|
|
scrollbar-width: none; // Firefox
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none; // Safari + Chrome
|
2023-07-21 10:48:00 +00:00
|
|
|
}
|
2023-03-27 07:49:40 +00:00
|
|
|
overflow-x: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const SubmenuRoot = styled.div`
|
|
|
|
overflow: hidden;
|
|
|
|
min-height: 32px;
|
|
|
|
// Add iOS momentum scrolling for iOS < 13.0
|
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
display: flex;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const SubmenuScrollbarSize = styled.div`
|
|
|
|
height: 32;
|
|
|
|
position: absolute;
|
|
|
|
top: -9999;
|
|
|
|
overflow-x: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
// Hide dimensionless scrollbar on macOS
|
|
|
|
scrollbar-width: none; // Firefox
|
2023-07-21 10:48:00 +00:00
|
|
|
&::-webkit-scrollbar {
|
2023-03-27 07:49:40 +00:00
|
|
|
display: none; // Safari + Chrome
|
2023-07-21 10:48:00 +00:00
|
|
|
}
|
2023-03-27 07:49:40 +00:00
|
|
|
`;
|