@pega/cosmos-react-core 8.2.2 → 8.3.0
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/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +3 -1
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts +7 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +65 -8
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/ResizeHandle.d.ts +9 -0
- package/lib/components/Drawer/ResizeHandle.d.ts.map +1 -0
- package/lib/components/Drawer/ResizeHandle.js +109 -0
- package/lib/components/Drawer/ResizeHandle.js.map +1 -0
- package/lib/components/Drawer/index.d.ts +2 -0
- package/lib/components/Drawer/index.d.ts.map +1 -1
- package/lib/components/Drawer/index.js +1 -0
- package/lib/components/Drawer/index.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +26 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +2 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +2 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +3 -1
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +2 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/constants.d.ts +5 -0
- package/lib/styles/constants.d.ts.map +1 -0
- package/lib/styles/constants.js +5 -0
- package/lib/styles/constants.js.map +1 -0
- package/lib/theme/themes/bootes2025Theme.json +1 -1
- package/lib/theme/themes/cygnus2025Theme.json +17 -17
- package/lib/utils/getChildOfRootNode.d.ts +10 -0
- package/lib/utils/getChildOfRootNode.d.ts.map +1 -0
- package/lib/utils/getChildOfRootNode.js +19 -0
- package/lib/utils/getChildOfRootNode.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,QAAQ,SAAS,CAAC;AAC/B,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,YAAY,SAAS,CAAC;AAGnC,eAAO,MAAM,aAAa,uGA8CxB,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAU3B,CAAC;AAIH,eAAO,MAAM,eAAe;;uDAiB1B,CAAC;AAIH,eAAO,MAAM,yBAAyB,0GAOpC,CAAC;AAIH,eAAO,MAAM,+BAA+B,0KAAiB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,0GAE/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,0GAe/B,CAAC;AAIH,eAAO,MAAM,YAAY;eAA2B,OAAO;aAAW,OAAO;SAgD5E,CAAC;AAIF,eAAO,MAAM,eAAe,4GAAkB,CAAC;AAE/C,eAAO,MAAM,gCAAgC;eAChC,OAAO;aACT,OAAO;SAwCjB,CAAC;AAIF,eAAO,MAAM,iBAAiB;yBACP,OAAO;kBACd,OAAO;SAmJrB,CAAC;AAIH,eAAO,MAAM,aAAa,wGAezB,CAAC;AAGF,eAAO,MAAM,kBAAkB,yGAQ7B,CAAC;AAIH,eAAO,MAAM,mBAAmB,wGA+B9B,CAAC;AAIH,eAAO,MAAM,eAAe,yGA2B1B,CAAC;AAIH,eAAO,MAAM,WAAW,yGAQtB,CAAC;AAIH,eAAO,MAAM,eAAe,4GAqB1B,CAAC;AAIH,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,aAAa;eACb,OAAO;eACP,OAAO;aACT,OAAO;mBACD,OAAO;mBACP,MAAM;SAyDrB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAI7B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAsBhC,CAAC;AAIH,eAAO,MAAM,0BAA0B,oLA2BrC,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { StyledTooltip } from '../Tooltip';
|
|
|
15
15
|
import { StyledProgressBackdrop } from '../Progress';
|
|
16
16
|
import Icon from '../Icon/Icon';
|
|
17
17
|
import { StyledText } from '../Text';
|
|
18
|
+
import { resizeDrawerMaxWidth } from '../../styles/constants';
|
|
18
19
|
import AppShellContext from './AppShellContext';
|
|
19
20
|
import { navContrastColors, pxToRem } from './style-utils';
|
|
20
21
|
export const navWidth = '4rem';
|
|
@@ -475,7 +476,8 @@ export const StyledAppMain = styled.main(({ appHeader, mobileNav, navOpen, previ
|
|
|
475
476
|
|
|
476
477
|
${previewActive &&
|
|
477
478
|
css `
|
|
478
|
-
|
|
479
|
+
transition: none;
|
|
480
|
+
margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});
|
|
479
481
|
`}
|
|
480
482
|
}
|
|
481
483
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OA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,CAAC,EAAE,CAAC,CAAC;IAEhC,OAAO,GAAG,CAAA;wBACY,EAAE;;;eAGX,KAAK;;;MAGd,cAAc;0BACM,EAAE;eACb,KAAK;;;;4BAIQ,EAAE;sBACR,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;GAG1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mCAAmC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnF,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEtC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC;QAC3C,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAA;kBACM,EAAE;aACP,UAAU;;2BAEI,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEvC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { darken, getContrast, lighten, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { Count } from '../Badges';\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport {\n calculateFontSize,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n readableColor\n} from '../../styles';\nimport { StyledMenuItem } from '../Menu/Menu.styles';\nimport { useDirection } from '../../hooks';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledTooltip } from '../Tooltip';\nimport { StyledProgressBackdrop } from '../Progress';\nimport Icon from '../Icon/Icon';\nimport { StyledText } from '../Text';\n\nimport AppShellContext from './AppShellContext';\nimport { navContrastColors, pxToRem } from './style-utils';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\nconst iconWidth = '1.125rem';\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { hoverBg, foreground } = navContrastColors(theme);\n\n return css`\n padding: ${theme.base.spacing} calc(${navWidth} / 4);\n grid-template-columns: calc(${navWidth} / 2) auto;\n column-gap: calc(${navWidth} / 4);\n vertical-align: middle;\n\n &:hover,\n button&:hover {\n background-color: ${hoverBg};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n margin-inline-end: calc(${theme.base.spacing} * 2);\n vertical-align: middle;\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: ${foreground};\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${foreground};\n margin-inline-end: calc(${theme.base.spacing});\n vertical-align: middle;\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(({ theme }) => {\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: visible;\n flex-shrink: 0;\n }\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)(({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n}) => {\n const insetInlineStartOffsetMultiplier = detached ? 3 : 4;\n return css`\n position: absolute;\n inset-inline-start: calc(${insetInlineStartOffsetMultiplier} * ${spacing});\n top: calc(0.5 * ${spacing});\n padding: 0 calc(0.5 * ${spacing});\n `;\n});\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSingleSelectIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n height: ${theme.base['hit-area']['mouse-min']};\n width: ${theme.base['hit-area']['mouse-min']};\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledSingleSelectIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItemExpandCollapse = styled(Icon)``;\n\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledNavItemIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n > ${StyledIcon}, ${StyledUtilIconCount} > ${StyledIcon} {\n margin-inline: calc((${navWidth} - ${iconWidth} - 2 * var(--nav-padding)) / 2);\n }\n\n ${StyledAvatar} {\n margin-inline: calc(\n (${navWidth} - ${theme.base['hit-area']['mouse-min']} - 2 * var(--nav-padding)) / 2\n );\n margin-block: calc(0.5 * ${theme.base.spacing});\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledNavItemIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(navBg, navFgColor);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n background: ${navBg};\n color: ${foregroundColor};\n max-width: calc(100vw - ${theme.base['hit-area']['mouse-min']});\n width: ${navOpen ? navOpenWidth : navWidth};\n height: calc(100vh - ${appHeader ? headerHeight : '0rem'});\n overflow: hidden;\n white-space: nowrap;\n transition: width ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n padding-block-end: ${theme.base.spacing};\n border-inline-end: ${pxToRem(1)} solid ${transparentize(0.9, '#000')};\n border-color: ${theme.components['app-shell'].nav['border-color']};\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: auto;\n }\n\n /* App navigation can be focused with shortcut */\n :focus-visible {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItemVisualContainer = styled.div<{\n isCurrent: boolean;\n navOpen: boolean;\n}>(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n },\n isCurrent,\n navOpen\n }) => {\n return css`\n max-width: ${navWidth};\n padding-block: calc(var(--nav-padding) / 8);\n padding-inline: var(--nav-padding);\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\n `}\n\n & > ${StyledText} {\n padding-inline: ${isCurrent\n ? `${spacing} calc(0.5 * ${spacing})`\n : `calc(0.5 * ${spacing})`};\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n `}\n }\n `;\n }\n);\n\nStyledNavListItemVisualContainer.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n singleSelect: boolean;\n}>(({ theme, nestedListCollapsed, singleSelect }) => {\n const {\n base: {\n 'font-weight': { 'semi-bold': semiBold }\n },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { navOpen } = useContext(AppShellContext);\n const { foreground } = navContrastColors(theme);\n const { rtl } = useDirection();\n\n return css`\n display: block;\n position: relative;\n\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n opacity: 0;\n left: ${navOpen ? 'auto' : '100%'};\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: ${foreground};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n `}\n }\n padding: calc(var(--nav-padding) / 8) var(--nav-padding);\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\n `}\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: ${foreground};\n cursor: pointer;\n text-decoration: none;\n border-block: ${pxToRem(1)} solid transparent;\n ${detached &&\n css`\n border-radius: ${theme.base['border-radius']};\n `}\n span:not(${StyledCountIcon}) {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: ${foreground};\n background: ${transparentize(0.9, foreground)};\n }\n\n &:hover + ${StyledCaseClose}, &:focus + ${StyledCaseClose} {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledNavListItemExpandCollapse} {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${!nestedListCollapsed &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n }\n\n ${singleSelect &&\n css`\n ${StyledNavItemIconBox} > ${StyledIcon} {\n margin-inline: calc(${theme.base.spacing} - var(--nav-padding));\n }\n `}\n\n ${StyledSingleSelectIconBox} + span {\n margin-inline-start: ${theme.base.spacing};\n }\n }\n\n [aria-current='page'],\n [aria-expanded='false']:has(+ ul [aria-current='page']) {\n position: relative;\n font-weight: ${semiBold};\n border-block: ${pxToRem(1)} solid ${theme.components['app-shell'].nav['border-color']};\n background: ${transparentize(0.85, foreground)};\n ${!detached &&\n css`\n &::before {\n content: '';\n position: absolute;\n width: ${pxToRem(4)};\n inset-inline-start: 0;\n top: 0;\n bottom: 0;\n background-color: ${foreground};\n }\n `}\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n }) => {\n return css`\n --nav-padding: ${detached ? spacing : '0px'};\n `;\n }\n);\nStyledNavList.defaultProps = defaultThemeProp;\n\nexport const StyledNavCasesList = styled.div(({ theme }) => {\n return css`\n ${StyledNavListItem} {\n > :first-child {\n padding: ${theme.base.spacing} 0;\n }\n }\n `;\n});\n\nStyledNavCasesList.defaultProps = defaultThemeProp;\n\nexport const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {\n const {\n base: { 'border-radius': borderRadius },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { nestedList } = navContrastColors(theme);\n\n return css`\n background: ${nestedList};\n border-radius: ${detached ? borderRadius : '0px'};\n padding-block: var(--nav-padding);\n\n ${StyledNavListItem} {\n > :first-child {\n &:has(${StyledIcon}) {\n padding-inline-start: calc(\n ((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconWidth}\n );\n }\n\n &:not(:has(${StyledIcon})) {\n padding-inline-start: calc(${navWidth} - 3 * var(--nav-padding));\n }\n }\n }\n `;\n});\n\nStyledNestedNavList.defaultProps = defaultThemeProp;\n\nexport const StyledCaseTypes = styled.div(props => {\n const {\n theme: {\n base: {\n animation: {\n speed,\n timing: { ease: acceleration }\n }\n }\n }\n } = props;\n\n return css`\n button {\n ${StyledNavItemIconBox} {\n transition: transform ${speed} ${acceleration};\n }\n\n &[aria-expanded='false'] ${StyledNavItemIconBox} {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledNavItemIconBox} {\n transform: rotateZ(45deg);\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n return css`\n border-top: 0.0625rem solid ${theme.components['app-shell'].nav['border-color']};\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n margin: 0 calc((${navWidth} - ${iconWidth}) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background: ${mobileNavColor};\n color: ${foreground};\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n\n @media (height >= ${theme.base.breakpoints.sm}) {\n inset-block-start: 0;\n position: sticky;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n previewActive: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, previewActive, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n const appBackground = theme.base.palette['app-background'];\n\n return css`\n --appshell-offset: ${headerOffset}px;\n /* stylelint-disable-next-line length-zero-no-unit */\n --appshell-horizontal-offset: 0rem;\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n --appshell-horizontal-offset: ${navOpen ? navOpenWidth : navWidth};\n }\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background: ${appBackground};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n !mobileNav &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${!mobileNav &&\n css`\n transition: margin-inline-start\n ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n `}\n\n & > ${StyledProgressBackdrop} {\n max-height: calc(100vh - ${heightOffset});\n max-width: calc(100vw - ${navOpen ? navOpenWidth : navWidth});\n inset-block-start: ${heightOffset};\n inset-inline-start: ${navOpen ? navOpenWidth : navWidth};\n position: fixed;\n transition-property: opacity, max-height, max-width, inset-block-start, inset-inline-start;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n transition: margin-inline-end ${!mobileNav ? ', margin-inline-start' : ''};\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${previewActive &&\n css`\n margin-inline-end: clamp(21.875rem, (100vw - 31.25rem) / 10 + 21.875rem, 31.25rem);\n `}\n }\n `;\n});\n\nStyledAppMain.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellTooltip = styled(StyledTooltip)(({ theme }) => {\n const bg = theme.components.tooltip['background-color'];\n const color = readableColor(bg);\n\n return css`\n background-color: ${bg};\n padding: 0;\n header {\n color: ${color};\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${bg};\n color: ${color};\n\n &:hover,\n &:focus {\n background-color: ${bg};\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n `;\n});\n\nStyledAppShellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n const { backgroundColor } = calculateBackgroundAndContrastColor(navBg, navFgColor);\n let bg = darken(0.2, backgroundColor);\n\n if (getContrast(backgroundColor, bg) < 1.3) {\n bg = lighten(0.2, backgroundColor);\n }\n\n return css`\n background: ${bg};\n color: ${navFgColor};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,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,GAAG,CAAA;wBACY,EAAE;;;eAGX,KAAK;;;MAGd,cAAc;0BACM,EAAE;eACb,KAAK;;;;4BAIQ,EAAE;sBACR,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;GAG1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mCAAmC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnF,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEtC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC;QAC3C,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAA;kBACM,EAAE;aACP,UAAU;;2BAEI,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEvC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { darken, getContrast, lighten, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { Count } from '../Badges';\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport {\n calculateFontSize,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n readableColor\n} from '../../styles';\nimport { StyledMenuItem } from '../Menu/Menu.styles';\nimport { useDirection } from '../../hooks';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledTooltip } from '../Tooltip';\nimport { StyledProgressBackdrop } from '../Progress';\nimport Icon from '../Icon/Icon';\nimport { StyledText } from '../Text';\nimport { resizeDrawerMaxWidth } from '../../styles/constants';\n\nimport AppShellContext from './AppShellContext';\nimport { navContrastColors, pxToRem } from './style-utils';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\nconst iconWidth = '1.125rem';\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { hoverBg, foreground } = navContrastColors(theme);\n\n return css`\n padding: ${theme.base.spacing} calc(${navWidth} / 4);\n grid-template-columns: calc(${navWidth} / 2) auto;\n column-gap: calc(${navWidth} / 4);\n vertical-align: middle;\n\n &:hover,\n button&:hover {\n background-color: ${hoverBg};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n margin-inline-end: calc(${theme.base.spacing} * 2);\n vertical-align: middle;\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: ${foreground};\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${foreground};\n margin-inline-end: calc(${theme.base.spacing});\n vertical-align: middle;\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(({ theme }) => {\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: visible;\n flex-shrink: 0;\n }\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)(({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n}) => {\n const insetInlineStartOffsetMultiplier = detached ? 3 : 4;\n return css`\n position: absolute;\n inset-inline-start: calc(${insetInlineStartOffsetMultiplier} * ${spacing});\n top: calc(0.5 * ${spacing});\n padding: 0 calc(0.5 * ${spacing});\n `;\n});\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSingleSelectIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n height: ${theme.base['hit-area']['mouse-min']};\n width: ${theme.base['hit-area']['mouse-min']};\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledSingleSelectIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItemExpandCollapse = styled(Icon)``;\n\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledNavItemIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n > ${StyledIcon}, ${StyledUtilIconCount} > ${StyledIcon} {\n margin-inline: calc((${navWidth} - ${iconWidth} - 2 * var(--nav-padding)) / 2);\n }\n\n ${StyledAvatar} {\n margin-inline: calc(\n (${navWidth} - ${theme.base['hit-area']['mouse-min']} - 2 * var(--nav-padding)) / 2\n );\n margin-block: calc(0.5 * ${theme.base.spacing});\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledNavItemIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(navBg, navFgColor);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n background: ${navBg};\n color: ${foregroundColor};\n max-width: calc(100vw - ${theme.base['hit-area']['mouse-min']});\n width: ${navOpen ? navOpenWidth : navWidth};\n height: calc(100vh - ${appHeader ? headerHeight : '0rem'});\n overflow: hidden;\n white-space: nowrap;\n transition: width ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n padding-block-end: ${theme.base.spacing};\n border-inline-end: ${pxToRem(1)} solid ${transparentize(0.9, '#000')};\n border-color: ${theme.components['app-shell'].nav['border-color']};\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: auto;\n }\n\n /* App navigation can be focused with shortcut */\n :focus-visible {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItemVisualContainer = styled.div<{\n isCurrent: boolean;\n navOpen: boolean;\n}>(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n },\n isCurrent,\n navOpen\n }) => {\n return css`\n max-width: ${navWidth};\n padding-block: calc(var(--nav-padding) / 8);\n padding-inline: var(--nav-padding);\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\n `}\n\n & > ${StyledText} {\n padding-inline: ${isCurrent\n ? `${spacing} calc(0.5 * ${spacing})`\n : `calc(0.5 * ${spacing})`};\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n `}\n }\n `;\n }\n);\n\nStyledNavListItemVisualContainer.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n singleSelect: boolean;\n}>(({ theme, nestedListCollapsed, singleSelect }) => {\n const {\n base: {\n 'font-weight': { 'semi-bold': semiBold }\n },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { navOpen } = useContext(AppShellContext);\n const { foreground } = navContrastColors(theme);\n const { rtl } = useDirection();\n\n return css`\n display: block;\n position: relative;\n\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n opacity: 0;\n left: ${navOpen ? 'auto' : '100%'};\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: ${foreground};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n `}\n }\n padding: calc(var(--nav-padding) / 8) var(--nav-padding);\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\n `}\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: ${foreground};\n cursor: pointer;\n text-decoration: none;\n border-block: ${pxToRem(1)} solid transparent;\n ${detached &&\n css`\n border-radius: ${theme.base['border-radius']};\n `}\n span:not(${StyledCountIcon}) {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: ${foreground};\n background: ${transparentize(0.9, foreground)};\n }\n\n &:hover + ${StyledCaseClose}, &:focus + ${StyledCaseClose} {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledNavListItemExpandCollapse} {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${!nestedListCollapsed &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n }\n\n ${singleSelect &&\n css`\n ${StyledNavItemIconBox} > ${StyledIcon} {\n margin-inline: calc(${theme.base.spacing} - var(--nav-padding));\n }\n `}\n\n ${StyledSingleSelectIconBox} + span {\n margin-inline-start: ${theme.base.spacing};\n }\n }\n\n [aria-current='page'],\n [aria-expanded='false']:has(+ ul [aria-current='page']) {\n position: relative;\n font-weight: ${semiBold};\n border-block: ${pxToRem(1)} solid ${theme.components['app-shell'].nav['border-color']};\n background: ${transparentize(0.85, foreground)};\n ${!detached &&\n css`\n &::before {\n content: '';\n position: absolute;\n width: ${pxToRem(4)};\n inset-inline-start: 0;\n top: 0;\n bottom: 0;\n background-color: ${foreground};\n }\n `}\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n }) => {\n return css`\n --nav-padding: ${detached ? spacing : '0px'};\n `;\n }\n);\nStyledNavList.defaultProps = defaultThemeProp;\n\nexport const StyledNavCasesList = styled.div(({ theme }) => {\n return css`\n ${StyledNavListItem} {\n > :first-child {\n padding: ${theme.base.spacing} 0;\n }\n }\n `;\n});\n\nStyledNavCasesList.defaultProps = defaultThemeProp;\n\nexport const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {\n const {\n base: { 'border-radius': borderRadius },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { nestedList } = navContrastColors(theme);\n\n return css`\n background: ${nestedList};\n border-radius: ${detached ? borderRadius : '0px'};\n padding-block: var(--nav-padding);\n\n ${StyledNavListItem} {\n > :first-child {\n &:has(${StyledIcon}) {\n padding-inline-start: calc(\n ((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconWidth}\n );\n }\n\n &:not(:has(${StyledIcon})) {\n padding-inline-start: calc(${navWidth} - 3 * var(--nav-padding));\n }\n }\n }\n `;\n});\n\nStyledNestedNavList.defaultProps = defaultThemeProp;\n\nexport const StyledCaseTypes = styled.div(props => {\n const {\n theme: {\n base: {\n animation: {\n speed,\n timing: { ease: acceleration }\n }\n }\n }\n } = props;\n\n return css`\n button {\n ${StyledNavItemIconBox} {\n transition: transform ${speed} ${acceleration};\n }\n\n &[aria-expanded='false'] ${StyledNavItemIconBox} {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledNavItemIconBox} {\n transform: rotateZ(45deg);\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n return css`\n border-top: 0.0625rem solid ${theme.components['app-shell'].nav['border-color']};\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n margin: 0 calc((${navWidth} - ${iconWidth}) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background: ${mobileNavColor};\n color: ${foreground};\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n\n @media (height >= ${theme.base.breakpoints.sm}) {\n inset-block-start: 0;\n position: sticky;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n previewActive: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, previewActive, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n const appBackground = theme.base.palette['app-background'];\n\n return css`\n --appshell-offset: ${headerOffset}px;\n /* stylelint-disable-next-line length-zero-no-unit */\n --appshell-horizontal-offset: 0rem;\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n --appshell-horizontal-offset: ${navOpen ? navOpenWidth : navWidth};\n }\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background: ${appBackground};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n !mobileNav &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${!mobileNav &&\n css`\n transition: margin-inline-start\n ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n `}\n\n & > ${StyledProgressBackdrop} {\n max-height: calc(100vh - ${heightOffset});\n max-width: calc(100vw - ${navOpen ? navOpenWidth : navWidth});\n inset-block-start: ${heightOffset};\n inset-inline-start: ${navOpen ? navOpenWidth : navWidth};\n position: fixed;\n transition-property: opacity, max-height, max-width, inset-block-start, inset-inline-start;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n transition: margin-inline-end ${!mobileNav ? ', margin-inline-start' : ''};\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${previewActive &&\n css`\n transition: none;\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n `}\n }\n `;\n});\n\nStyledAppMain.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellTooltip = styled(StyledTooltip)(({ theme }) => {\n const bg = theme.components.tooltip['background-color'];\n const color = readableColor(bg);\n\n return css`\n background-color: ${bg};\n padding: 0;\n header {\n color: ${color};\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${bg};\n color: ${color};\n\n &:hover,\n &:focus {\n background-color: ${bg};\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n `;\n});\n\nStyledAppShellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n const { backgroundColor } = calculateBackgroundAndContrastColor(navBg, navFgColor);\n let bg = darken(0.2, backgroundColor);\n\n if (getContrast(backgroundColor, bg) < 1.3) {\n bg = lighten(0.2, backgroundColor);\n }\n\n return css`\n background: ${bg};\n color: ${navFgColor};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -30,9 +30,15 @@ export interface DrawerProps extends AsProp, BaseProps {
|
|
|
30
30
|
transitionSpeed?: string;
|
|
31
31
|
/**
|
|
32
32
|
* The width or height that the Drawer will open to, depending on its placement.
|
|
33
|
+
* If `resizeable`, is true this value will be overridden by the width set by the user.
|
|
33
34
|
* @default '100%'
|
|
34
35
|
*/
|
|
35
36
|
size?: string;
|
|
37
|
+
/**
|
|
38
|
+
* If true, the Drawer will be resizable. Will not be applied if `placement` is set to `top` or `bottom`.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
resizeable?: boolean;
|
|
36
42
|
/** Callback fired after Drawer opens. */
|
|
37
43
|
onAfterOpen?: () => void;
|
|
38
44
|
/** Callback fired after Drawer closes. */
|
|
@@ -53,6 +59,6 @@ type State = 'open' | 'closed' | 'opening' | 'closing';
|
|
|
53
59
|
export declare const StyledDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Partial<DrawerProps & {
|
|
54
60
|
state: State;
|
|
55
61
|
}>, never>;
|
|
56
|
-
declare const Drawer: FunctionComponent<DrawerProps & ForwardProps>;
|
|
62
|
+
export declare const Drawer: FunctionComponent<DrawerProps & ForwardProps>;
|
|
57
63
|
export default Drawer;
|
|
58
64
|
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EAIV,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAanE,MAAM,WAAW,WAAY,SAAQ,MAAM,EAAE,SAAS;IACpD;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,KAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,YAAY;WAA6C,KAAK;UAuCzE,CAAC;AAIH,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CA8J/D,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useCallback, forwardRef, useState } from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useCallback, forwardRef, useState, useRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { remToPx } from 'polished';
|
|
5
|
+
import { useOuterEvent, useConsolidatedRef, usePrevious, useDirection } from '../../hooks';
|
|
6
|
+
import { getChildOfRootNode, reflow } from '../../utils';
|
|
6
7
|
import { defaultThemeProp } from '../../theme';
|
|
8
|
+
import { resizeDrawerKeyboardStep, resizeDrawerMaxWidth, resizeDrawerMinWidth } from '../../styles/constants';
|
|
9
|
+
import ResizeHandle from './ResizeHandle';
|
|
10
|
+
const drawerMinWidth = remToPx(resizeDrawerMinWidth);
|
|
7
11
|
export const StyledDrawer = styled.div(props => {
|
|
8
|
-
const { state, shadow, position, placement, transitionSpeed, size, theme } = props;
|
|
12
|
+
const { state, shadow, position, placement, transitionSpeed, size, resizeable, theme } = props;
|
|
9
13
|
let dimension = 'horizontal';
|
|
10
14
|
let axis = 'X';
|
|
11
15
|
let anchor = 'top';
|
|
@@ -34,12 +38,18 @@ export const StyledDrawer = styled.div(props => {
|
|
|
34
38
|
css `
|
|
35
39
|
box-shadow: ${theme.base.shadow.high};
|
|
36
40
|
`}
|
|
41
|
+
|
|
42
|
+
${resizeable &&
|
|
43
|
+
css `
|
|
44
|
+
width: ${dimension === 'horizontal' ? 'var(--resize-drawer-width)' : '100%'};
|
|
45
|
+
`}
|
|
37
46
|
`;
|
|
38
47
|
});
|
|
39
48
|
StyledDrawer.defaultProps = defaultThemeProp;
|
|
40
|
-
const Drawer = forwardRef(function Drawer(props, ref) {
|
|
41
|
-
const { open = false, shadow = false, position = 'absolute', children, placement = 'right', transitionSpeed, size = '100%', onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, onOuterClick, nullWhenClosed = false, ...restProps } = props;
|
|
49
|
+
export const Drawer = forwardRef(function Drawer(props, ref) {
|
|
50
|
+
const { open = false, shadow = false, position = 'absolute', children, placement = 'right', transitionSpeed, size = '100%', resizeable = false, onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, onOuterClick, nullWhenClosed = false, ...restProps } = props;
|
|
42
51
|
const drawerRef = useConsolidatedRef(ref);
|
|
52
|
+
const { ltr, rtl } = useDirection();
|
|
43
53
|
const [state, setState] = useState(open ? 'open' : 'closed');
|
|
44
54
|
let prevState = usePrevious(state);
|
|
45
55
|
if (!prevState)
|
|
@@ -70,7 +80,54 @@ const Drawer = forwardRef(function Drawer(props, ref) {
|
|
|
70
80
|
return;
|
|
71
81
|
setState(open ? 'open' : 'closed');
|
|
72
82
|
}, [open]);
|
|
73
|
-
|
|
83
|
+
const dragStartXRef = useRef();
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const targetNode = getChildOfRootNode(drawerRef);
|
|
86
|
+
if (!targetNode)
|
|
87
|
+
return;
|
|
88
|
+
if (!targetNode.style.getPropertyValue('--resize-drawer-width')) {
|
|
89
|
+
targetNode.style.setProperty('--resize-drawer-width', size);
|
|
90
|
+
}
|
|
91
|
+
}, [drawerRef.current]);
|
|
92
|
+
const handleResize = useCallback((e) => {
|
|
93
|
+
const targetNode = getChildOfRootNode(drawerRef);
|
|
94
|
+
const rect = drawerRef.current?.getBoundingClientRect();
|
|
95
|
+
if (!rect || !targetNode)
|
|
96
|
+
return;
|
|
97
|
+
dragStartXRef.current = e.clientX;
|
|
98
|
+
const ac = new AbortController();
|
|
99
|
+
targetNode.addEventListener('mousemove', moveEvent => {
|
|
100
|
+
if (!dragStartXRef.current || !rect.width)
|
|
101
|
+
return;
|
|
102
|
+
const initialX = dragStartXRef.current;
|
|
103
|
+
const widthDiff = placement === 'right' ? initialX - moveEvent.clientX : moveEvent.clientX - initialX;
|
|
104
|
+
const newWidth = Math.max(widthDiff + rect.width, parseInt(drawerMinWidth, 10));
|
|
105
|
+
// Set root-level CSS variable to communicate width to AppShell
|
|
106
|
+
targetNode.style.setProperty('--resize-drawer-width', `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`);
|
|
107
|
+
}, { passive: true, signal: ac.signal });
|
|
108
|
+
targetNode.addEventListener('mouseup', () => {
|
|
109
|
+
ac.abort();
|
|
110
|
+
}, { once: true });
|
|
111
|
+
}, [placement]);
|
|
112
|
+
const keyboardResize = useCallback((e, grabbed) => {
|
|
113
|
+
if (!grabbed)
|
|
114
|
+
return;
|
|
115
|
+
const targetNode = getChildOfRootNode(drawerRef);
|
|
116
|
+
const resizeStep = document.documentElement.clientWidth * resizeDrawerKeyboardStep;
|
|
117
|
+
const rect = drawerRef.current?.getBoundingClientRect();
|
|
118
|
+
if (!rect || !targetNode)
|
|
119
|
+
return;
|
|
120
|
+
if (e.code !== 'ArrowLeft' && e.code !== 'ArrowRight')
|
|
121
|
+
return;
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
const resizeDirection = (e.code === 'ArrowLeft' ? 1 : -1) * (placement === 'right' ? 1 : -1);
|
|
124
|
+
const newWidth = Math.max(rect.width + resizeDirection * resizeStep, parseInt(drawerMinWidth, 10));
|
|
125
|
+
targetNode.style.setProperty('--resize-drawer-width', `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`);
|
|
126
|
+
}, [placement]);
|
|
127
|
+
const renderResizeHandle = resizeable &&
|
|
128
|
+
state === 'open' &&
|
|
129
|
+
((placement === 'left' && rtl) || (placement === 'right' && ltr));
|
|
130
|
+
return state === 'closed' && !open && nullWhenClosed ? null : (_jsxs(StyledDrawer, { ref: drawerRef, position: position, shadow: shadow && open, transitionSpeed: transitionSpeed, placement: placement, size: size, resizeable: resizeable, open: open, state: state, onTransitionEnd: onTransitionEnd, ...restProps, children: [children, renderResizeHandle && _jsx(ResizeHandle, { onMouseDown: handleResize, onKeyDown: keyboardResize })] }));
|
|
74
131
|
});
|
|
75
132
|
export default Drawer;
|
|
76
133
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsD/C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0C,KAAK,CAAC,EAAE;IACtF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CA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AAI,KAAK,KAAK,MAAM,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;YAC5D,WAAW,EAAE,EAAE,CAAC;QAClB,CAAC;aAAM,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YACjE,YAAY,EAAE,EAAE,CAAC;QACnB,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAErF,MAAM,eAAe,GAAG,WAAW,CACjC,CAAC,CAAkB,EAAQ,EAAE;QAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,YAAY,KAAK,WAAW;YAAE,OAAO;QAC7E,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,EACD,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IAAI,IAAI,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,YAEZ,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useEffect, useCallback, forwardRef, useState } from 'react';\nimport type { Ref, FunctionComponent, ReactNode, TransitionEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious } from '../../hooks';\nimport type { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default 'right'\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * The position of the Drawer.\n * @default 'absolute'\n */\n position?: 'absolute' | 'fixed';\n /**\n * Determines the speed of the transition. This value comes from `theme.base.animation.speed`.\n * @default '0.25s'\n */\n transitionSpeed?: string;\n /**\n * The width or height that the Drawer will open to, depending on its placement.\n * @default '100%'\n */\n size?: string;\n /** Callback fired after Drawer opens. */\n onAfterOpen?: () => void;\n /** Callback fired after Drawer closes. */\n onAfterClose?: () => void;\n /** Callback fired before Drawer opens. */\n onBeforeOpen?: () => void;\n /** Callback fired before Drawer closes. */\n onBeforeClose?: () => void;\n /** Callback fired when a click action occurs outside of the Drawer. */\n onOuterClick?: () => void;\n /**\n * If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenClosed?: boolean;\n}\n\ntype State = 'open' | 'closed' | 'opening' | 'closing';\n\nexport const StyledDrawer = styled.div<Partial<DrawerProps & { state: State }>>(props => {\n const { state, shadow, position, placement, transitionSpeed, size, theme } = props;\n let dimension = 'horizontal';\n let axis = 'X';\n let anchor = 'top';\n\n if (placement === 'top' || placement === 'bottom') {\n dimension = 'vertical';\n axis = 'Y';\n anchor = 'left';\n }\n\n const translate = state === 'open' || state === 'opening' ? 0 : '100%';\n const speed = transitionSpeed || theme.base.animation.speed;\n\n return css`\n z-index: ${theme.base['z-index'].drawer};\n position: ${position};\n ${placement}: 0;\n ${anchor}: 0;\n height: ${dimension === 'vertical' ? size : '100%'};\n width: ${dimension === 'horizontal' ? size : '100%'};\n transition-property: transform, box-shadow, opacity;\n transition-duration: max(${speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n transform: ${state === 'open'\n ? 'none'\n : `translate${axis}(${placement === 'top' || placement === 'left' ? '-' : ''}${translate})`};\n\n ${shadow &&\n css`\n box-shadow: ${theme.base.shadow.high};\n `}\n `;\n});\n\nStyledDrawer.defaultProps = defaultThemeProp;\n\nconst Drawer: FunctionComponent<DrawerProps & ForwardProps> = forwardRef(function Drawer(\n props: DrawerProps,\n ref: Ref<HTMLElement>\n) {\n const {\n open = false,\n shadow = false,\n position = 'absolute',\n children,\n placement = 'right',\n transitionSpeed,\n size = '100%',\n onAfterOpen,\n onAfterClose,\n onBeforeOpen,\n onBeforeClose,\n onOuterClick,\n nullWhenClosed = false,\n ...restProps\n } = props;\n\n const drawerRef = useConsolidatedRef(ref);\n\n const [state, setState] = useState<State>(open ? 'open' : 'closed');\n\n let prevState = usePrevious(state);\n if (!prevState) prevState = state;\n\n useOuterEvent(\n 'mousedown',\n [drawerRef],\n useCallback(() => {\n if (open) onOuterClick?.();\n }, [open, onOuterClick])\n );\n\n useEffect(() => {\n if (open && (state === 'closed' || state === 'closing')) {\n onBeforeOpen?.();\n reflow(drawerRef.current);\n setState('opening');\n } else if (!open && (state === 'open' || state === 'opening')) {\n onBeforeClose?.();\n setState('closing');\n } else if (open && state === 'open' && prevState !== 'open') {\n onAfterOpen?.();\n } else if (!open && state === 'closed' && prevState !== 'closed') {\n onAfterClose?.();\n }\n }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent): void => {\n if (e.target !== drawerRef.current || e.propertyName !== 'transform') return;\n setState(open ? 'open' : 'closed');\n },\n [open]\n );\n\n return state === 'closed' && !open && nullWhenClosed ? null : (\n <StyledDrawer\n ref={drawerRef}\n position={position}\n shadow={shadow && open}\n transitionSpeed={transitionSpeed}\n placement={placement}\n size={size}\n open={open}\n state={state}\n onTransitionEnd={onTransitionEnd}\n {...restProps}\n >\n {children}\n </StyledDrawer>\n );\n});\n\nexport default Drawer;\n"]}
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAS7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AA4DrD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0C,KAAK,CAAC,EAAE;IACtF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/F,IAAI,SAAS,GAAG,YAAY,CAAC;IAC7B,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClD,SAAS,GAAG,UAAU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EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,aAEZ,QAAQ,EACR,kBAAkB,IAAI,KAAC,YAAY,IAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,GAAI,IAChF,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useEffect, useCallback, forwardRef, useState, useRef } from 'react';\nimport type {\n Ref,\n FunctionComponent,\n ReactNode,\n TransitionEvent,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { remToPx } from 'polished';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious, useDirection } from '../../hooks';\nimport type { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { getChildOfRootNode, reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\nimport {\n resizeDrawerKeyboardStep,\n resizeDrawerMaxWidth,\n resizeDrawerMinWidth\n} from '../../styles/constants';\n\nimport ResizeHandle from './ResizeHandle';\n\nconst drawerMinWidth = remToPx(resizeDrawerMinWidth);\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default 'right'\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * The position of the Drawer.\n * @default 'absolute'\n */\n position?: 'absolute' | 'fixed';\n /**\n * Determines the speed of the transition. This value comes from `theme.base.animation.speed`.\n * @default '0.25s'\n */\n transitionSpeed?: string;\n /**\n * The width or height that the Drawer will open to, depending on its placement.\n * If `resizeable`, is true this value will be overridden by the width set by the user.\n * @default '100%'\n */\n size?: string;\n /**\n * If true, the Drawer will be resizable. Will not be applied if `placement` is set to `top` or `bottom`.\n * @default false\n */\n resizeable?: boolean;\n /** Callback fired after Drawer opens. */\n onAfterOpen?: () => void;\n /** Callback fired after Drawer closes. */\n onAfterClose?: () => void;\n /** Callback fired before Drawer opens. */\n onBeforeOpen?: () => void;\n /** Callback fired before Drawer closes. */\n onBeforeClose?: () => void;\n /** Callback fired when a click action occurs outside of the Drawer. */\n onOuterClick?: () => void;\n /**\n * If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenClosed?: boolean;\n}\n\ntype State = 'open' | 'closed' | 'opening' | 'closing';\n\nexport const StyledDrawer = styled.div<Partial<DrawerProps & { state: State }>>(props => {\n const { state, shadow, position, placement, transitionSpeed, size, resizeable, theme } = props;\n let dimension = 'horizontal';\n let axis = 'X';\n let anchor = 'top';\n\n if (placement === 'top' || placement === 'bottom') {\n dimension = 'vertical';\n axis = 'Y';\n anchor = 'left';\n }\n\n const translate = state === 'open' || state === 'opening' ? 0 : '100%';\n const speed = transitionSpeed || theme.base.animation.speed;\n\n return css`\n z-index: ${theme.base['z-index'].drawer};\n position: ${position};\n ${placement}: 0;\n ${anchor}: 0;\n height: ${dimension === 'vertical' ? size : '100%'};\n width: ${dimension === 'horizontal' ? size : '100%'};\n transition-property: transform, box-shadow, opacity;\n transition-duration: max(${speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n transform: ${state === 'open'\n ? 'none'\n : `translate${axis}(${placement === 'top' || placement === 'left' ? '-' : ''}${translate})`};\n\n ${shadow &&\n css`\n box-shadow: ${theme.base.shadow.high};\n `}\n\n ${resizeable &&\n css`\n width: ${dimension === 'horizontal' ? 'var(--resize-drawer-width)' : '100%'};\n `}\n `;\n});\n\nStyledDrawer.defaultProps = defaultThemeProp;\n\nexport const Drawer: FunctionComponent<DrawerProps & ForwardProps> = forwardRef(function Drawer(\n props: DrawerProps,\n ref: Ref<HTMLElement>\n) {\n const {\n open = false,\n shadow = false,\n position = 'absolute',\n children,\n placement = 'right',\n transitionSpeed,\n size = '100%',\n resizeable = false,\n onAfterOpen,\n onAfterClose,\n onBeforeOpen,\n onBeforeClose,\n onOuterClick,\n nullWhenClosed = false,\n ...restProps\n } = props;\n\n const drawerRef = useConsolidatedRef(ref);\n const { ltr, rtl } = useDirection();\n\n const [state, setState] = useState<State>(open ? 'open' : 'closed');\n\n let prevState = usePrevious(state);\n if (!prevState) prevState = state;\n\n useOuterEvent(\n 'mousedown',\n [drawerRef],\n useCallback(() => {\n if (open) onOuterClick?.();\n }, [open, onOuterClick])\n );\n\n useEffect(() => {\n if (open && (state === 'closed' || state === 'closing')) {\n onBeforeOpen?.();\n reflow(drawerRef.current);\n setState('opening');\n } else if (!open && (state === 'open' || state === 'opening')) {\n onBeforeClose?.();\n setState('closing');\n } else if (open && state === 'open' && prevState !== 'open') {\n onAfterOpen?.();\n } else if (!open && state === 'closed' && prevState !== 'closed') {\n onAfterClose?.();\n }\n }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent): void => {\n if (e.target !== drawerRef.current || e.propertyName !== 'transform') return;\n setState(open ? 'open' : 'closed');\n },\n [open]\n );\n\n const dragStartXRef = useRef<number>();\n\n useEffect(() => {\n const targetNode = getChildOfRootNode(drawerRef);\n if (!targetNode) return;\n if (!targetNode.style.getPropertyValue('--resize-drawer-width')) {\n targetNode.style.setProperty('--resize-drawer-width', size);\n }\n }, [drawerRef.current]);\n\n const handleResize = useCallback(\n (e: ReactMouseEvent) => {\n const targetNode = getChildOfRootNode(drawerRef);\n const rect = drawerRef.current?.getBoundingClientRect();\n if (!rect || !targetNode) return;\n\n dragStartXRef.current = e.clientX;\n\n const ac = new AbortController();\n targetNode.addEventListener(\n 'mousemove',\n moveEvent => {\n if (!dragStartXRef.current || !rect.width) return;\n\n const initialX = dragStartXRef.current;\n const widthDiff =\n placement === 'right' ? initialX - moveEvent.clientX : moveEvent.clientX - initialX;\n\n const newWidth = Math.max(widthDiff + rect.width, parseInt(drawerMinWidth, 10));\n\n // Set root-level CSS variable to communicate width to AppShell\n targetNode.style.setProperty(\n '--resize-drawer-width',\n `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`\n );\n },\n { passive: true, signal: ac.signal }\n );\n\n targetNode.addEventListener(\n 'mouseup',\n () => {\n ac.abort();\n },\n { once: true }\n );\n },\n [placement]\n );\n\n const keyboardResize = useCallback(\n (e: ReactKeyboardEvent, grabbed: boolean) => {\n if (!grabbed) return;\n const targetNode = getChildOfRootNode(drawerRef);\n const resizeStep = document.documentElement.clientWidth * resizeDrawerKeyboardStep;\n const rect = drawerRef.current?.getBoundingClientRect();\n if (!rect || !targetNode) return;\n if (e.code !== 'ArrowLeft' && e.code !== 'ArrowRight') return;\n e.preventDefault();\n\n const resizeDirection = (e.code === 'ArrowLeft' ? 1 : -1) * (placement === 'right' ? 1 : -1);\n\n const newWidth = Math.max(\n rect.width + resizeDirection * resizeStep,\n parseInt(drawerMinWidth, 10)\n );\n targetNode.style.setProperty(\n '--resize-drawer-width',\n `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`\n );\n },\n [placement]\n );\n\n const renderResizeHandle =\n resizeable &&\n state === 'open' &&\n ((placement === 'left' && rtl) || (placement === 'right' && ltr));\n\n return state === 'closed' && !open && nullWhenClosed ? null : (\n <StyledDrawer\n ref={drawerRef}\n position={position}\n shadow={shadow && open}\n transitionSpeed={transitionSpeed}\n placement={placement}\n size={size}\n resizeable={resizeable}\n open={open}\n state={state}\n onTransitionEnd={onTransitionEnd}\n {...restProps}\n >\n {children}\n {renderResizeHandle && <ResizeHandle onMouseDown={handleResize} onKeyDown={keyboardResize} />}\n </StyledDrawer>\n );\n});\n\nexport default Drawer;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
2
|
+
export interface ResizeHandleProps {
|
|
3
|
+
onKeyDown: (e: ReactKeyboardEvent, grabbed: boolean) => void;
|
|
4
|
+
onMouseDown: (e: ReactMouseEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const StyledResizeHandle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
declare const ResizeHandle: import("react").ForwardRefExoticComponent<ResizeHandleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default ResizeHandle;
|
|
9
|
+
//# sourceMappingURL=ResizeHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/ResizeHandle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,UAAU,IAAI,eAAe,EAC7B,aAAa,IAAI,kBAAkB,EACpC,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAyBD,eAAO,MAAM,kBAAkB,yGA8B7B,CAAC;AAIH,QAAA,MAAM,YAAY,8GAqEhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { hideVisually } from 'polished';
|
|
5
|
+
import Button, { StyledButton } from '../Button';
|
|
6
|
+
import Icon, { registerIcon, StyledIcon } from '../Icon';
|
|
7
|
+
import { useConsolidatedRef, useEscape, useI18n } from '../../hooks';
|
|
8
|
+
import { getChildOfRootNode } from '../../utils';
|
|
9
|
+
import { defaultThemeProp } from '../../theme';
|
|
10
|
+
import * as DragIcon from '../Icon/icons/drag.icon';
|
|
11
|
+
import * as ArrowUpDownIcon from '../Icon/icons/arrow-micro-up-down.icon';
|
|
12
|
+
registerIcon(DragIcon);
|
|
13
|
+
registerIcon(ArrowUpDownIcon);
|
|
14
|
+
const StyledResizeButton = styled(Button)(({ rotateIcon }) => {
|
|
15
|
+
return css `
|
|
16
|
+
cursor: grab;
|
|
17
|
+
|
|
18
|
+
&:active {
|
|
19
|
+
cursor: grabbing;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:not(:focus) {
|
|
23
|
+
${hideVisually};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${rotateIcon &&
|
|
27
|
+
css `
|
|
28
|
+
${StyledIcon} {
|
|
29
|
+
transform: rotate(90deg);
|
|
30
|
+
}
|
|
31
|
+
`}
|
|
32
|
+
`;
|
|
33
|
+
});
|
|
34
|
+
export const StyledResizeHandle = styled.div(({ theme }) => {
|
|
35
|
+
return css `
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset-inline-start: 0;
|
|
38
|
+
inset-block: 0;
|
|
39
|
+
inline-size: 0.125rem;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
transition: background-color ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
42
|
+
cursor: ew-resize;
|
|
43
|
+
z-index: ${theme.base['z-index'].max};
|
|
44
|
+
|
|
45
|
+
::before {
|
|
46
|
+
content: '';
|
|
47
|
+
position: absolute;
|
|
48
|
+
inset: 0;
|
|
49
|
+
width: calc(${theme.base['hit-area'].compact} * 0.75);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: ${theme.base.palette.interactive};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${StyledButton} {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset-block-start: 50%;
|
|
59
|
+
inset-inline-start: calc(-2 * ${theme.base.spacing});
|
|
60
|
+
translate: 0 -50%;
|
|
61
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
});
|
|
65
|
+
StyledResizeHandle.defaultProps = defaultThemeProp;
|
|
66
|
+
const ResizeHandle = forwardRef(function ResizeHandle({ onMouseDown, onKeyDown }, ref) {
|
|
67
|
+
const resizeHandleRef = useConsolidatedRef(ref);
|
|
68
|
+
const t = useI18n();
|
|
69
|
+
const [mouseGrabbed, setMouseGrabbed] = useState(false);
|
|
70
|
+
const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);
|
|
71
|
+
useEscape(() => {
|
|
72
|
+
setMouseGrabbed(false);
|
|
73
|
+
setKeyboardGrabbed(false);
|
|
74
|
+
});
|
|
75
|
+
const handleKeyDown = (e) => {
|
|
76
|
+
if (e.code === 'Space') {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
if (keyboardGrabbed) {
|
|
79
|
+
setKeyboardGrabbed(false);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
setKeyboardGrabbed(true);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
onKeyDown?.(e, keyboardGrabbed);
|
|
86
|
+
};
|
|
87
|
+
const handleMouseDown = (e) => {
|
|
88
|
+
const targetNode = getChildOfRootNode(resizeHandleRef);
|
|
89
|
+
if (!targetNode)
|
|
90
|
+
return;
|
|
91
|
+
targetNode.style.setProperty('user-select', 'none');
|
|
92
|
+
setMouseGrabbed(true);
|
|
93
|
+
onMouseDown?.(e);
|
|
94
|
+
};
|
|
95
|
+
const handleMouseUp = () => {
|
|
96
|
+
const targetNode = getChildOfRootNode(resizeHandleRef);
|
|
97
|
+
if (!targetNode)
|
|
98
|
+
return;
|
|
99
|
+
targetNode.style.removeProperty('user-select');
|
|
100
|
+
setMouseGrabbed(false);
|
|
101
|
+
};
|
|
102
|
+
return (_jsx(StyledResizeHandle, { onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, ref: resizeHandleRef, children: _jsx(StyledResizeButton, { tabIndex: 0, icon: true, label: !mouseGrabbed && !keyboardGrabbed ? t('resize') : undefined, "aria-label": !mouseGrabbed && !keyboardGrabbed
|
|
103
|
+
? t('drag_handle_activate_description')
|
|
104
|
+
: t('drag_handle_cancel_description'), onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, onBlur: () => {
|
|
105
|
+
setKeyboardGrabbed(false);
|
|
106
|
+
}, rotateIcon: keyboardGrabbed, children: _jsx(Icon, { name: keyboardGrabbed ? 'arrow-micro-up-down' : 'drag' }) }) }));
|
|
107
|
+
});
|
|
108
|
+
export default ResizeHandle;
|
|
109
|
+
//# sourceMappingURL=ResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeHandle.js","sourceRoot":"","sources":["../../../src/components/Drawer/ResizeHandle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAO7C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,wCAAwC,CAAC;AAE1E,YAAY,CAAC,QAAQ,C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,KAAK,EAAE,CAAC,YAAY,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,gBAEhE,CAAC,YAAY,IAAI,CAAC,eAAe;gBAC/B,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC;gBACvC,CAAC,CAAC,CAAC,CAAC,gCAAgC,CAAC,EAEzC,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,GAAG,EAAE;gBACX,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,UAAU,EAAE,eAAe,YAE3B,KAAC,IAAI,IAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,GAAI,GAC7C,GACF,CACtB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useState } from 'react';\nimport type {\n PropsWithoutRef,\n Ref,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport Button, { StyledButton } from '../Button';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport { useConsolidatedRef, useEscape, useI18n } from '../../hooks';\nimport { getChildOfRootNode } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\nimport * as DragIcon from '../Icon/icons/drag.icon';\nimport * as ArrowUpDownIcon from '../Icon/icons/arrow-micro-up-down.icon';\n\nregisterIcon(DragIcon);\nregisterIcon(ArrowUpDownIcon);\n\nexport interface ResizeHandleProps {\n onKeyDown: (e: ReactKeyboardEvent, grabbed: boolean) => void;\n onMouseDown: (e: ReactMouseEvent) => void;\n}\n\nconst StyledResizeButton = styled(Button)<{\n rotateIcon?: boolean;\n}>(({ rotateIcon }) => {\n return css`\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &:not(:focus) {\n ${hideVisually};\n }\n\n ${rotateIcon &&\n css`\n ${StyledIcon} {\n transform: rotate(90deg);\n }\n `}\n `;\n});\n\nexport const StyledResizeHandle = styled.div(({ theme }) => {\n return css`\n position: absolute;\n inset-inline-start: 0;\n inset-block: 0;\n inline-size: 0.125rem;\n background-color: transparent;\n transition: background-color ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n cursor: ew-resize;\n z-index: ${theme.base['z-index'].max};\n\n ::before {\n content: '';\n position: absolute;\n inset: 0;\n width: calc(${theme.base['hit-area'].compact} * 0.75);\n }\n\n &:hover {\n background-color: ${theme.base.palette.interactive};\n }\n\n ${StyledButton} {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: calc(-2 * ${theme.base.spacing});\n translate: 0 -50%;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledResizeHandle.defaultProps = defaultThemeProp;\n\nconst ResizeHandle = forwardRef(function ResizeHandle(\n { onMouseDown, onKeyDown }: PropsWithoutRef<ResizeHandleProps>,\n ref: Ref<HTMLDivElement>\n) {\n const resizeHandleRef = useConsolidatedRef<HTMLDivElement>(ref);\n const t = useI18n();\n\n const [mouseGrabbed, setMouseGrabbed] = useState(false);\n const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);\n\n useEscape(() => {\n setMouseGrabbed(false);\n setKeyboardGrabbed(false);\n });\n\n const handleKeyDown = (e: ReactKeyboardEvent) => {\n if (e.code === 'Space') {\n e.preventDefault();\n if (keyboardGrabbed) {\n setKeyboardGrabbed(false);\n } else {\n setKeyboardGrabbed(true);\n }\n }\n\n onKeyDown?.(e, keyboardGrabbed);\n };\n\n const handleMouseDown = (e: ReactMouseEvent) => {\n const targetNode = getChildOfRootNode(resizeHandleRef);\n if (!targetNode) return;\n targetNode.style.setProperty('user-select', 'none');\n setMouseGrabbed(true);\n onMouseDown?.(e);\n };\n\n const handleMouseUp = () => {\n const targetNode = getChildOfRootNode(resizeHandleRef);\n if (!targetNode) return;\n targetNode.style.removeProperty('user-select');\n setMouseGrabbed(false);\n };\n\n return (\n <StyledResizeHandle\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n ref={resizeHandleRef}\n >\n <StyledResizeButton\n tabIndex={0}\n icon\n label={!mouseGrabbed && !keyboardGrabbed ? t('resize') : undefined}\n aria-label={\n !mouseGrabbed && !keyboardGrabbed\n ? t('drag_handle_activate_description')\n : t('drag_handle_cancel_description')\n }\n onMouseDown={handleMouseDown}\n onKeyDown={handleKeyDown}\n onBlur={() => {\n setKeyboardGrabbed(false);\n }}\n rotateIcon={keyboardGrabbed}\n >\n <Icon name={keyboardGrabbed ? 'arrow-micro-up-down' : 'drag'} />\n </StyledResizeButton>\n </StyledResizeHandle>\n );\n});\n\nexport default ResizeHandle;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default, StyledDrawer } from './Drawer';\nexport type { DrawerProps } from './Drawer';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default, StyledDrawer } from './Drawer';\nexport { default as ResizeHandle } from './ResizeHandle';\nexport type { DrawerProps } from './Drawer';\nexport type { ResizeHandleProps } from './ResizeHandle';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTemplates.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAe3E,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMvD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PageTemplates.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAe3E,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMvD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9C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M,aAAa;SAAqB,OAAO;SAepD,CAAC;AAGH,eAAO,MAAM,aAAa,yGAAe,CAAC;AAG1C,eAAO,MAAM,wBAAwB,EAAE,OAAO,QAK5C,CAAC;AAIH,eAAO,MAAM,gBAAgB;mBACZ,eAAe,CAAC,eAAe,CAAC;uBAC5B,MAAM;SAkC1B,CAAC;AAqTF,eAAO,MAAM,UAAU,EAAE,+BAA+B,CAAC,eAAe,CA6DvE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,+BAA+B,CAAC,sBAAsB,CAMlF,CAAC;AAEL,eAAO,MAAM,aAAa,EAAE,+BAA+B,CAAC,kBAAkB,CAO7E,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,+BAA+B,CAAC,kBAAkB,CAS7E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,+BAA+B,CAAC,oBAAoB,CASjF,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,+BAA+B,CAAC,mBAAmB,CAc/E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,+BAA+B,CAAC,mBAAmB,CAS/E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,+BAA+B,CAAC,mBAAmB,CAS/E,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,+BAA+B,CAAC,uBAAuB,CAapF,CAAC;AAEL,eAAO,MAAM,kBAAkB,EAAE,+BAA+B,CAAC,uBAAuB,CAapF,CAAC;AAEL,eAAO,MAAM,oBAAoB,EAAE,+BAA+B,CAAC,yBAAyB,CAaxF,CAAC"}
|
|
@@ -14,8 +14,9 @@ import Icon from '../Icon';
|
|
|
14
14
|
import SummaryItem from '../SummaryItem';
|
|
15
15
|
import Tabs, { TabPanel } from '../Tabs';
|
|
16
16
|
import { StyledTabPanel } from '../Tabs/TabPanel';
|
|
17
|
-
import { StyledTabs, StylesAllTabsButtonWrapper } from '../Tabs/Tabs.styles';
|
|
17
|
+
import { StyledAllTabsWrapper, StyledTabs, StylesAllTabsButtonWrapper } from '../Tabs/Tabs.styles';
|
|
18
18
|
import Text from '../Text';
|
|
19
|
+
import { StyledMenuButton } from '../MenuButton/MenuButton';
|
|
19
20
|
export const StyledPageIcon = styled(Flex)(({ theme }) => {
|
|
20
21
|
const bgColor = theme.base.palette['brand-primary'];
|
|
21
22
|
const color = tryCatch(() => readableColor(bgColor));
|
|
@@ -31,6 +32,7 @@ StyledPageIcon.defaultProps = defaultThemeProp;
|
|
|
31
32
|
export const StyledPageHeader = styled.header(({ theme }) => {
|
|
32
33
|
const appBg = theme.base.palette['app-background'];
|
|
33
34
|
const appFg = theme.base.palette['app-foreground'];
|
|
35
|
+
const tabsDetached = theme.components.tabs.detached;
|
|
34
36
|
const color = calculateForegroundColor(appBg, appFg);
|
|
35
37
|
return css `
|
|
36
38
|
h1 {
|
|
@@ -49,6 +51,29 @@ export const StyledPageHeader = styled.header(({ theme }) => {
|
|
|
49
51
|
${StyledBanner}, ${StyledTabs}, ${StylesAllTabsButtonWrapper} {
|
|
50
52
|
margin-block-start: calc(2 * ${theme.base.spacing});
|
|
51
53
|
}
|
|
54
|
+
|
|
55
|
+
${tabsDetached &&
|
|
56
|
+
css `
|
|
57
|
+
${StyledAllTabsWrapper} {
|
|
58
|
+
margin-block-start: calc(2 * ${theme.base.spacing});
|
|
59
|
+
border-radius: var(--border-radius, ${theme.base['border-radius']});
|
|
60
|
+
border-end-start-radius: 0;
|
|
61
|
+
|
|
62
|
+
${StyledTabs} {
|
|
63
|
+
border-radius: unset;
|
|
64
|
+
border-start-end-radius: inherit;
|
|
65
|
+
margin-block-start: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${StylesAllTabsButtonWrapper} {
|
|
69
|
+
margin-block-start: 0;
|
|
70
|
+
|
|
71
|
+
${StyledMenuButton} {
|
|
72
|
+
border-start-start-radius: var(--border-radius, ${theme.base['border-radius']});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`}
|
|
52
77
|
`;
|
|
53
78
|
});
|
|
54
79
|
StyledPageHeader.defaultProps = defaultThemeProp;
|