@pega/cosmos-react-core 10.0.0-build.9.1 → 10.0.0-build.9.2
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.d.ts +2 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +2 -2
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +1 -0
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +28 -4
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/TouchAppShell.d.ts +11 -25
- package/lib/components/AppShell/TouchAppShell.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.js +35 -12
- package/lib/components/AppShell/TouchAppShell.js.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.d.ts +200 -1
- package/lib/components/AppShell/TouchAppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.js +44 -3
- package/lib/components/AppShell/TouchAppShell.styles.js.map +1 -1
- package/lib/components/Dialog/TouchDialog.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.js +37 -12
- package/lib/components/Dialog/TouchDialog.js.map +1 -1
- package/lib/components/Dialog/TouchDialog.styles.d.ts +7 -0
- package/lib/components/Dialog/TouchDialog.styles.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.styles.js +15 -0
- package/lib/components/Dialog/TouchDialog.styles.js.map +1 -1
- package/lib/components/Dialog/TouchDialog.types.d.ts +10 -2
- package/lib/components/Dialog/TouchDialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.types.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +3 -2
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/theme/themes/orionDarkTheme.json +2 -1
- package/lib/theme/themes/orionTheme.json +3 -3
- package/lib/theme/themes/virgoDarkTheme.json +2 -1
- package/lib/theme/themes/virgoTheme.json +2 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
1
|
+
import styled, { createGlobalStyle, css } from 'styled-components';
|
|
2
2
|
import { rem, transparentize } from 'polished';
|
|
3
3
|
import { useContext } from 'react';
|
|
4
4
|
import { StyledAlert } from '../Badges/Alert';
|
|
@@ -6,6 +6,8 @@ import { StyledLink } from '../Link/Link';
|
|
|
6
6
|
import { StyledBareButton } from '../Button/BareButton';
|
|
7
7
|
import Button from '../Button';
|
|
8
8
|
import { StyledDrawer } from '../Drawer';
|
|
9
|
+
import { TouchDialog } from '../Dialog';
|
|
10
|
+
import Flex from '../Flex';
|
|
9
11
|
import { defaultThemeProp } from '../../theme';
|
|
10
12
|
import { calculateFontSize } from '../../styles';
|
|
11
13
|
import { ellipsisOverflow } from '../../styles/mixins';
|
|
@@ -13,6 +15,44 @@ import { useDirection } from '../../hooks';
|
|
|
13
15
|
import AppShellContext from './AppShellContext';
|
|
14
16
|
import { menuButtonWidth, mobileHeaderHeight, StyledCountIcon, StyledNavItemIconBox, StyledNavList, StyledNavListItem, StyledNavListItemVisualContainer, StyledAppNav } from './AppShell.styles';
|
|
15
17
|
import { navContrastColors } from './style-utils';
|
|
18
|
+
export const TouchAppShellGlobalStyle = createGlobalStyle `
|
|
19
|
+
:root,
|
|
20
|
+
:host {
|
|
21
|
+
--appshell-bottom-panel-offset: ${({ hasBottomTouchPanel }) => hasBottomTouchPanel ? '4rem' : '0rem'};
|
|
22
|
+
--appshell-bottom-panel-gap: ${({ hasBottomTouchPanel, theme }) => hasBottomTouchPanel ? `calc(2 * ${theme?.base.spacing})` : '0rem'};
|
|
23
|
+
--appshell-bottom-offset: ${({ hasBottomTouchPanel, isMobileNav }) => `calc(var(--appshell-hard-bottom-offset) + ${isMobileNav ? mobileHeaderHeight : '0rem'}${hasBottomTouchPanel ? ' + var(--appshell-bottom-panel-offset)' : ''})`};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export const StyledMainTouchAppShell = styled.div(({ active, theme }) => css `
|
|
27
|
+
${active &&
|
|
28
|
+
css `
|
|
29
|
+
background: ${theme.base.colors.black};
|
|
30
|
+
`}
|
|
31
|
+
`);
|
|
32
|
+
StyledMainTouchAppShell.defaultProps = defaultThemeProp;
|
|
33
|
+
export const StyledSplitViewPanel = styled.div(({ active, theme }) => {
|
|
34
|
+
const splitViewHeight = active
|
|
35
|
+
? 'calc(var(--appshell-bottom-panel-offset, 0rem) + var(--appshell-bottom-panel-gap, 0rem))'
|
|
36
|
+
: '0rem';
|
|
37
|
+
return css `
|
|
38
|
+
position: fixed;
|
|
39
|
+
inset-block-end: var(--appshell-hard-bottom-offset, 0);
|
|
40
|
+
inset-inline: 0;
|
|
41
|
+
height: ${splitViewHeight};
|
|
42
|
+
background: ${theme.base.colors.black};
|
|
43
|
+
`;
|
|
44
|
+
});
|
|
45
|
+
StyledSplitViewPanel.defaultProps = defaultThemeProp;
|
|
46
|
+
export const StyledPortalTouchDialog = styled(TouchDialog)(() => css `
|
|
47
|
+
&& {
|
|
48
|
+
pointer-events: auto;
|
|
49
|
+
inset-inline: 0;
|
|
50
|
+
inset-block-end: var(--appshell-hard-bottom-offset, 0);
|
|
51
|
+
border-end-start-radius: 0;
|
|
52
|
+
border-end-end-radius: 0;
|
|
53
|
+
}
|
|
54
|
+
`);
|
|
55
|
+
StyledPortalTouchDialog.defaultProps = defaultThemeProp;
|
|
16
56
|
export const StyledMobileMoreMenu = styled(StyledAppNav) `
|
|
17
57
|
width: 100%;
|
|
18
58
|
height: 100%;
|
|
@@ -24,7 +64,7 @@ export const StyledMobileMoreMenu = styled(StyledAppNav) `
|
|
|
24
64
|
padding-block-end: var(--appshell-bottom-offset, ${mobileHeaderHeight});
|
|
25
65
|
`;
|
|
26
66
|
StyledMobileMoreMenu.defaultProps = defaultThemeProp;
|
|
27
|
-
export const StyledMobileNav = styled
|
|
67
|
+
export const StyledMobileNav = styled(Flex)(({ theme, hasBottomTouchPanel }) => {
|
|
28
68
|
const { rtl } = useDirection();
|
|
29
69
|
const { base: { 'hit-area': { 'finger-min': hitAreaFinger }, 'border-radius': borderRadius, 'font-size': fontSize, 'font-scale': fontScale }, components: { button: { 'focus-shadow': focusShadow, 'border-width': borderWidth }, text } } = theme;
|
|
30
70
|
const mobileNavColor = theme.components['app-shell'].nav.background;
|
|
@@ -37,8 +77,9 @@ export const StyledMobileNav = styled.header(({ theme }) => {
|
|
|
37
77
|
color: ${foreground};
|
|
38
78
|
padding: 0.5rem;
|
|
39
79
|
position: fixed;
|
|
80
|
+
--mobile-nav-offset: ${hasBottomTouchPanel ? '0rem' : '0.75rem'};
|
|
40
81
|
inset-block-start: calc(
|
|
41
|
-
100dvh - var(--appshell-bottom-offset, ${mobileHeaderHeight}) +
|
|
82
|
+
100dvh - var(--appshell-bottom-offset, ${mobileHeaderHeight}) + var(--mobile-nav-offset)
|
|
42
83
|
);
|
|
43
84
|
inset-inline-start: 50%;
|
|
44
85
|
transform: translateX(${rtl ? '50%' : '-50%'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchAppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EA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AE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEzD,OAAO,GAAG,CAAA;;aAEC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;6BACX,aAAa;8BACZ,YAAY;iBACzB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAa,CAAC;gCACnC,KAAK,CAAC,IAAI,CAAC,OAAO;;;;mCAIf,KAAK,CAAC,IAAI,CAAC,OAAO;QAC7C,gBAAgB;;;MAGlB,OAAO;QACT,GAAG,CAAA;;;;sBAIe,WAAW;;sBAEX,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC;;KAEjD;;MAEC,WAAW;;;;;GAKd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rem, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { StyledAlert } from '../Badges/Alert';\nimport { StyledLink } from '../Link/Link';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledDrawer } from '../Drawer';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport { ellipsisOverflow } from '../../styles/mixins';\nimport { useDirection } from '../../hooks';\n\nimport AppShellContext from './AppShellContext';\nimport {\n menuButtonWidth,\n mobileHeaderHeight,\n StyledCountIcon,\n StyledNavItemIconBox,\n StyledNavList,\n StyledNavListItem,\n StyledNavListItemVisualContainer,\n StyledAppNav\n} from './AppShell.styles';\nimport { navContrastColors } from './style-utils';\n\nexport const StyledMobileMoreMenu = styled(StyledAppNav)`\n width: 100%;\n height: 100%;\n\n /* Reserve top space for the app header + top nav, but NOT the document\n tabs strip - the mobile menu drawer covers content above the tab strip\n too. */\n padding-block-start: calc(var(--appshell-top-offset, 0rem) - var(--document-tabs-height, 0rem));\n padding-block-end: var(--appshell-bottom-offset, ${mobileHeaderHeight});\n`;\n\nStyledMobileMoreMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const { rtl } = useDirection();\n const {\n base: {\n 'hit-area': { 'finger-min': hitAreaFinger },\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: {\n button: { 'focus-shadow': focusShadow, 'border-width': borderWidth },\n text\n }\n } = theme;\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n z-index: calc(${theme.base['z-index'].drawer} + 1);\n background: ${mobileNavColor};\n border-radius: calc(2 * ${borderRadius});\n color: ${foreground};\n padding: 0.5rem;\n position: fixed;\n inset-block-start: calc(\n 100dvh - var(--appshell-bottom-offset, ${mobileHeaderHeight}) + 0.75rem\n );\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n box-shadow: ${theme.base.shadow.low};\n\n & + ${StyledDrawer} ${StyledDrawer} {\n width: 100%;\n }\n\n > div:has(> ${StyledNavList}),\n > div:has(> ${StyledNavList}) > ${StyledNavList}, > ${StyledNavList} {\n display: contents;\n\n ${StyledNavListItem} {\n padding: 0;\n margin: 0;\n font-size: ${fontSizes[text.secondary['font-size'] as FontSize]};\n\n ${StyledBareButton}, ${StyledLink} {\n flex-direction: column;\n justify-content: center;\n width: ${rem(menuButtonWidth(theme))};\n height: calc(0.25rem + ${hitAreaFinger});\n border-radius: calc(2 * ${borderRadius});\n border: ${borderWidth} solid transparent;\n padding-block: calc(0.5 * ${theme.base.spacing});\n\n &::before {\n width: 0;\n }\n\n span:not(${StyledCountIcon}) {\n width: inherit;\n text-align: center;\n padding-inline: calc(0.5 * ${theme.base.spacing});\n }\n\n &:enabled:focus-visible,\n &:not([disabled]):focus-visible {\n box-shadow: ${focusShadow};\n }\n\n ${StyledNavListItemVisualContainer} {\n padding: 0;\n margin: 0;\n\n ${StyledNavItemIconBox} {\n display: flex;\n }\n }\n }\n }\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledMobileMoreMenuButton = styled(Button)(({ theme }) => {\n const {\n base: {\n 'hit-area': { 'finger-min': hitAreaFinger },\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: {\n button: { 'border-width': borderWidth },\n text\n }\n } = theme;\n const { navOpen } = useContext(AppShellContext);\n const { foreground } = navContrastColors(theme);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n flex-direction: column;\n width: ${rem(menuButtonWidth(theme))};\n height: calc(0.25rem + ${hitAreaFinger});\n border-radius: calc(2 * ${borderRadius});\n font-size: ${fontSizes[text.secondary['font-size'] as FontSize]};\n padding-block: calc(0.5 * ${theme.base.spacing});\n\n span {\n width: inherit;\n padding-inline: calc(0.5 * ${theme.base.spacing});\n ${ellipsisOverflow}\n }\n\n ${navOpen &&\n css`\n &::before {\n content: '';\n position: absolute;\n inset: calc(${borderWidth} * -1);\n border-radius: inherit;\n background: ${transparentize(0.85, foreground)};\n }\n `}\n\n ${StyledAlert} {\n position: absolute;\n inset-block-start: calc(0.625rem / 2);\n inset-inline-start: calc(50% + (0.625rem / 2));\n }\n `;\n});\n\nStyledMobileMoreMenuButton.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"TouchAppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAqB,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAA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cAI9B,oBAAoB;;;;;;;GAO/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,EACJ,IAAI,EAAE,EACJ,UAAU,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,EAC3C,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,QAAQ,EACrB,YAAY,EAAE,SAAS,EACxB,EACD,UAAU,EAAE,EACV,MAAM,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,EACvC,IAAI,EACL,EACF,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEzD,OAAO,GAAG,CAAA;;aAEC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;6BACX,aAAa;8BACZ,YAAY;iBACzB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAa,CAAC;gCACnC,KAAK,CAAC,IAAI,CAAC,OAAO;;;;mCAIf,KAAK,CAAC,IAAI,CAAC,OAAO;QAC7C,gBAAgB;;;MAGlB,OAAO;QACT,GAAG,CAAA;;;;sBAIe,WAAW;;sBAEX,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC;;KAEjD;;MAEC,WAAW;;;;;GAKd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css, type DefaultTheme } from 'styled-components';\nimport { rem, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { StyledAlert } from '../Badges/Alert';\nimport { StyledLink } from '../Link/Link';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledDrawer } from '../Drawer';\nimport { TouchDialog } from '../Dialog';\nimport Flex from '../Flex';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport { ellipsisOverflow } from '../../styles/mixins';\nimport { useDirection } from '../../hooks';\n\nimport AppShellContext from './AppShellContext';\nimport {\n menuButtonWidth,\n mobileHeaderHeight,\n StyledCountIcon,\n StyledNavItemIconBox,\n StyledNavList,\n StyledNavListItem,\n StyledNavListItemVisualContainer,\n StyledAppNav\n} from './AppShell.styles';\nimport { navContrastColors } from './style-utils';\n\nexport const TouchAppShellGlobalStyle = createGlobalStyle<{\n hasBottomTouchPanel?: boolean;\n isMobileNav?: boolean;\n theme?: DefaultTheme;\n}>`\n :root,\n :host {\n --appshell-bottom-panel-offset: ${({ hasBottomTouchPanel }) =>\n hasBottomTouchPanel ? '4rem' : '0rem'};\n --appshell-bottom-panel-gap: ${({ hasBottomTouchPanel, theme }) =>\n hasBottomTouchPanel ? `calc(2 * ${theme?.base.spacing})` : '0rem'};\n --appshell-bottom-offset: ${({ hasBottomTouchPanel, isMobileNav }) =>\n `calc(var(--appshell-hard-bottom-offset) + ${isMobileNav ? mobileHeaderHeight : '0rem'}${\n hasBottomTouchPanel ? ' + var(--appshell-bottom-panel-offset)' : ''\n })`};\n }\n`;\n\nexport const StyledMainTouchAppShell = styled.div<{ active?: boolean }>(\n ({ active, theme }) => css`\n ${active &&\n css`\n background: ${theme.base.colors.black};\n `}\n `\n);\n\nStyledMainTouchAppShell.defaultProps = defaultThemeProp;\n\nexport const StyledSplitViewPanel = styled.div<{ active?: boolean }>(({ active, theme }) => {\n const splitViewHeight = active\n ? 'calc(var(--appshell-bottom-panel-offset, 0rem) + var(--appshell-bottom-panel-gap, 0rem))'\n : '0rem';\n\n return css`\n position: fixed;\n inset-block-end: var(--appshell-hard-bottom-offset, 0);\n inset-inline: 0;\n height: ${splitViewHeight};\n background: ${theme.base.colors.black};\n `;\n});\n\nStyledSplitViewPanel.defaultProps = defaultThemeProp;\n\nexport const StyledPortalTouchDialog = styled(TouchDialog)(\n () => css`\n && {\n pointer-events: auto;\n inset-inline: 0;\n inset-block-end: var(--appshell-hard-bottom-offset, 0);\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n `\n);\n\nStyledPortalTouchDialog.defaultProps = defaultThemeProp;\n\nexport const StyledMobileMoreMenu = styled(StyledAppNav)`\n width: 100%;\n height: 100%;\n\n /* Reserve top space for the app header + top nav, but NOT the document\n tabs strip - the mobile menu drawer covers content above the tab strip\n too. */\n padding-block-start: calc(var(--appshell-top-offset, 0rem) - var(--document-tabs-height, 0rem));\n padding-block-end: var(--appshell-bottom-offset, ${mobileHeaderHeight});\n`;\n\nStyledMobileMoreMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled(Flex)<{ hasBottomTouchPanel?: boolean }>(({\n theme,\n hasBottomTouchPanel\n}) => {\n const { rtl } = useDirection();\n const {\n base: {\n 'hit-area': { 'finger-min': hitAreaFinger },\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: {\n button: { 'focus-shadow': focusShadow, 'border-width': borderWidth },\n text\n }\n } = theme;\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n z-index: calc(${theme.base['z-index'].drawer} + 1);\n background: ${mobileNavColor};\n border-radius: calc(2 * ${borderRadius});\n color: ${foreground};\n padding: 0.5rem;\n position: fixed;\n --mobile-nav-offset: ${hasBottomTouchPanel ? '0rem' : '0.75rem'};\n inset-block-start: calc(\n 100dvh - var(--appshell-bottom-offset, ${mobileHeaderHeight}) + var(--mobile-nav-offset)\n );\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n box-shadow: ${theme.base.shadow.low};\n\n & + ${StyledDrawer} ${StyledDrawer} {\n width: 100%;\n }\n\n > div:has(> ${StyledNavList}),\n > div:has(> ${StyledNavList}) > ${StyledNavList}, > ${StyledNavList} {\n display: contents;\n\n ${StyledNavListItem} {\n padding: 0;\n margin: 0;\n font-size: ${fontSizes[text.secondary['font-size'] as FontSize]};\n\n ${StyledBareButton}, ${StyledLink} {\n flex-direction: column;\n justify-content: center;\n width: ${rem(menuButtonWidth(theme))};\n height: calc(0.25rem + ${hitAreaFinger});\n border-radius: calc(2 * ${borderRadius});\n border: ${borderWidth} solid transparent;\n padding-block: calc(0.5 * ${theme.base.spacing});\n\n &::before {\n width: 0;\n }\n\n span:not(${StyledCountIcon}) {\n width: inherit;\n text-align: center;\n padding-inline: calc(0.5 * ${theme.base.spacing});\n }\n\n &:enabled:focus-visible,\n &:not([disabled]):focus-visible {\n box-shadow: ${focusShadow};\n }\n\n ${StyledNavListItemVisualContainer} {\n padding: 0;\n margin: 0;\n\n ${StyledNavItemIconBox} {\n display: flex;\n }\n }\n }\n }\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledMobileMoreMenuButton = styled(Button)(({ theme }) => {\n const {\n base: {\n 'hit-area': { 'finger-min': hitAreaFinger },\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: {\n button: { 'border-width': borderWidth },\n text\n }\n } = theme;\n const { navOpen } = useContext(AppShellContext);\n const { foreground } = navContrastColors(theme);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n flex-direction: column;\n width: ${rem(menuButtonWidth(theme))};\n height: calc(0.25rem + ${hitAreaFinger});\n border-radius: calc(2 * ${borderRadius});\n font-size: ${fontSizes[text.secondary['font-size'] as FontSize]};\n padding-block: calc(0.5 * ${theme.base.spacing});\n\n span {\n width: inherit;\n padding-inline: calc(0.5 * ${theme.base.spacing});\n ${ellipsisOverflow}\n }\n\n ${navOpen &&\n css`\n &::before {\n content: '';\n position: absolute;\n inset: calc(${borderWidth} * -1);\n border-radius: inherit;\n background: ${transparentize(0.85, foreground)};\n }\n `}\n\n ${StyledAlert} {\n position: absolute;\n inset-block-start: calc(0.625rem / 2);\n inset-inline-start: calc(50% + (0.625rem / 2));\n }\n `;\n});\n\nStyledMobileMoreMenuButton.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAkBnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TouchDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAkBnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAY5D,QAAA,MAAM,WAAW,EAAE,+BAA+B,CAAC,gBAAgB,CAkOlE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -8,35 +8,40 @@ import Text from '../Text';
|
|
|
8
8
|
import * as caretUp from '../Icon/icons/caret-up.icon';
|
|
9
9
|
import * as timesIcon from '../Icon/icons/times.icon';
|
|
10
10
|
import Flex from '../Flex';
|
|
11
|
-
import Backdrop from '../Backdrop';
|
|
12
11
|
import { focusNonInteractiveElement, getActiveElement, isInstance } from '../../utils';
|
|
13
12
|
import Progress from '../Progress';
|
|
14
|
-
import { StyledTouchDialogContent, StyledTouchDialogHeader, StyledTouchDialog, StyledExpandCollapse } from './TouchDialog.styles';
|
|
13
|
+
import { StyledTouchDialogContent, StyledTouchDialogHeader, StyledTouchDialog, StyledTouchDialogBackdrop, StyledExpandCollapse } from './TouchDialog.styles';
|
|
15
14
|
import { getTouchDialogTestIds } from './TouchDialog.test-ids';
|
|
16
15
|
import { StyledChildrenWrap } from './Dialog.styles';
|
|
17
16
|
registerIcon(caretUp, timesIcon);
|
|
18
17
|
const drawerSizeMapping = {
|
|
19
18
|
auto: 'auto',
|
|
19
|
+
compact: 'var(--touch-dialog-compact-height)',
|
|
20
20
|
half: '50dvh',
|
|
21
21
|
full: '90dvh'
|
|
22
22
|
};
|
|
23
|
-
const TouchDialog = forwardRef(function TouchDialog({ open, onDismiss: onDismissProp, children, size = 'half', onBeforeOpen, onAfterOpen: onAfterOpenProp, onBeforeClose, onAfterClose, heading, 'aria-label': ariaLabel, progress: progressProp, testId, ...restProps }, ref) {
|
|
23
|
+
const TouchDialog = forwardRef(function TouchDialog({ open, onDismiss: onDismissProp, children, size = 'half', onBeforeOpen, onAfterOpen: onAfterOpenProp, onBeforeClose, onAfterClose, heading, 'aria-label': ariaLabel, progress: progressProp, outerClickAction = 'close', testId, ...restProps }, ref) {
|
|
24
24
|
const dialogRef = useConsolidatedRef(ref);
|
|
25
25
|
const backdropRef = useRef(null);
|
|
26
26
|
const t = useI18n();
|
|
27
27
|
const { portalTarget } = useConfiguration();
|
|
28
28
|
const headingRef = useRef(null);
|
|
29
29
|
const headingWrapperRef = useRef(null);
|
|
30
|
-
const
|
|
30
|
+
const isFullCompact = size === 'full-compact';
|
|
31
|
+
const [drawerSize, setDrawerSize] = useState(isFullCompact ? 'full' : size);
|
|
31
32
|
const headingId = useUID();
|
|
32
33
|
const testIds = useTestIds(testId, getTouchDialogTestIds);
|
|
33
34
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
34
35
|
const returnRef = useRef(null);
|
|
35
36
|
useEffect(() => {
|
|
36
|
-
setDrawerSize(size);
|
|
37
|
+
setDrawerSize(isFullCompact ? 'full' : size);
|
|
37
38
|
}, [size]);
|
|
38
|
-
const isAutoSize = size === 'auto';
|
|
39
|
-
|
|
39
|
+
const isAutoSize = size === 'auto' || isFullCompact;
|
|
40
|
+
const resetSize = useCallback(() => {
|
|
41
|
+
setDrawerSize(isFullCompact ? 'compact' : size);
|
|
42
|
+
}, [size]);
|
|
43
|
+
const shouldTrapFocus = open && drawerOpen && !(isFullCompact && drawerSize === 'compact');
|
|
44
|
+
useFocusTrap(shouldTrapFocus ? dialogRef : null, false, [shouldTrapFocus]);
|
|
40
45
|
const setFocus = useCallback(() => {
|
|
41
46
|
if (progressProp || !drawerOpen || dialogRef.current?.contains(getActiveElement()))
|
|
42
47
|
return;
|
|
@@ -54,6 +59,14 @@ const TouchDialog = forwardRef(function TouchDialog({ open, onDismiss: onDismiss
|
|
|
54
59
|
setDrawerOpen(false);
|
|
55
60
|
onDismissProp?.();
|
|
56
61
|
}, [onDismissProp]);
|
|
62
|
+
const onOuterClick = useCallback(() => {
|
|
63
|
+
if (outerClickAction === 'reset-size') {
|
|
64
|
+
resetSize();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
onDismiss();
|
|
68
|
+
}
|
|
69
|
+
}, [onDismiss, outerClickAction, resetSize]);
|
|
57
70
|
const onAfterOpen = useCallback(() => {
|
|
58
71
|
onAfterOpenProp?.();
|
|
59
72
|
setFocus();
|
|
@@ -69,26 +82,38 @@ const TouchDialog = forwardRef(function TouchDialog({ open, onDismiss: onDismiss
|
|
|
69
82
|
e.stopPropagation();
|
|
70
83
|
}, dialogRef, [onDismiss]);
|
|
71
84
|
const progress = (_jsx(Progress, { visible: !!progressProp, focusOnVisible: true, placement: 'local', message: typeof progressProp === 'string' ? progressProp : undefined }));
|
|
85
|
+
const isCompact = isFullCompact && drawerSize === 'compact';
|
|
86
|
+
const hasContent = children !== undefined || progressProp !== undefined;
|
|
72
87
|
const dismissButton = (_jsx(Button, { "data-testid": testIds.dismiss, variant: 'simple', icon: true, label: t('dismiss'), onClick: onDismiss, children: _jsx(Icon, { name: 'times' }) }));
|
|
73
88
|
useEvent('click', e => {
|
|
74
89
|
if (open && e.target === backdropRef.current) {
|
|
75
|
-
|
|
90
|
+
onOuterClick();
|
|
76
91
|
}
|
|
77
|
-
}, { target: backdropRef
|
|
78
|
-
const content = (_jsx(
|
|
92
|
+
}, { target: backdropRef, dependencies: [onOuterClick, open] });
|
|
93
|
+
const content = (_jsx(StyledTouchDialogBackdrop, { ref: backdropRef, open: open, "$compact": isCompact, onBeforeTransitionIn: () => {
|
|
79
94
|
setDrawerOpen(true);
|
|
95
|
+
if (isFullCompact)
|
|
96
|
+
setDrawerSize('full');
|
|
80
97
|
returnRef.current = getActiveElement();
|
|
81
98
|
onBeforeOpen?.();
|
|
82
99
|
}, onBeforeTransitionOut: () => {
|
|
83
100
|
setDrawerOpen(false);
|
|
84
|
-
setDrawerSize(size);
|
|
85
101
|
}, onAfterTransitionOut: () => {
|
|
102
|
+
resetSize();
|
|
86
103
|
if (isInstance(returnRef.current, HTMLElement) &&
|
|
87
104
|
dialogRef.current?.contains(getActiveElement())) {
|
|
88
105
|
returnRef.current.focus();
|
|
89
106
|
}
|
|
90
107
|
onAfterClose?.();
|
|
91
|
-
}, children: _jsxs(StyledTouchDialog, { "data-testid": testIds.root, "aria-labelledby": heading ? headingId : undefined, "aria-label": ariaLabel, ...restProps, ref: dialogRef, open: drawerOpen, placement: 'bottom', position: 'fixed', size: drawerSizeMapping[drawerSize], shadow: true, onAfterOpen: onAfterOpen, onBeforeClose: onBeforeClose, role: 'dialog', "aria-modal": 'true', "aria-busy": !!progressProp, children: [_jsxs(Flex, { container: { direction: 'row', justify: 'between', alignItems: 'center' }, as: StyledTouchDialogHeader, children: [typeof heading === 'string' ? (_jsx(Text, { variant: 'h2', ref: headingRef, id: headingId, children: heading })) : (heading && (_jsx(Flex, { item: { grow: 1 }, ref: headingWrapperRef, id: headingId, children: heading }))), dismissButton] }), _jsxs(Flex, { as: StyledTouchDialogContent, container: { gap: 1, direction: 'column' }, children: [children && (_jsx(StyledChildrenWrap, { inert: progressProp ? '' : undefined, children: children })), progress] }), !isAutoSize && (_jsx(StyledExpandCollapse, { onToggle: () =>
|
|
108
|
+
}, children: _jsxs(StyledTouchDialog, { "data-testid": testIds.root, "aria-labelledby": heading ? headingId : undefined, "aria-label": ariaLabel, ...restProps, ref: dialogRef, open: drawerOpen, placement: 'bottom', position: 'fixed', size: drawerSizeMapping[drawerSize], shadow: true, onAfterOpen: onAfterOpen, onBeforeClose: onBeforeClose, role: 'dialog', "aria-modal": shouldTrapFocus ? 'true' : undefined, "aria-busy": !!progressProp, children: [_jsxs(Flex, { container: { direction: 'row', justify: 'between', alignItems: 'center' }, as: StyledTouchDialogHeader, children: [typeof heading === 'string' ? (_jsx(Text, { variant: 'h2', ref: headingRef, id: headingId, children: heading })) : (heading && (_jsx(Flex, { item: { grow: 1 }, ref: headingWrapperRef, id: headingId, children: heading }))), dismissButton] }), hasContent && (_jsxs(Flex, { as: StyledTouchDialogContent, container: { gap: 1, direction: 'column' }, hidden: isCompact && !progressProp, children: [children && (_jsx(StyledChildrenWrap, { inert: progressProp || isCompact ? '' : undefined, hidden: isCompact, children: children })), progress] })), (!isAutoSize || isFullCompact) && (_jsx(StyledExpandCollapse, { onToggle: () => {
|
|
109
|
+
setDrawerSize(prev => {
|
|
110
|
+
if (isFullCompact)
|
|
111
|
+
return prev === 'compact' ? 'full' : 'compact';
|
|
112
|
+
if (prev === 'full')
|
|
113
|
+
return 'half';
|
|
114
|
+
return 'full';
|
|
115
|
+
});
|
|
116
|
+
}, expanded: drawerSize === 'full', compact: true, iconOnly: true }))] }) }));
|
|
92
117
|
return portalTarget ? createPortal(content, portalTarget) : content;
|
|
93
118
|
});
|
|
94
119
|
export default TouchDialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,YAAY,EAA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AAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAC1E,QAAQ,EAAE,UAAU,KAAK,MAAM,EAC/B,OAAO,QACP,QAAQ,SACR,CACH,IACiB,GACX,CACZ,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n useConsolidatedRef,\n useConfiguration,\n useFocusTrap,\n useI18n,\n useTestIds,\n useEscape,\n useUID,\n useEvent\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport * as caretUp from '../Icon/icons/caret-up.icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport Flex from '../Flex';\nimport Backdrop from '../Backdrop';\nimport { focusNonInteractiveElement, getActiveElement, isInstance } from '../../utils';\nimport Progress from '../Progress';\n\nimport {\n StyledTouchDialogContent,\n StyledTouchDialogHeader,\n StyledTouchDialog,\n StyledExpandCollapse\n} from './TouchDialog.styles';\nimport { getTouchDialogTestIds } from './TouchDialog.test-ids';\nimport type { TouchDialogProps } from './TouchDialog.types';\nimport { StyledChildrenWrap } from './Dialog.styles';\n\nregisterIcon(caretUp, timesIcon);\n\nconst drawerSizeMapping = {\n auto: 'auto',\n half: '50dvh',\n full: '90dvh'\n} as const;\n\nconst TouchDialog: ForwardRefForwardPropsComponent<TouchDialogProps> = forwardRef(\n function TouchDialog(\n {\n open,\n onDismiss: onDismissProp,\n children,\n size = 'half',\n onBeforeOpen,\n onAfterOpen: onAfterOpenProp,\n onBeforeClose,\n onAfterClose,\n heading,\n 'aria-label': ariaLabel,\n progress: progressProp,\n testId,\n ...restProps\n }: PropsWithoutRef<TouchDialogProps>,\n ref: TouchDialogProps['ref']\n ) {\n const dialogRef = useConsolidatedRef(ref);\n const backdropRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n const { portalTarget } = useConfiguration();\n const headingRef = useRef<HTMLHeadingElement>(null);\n const headingWrapperRef = useRef<HTMLDivElement>(null);\n const [drawerSize, setDrawerSize] = useState(size);\n const headingId = useUID();\n const testIds = useTestIds(testId, getTouchDialogTestIds);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const returnRef = useRef<Element | null>(null);\n\n useEffect(() => {\n setDrawerSize(size);\n }, [size]);\n\n const isAutoSize = size === 'auto';\n\n useFocusTrap(open && drawerOpen ? dialogRef : null, false, [open, drawerOpen]);\n\n const setFocus = useCallback(() => {\n if (progressProp || !drawerOpen || dialogRef.current?.contains(getActiveElement())) return;\n if (headingWrapperRef.current) {\n focusNonInteractiveElement(\n headingWrapperRef.current.querySelector('h2') ?? headingWrapperRef.current,\n ariaLabel\n );\n } else if (headingRef.current) {\n focusNonInteractiveElement(headingRef.current, ariaLabel);\n } else if (dialogRef.current) {\n focusNonInteractiveElement(dialogRef.current, ariaLabel);\n }\n }, [progressProp, drawerOpen, heading, ariaLabel]);\n\n const onDismiss = useCallback(() => {\n setDrawerOpen(false);\n onDismissProp?.();\n }, [onDismissProp]);\n\n const onAfterOpen = useCallback(() => {\n onAfterOpenProp?.();\n setFocus();\n }, [onAfterOpenProp, setFocus]);\n\n useEffect(() => {\n if (!progressProp) {\n // Delay focus to the next tick to allow progress to unmount so setFocus do not bail out\n setTimeout(setFocus, 0);\n }\n }, [progressProp, setFocus]);\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <Button\n data-testid={testIds.dismiss}\n variant='simple'\n icon\n label={t('dismiss')}\n onClick={onDismiss}\n >\n <Icon name='times' />\n </Button>\n );\n\n useEvent(\n 'click',\n e => {\n if (open && e.target === backdropRef.current) {\n onDismiss();\n }\n },\n { target: backdropRef.current, dependencies: [onDismiss, open] }\n );\n\n const content = (\n <Backdrop\n ref={backdropRef}\n open={open}\n onBeforeTransitionIn={() => {\n setDrawerOpen(true);\n returnRef.current = getActiveElement();\n onBeforeOpen?.();\n }}\n onBeforeTransitionOut={() => {\n setDrawerOpen(false);\n setDrawerSize(size);\n }}\n onAfterTransitionOut={() => {\n if (\n isInstance(returnRef.current, HTMLElement) &&\n dialogRef.current?.contains(getActiveElement())\n ) {\n returnRef.current.focus();\n }\n onAfterClose?.();\n }}\n >\n <StyledTouchDialog\n data-testid={testIds.root}\n aria-labelledby={heading ? headingId : undefined}\n aria-label={ariaLabel}\n {...restProps}\n ref={dialogRef}\n open={drawerOpen}\n placement='bottom'\n position='fixed'\n size={drawerSizeMapping[drawerSize]}\n shadow\n onAfterOpen={onAfterOpen}\n onBeforeClose={onBeforeClose}\n role='dialog'\n aria-modal='true'\n aria-busy={!!progressProp}\n >\n <Flex\n container={{ direction: 'row', justify: 'between', alignItems: 'center' }}\n as={StyledTouchDialogHeader}\n >\n {typeof heading === 'string' ? (\n <Text variant='h2' ref={headingRef} id={headingId}>\n {heading}\n </Text>\n ) : (\n heading && (\n <Flex item={{ grow: 1 }} ref={headingWrapperRef} id={headingId}>\n {heading}\n </Flex>\n )\n )}\n {dismissButton}\n </Flex>\n <Flex as={StyledTouchDialogContent} container={{ gap: 1, direction: 'column' }}>\n {children && (\n <StyledChildrenWrap inert={progressProp ? '' : undefined}>\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n {!isAutoSize && (\n <StyledExpandCollapse\n onToggle={() => setDrawerSize(prev => (prev === 'half' ? 'full' : 'half'))}\n expanded={drawerSize === 'full'}\n compact\n iconOnly\n />\n )}\n </StyledTouchDialog>\n </Backdrop>\n );\n\n return portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default TouchDialog;\n"]}
|
|
1
|
+
{"version":3,"file":"TouchDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAEjC,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,OAA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,YAEhB,QAAQ,GACU,CACtB,EACA,QAAQ,IACJ,CACR,EACA,CAAC,CAAC,UAAU,IAAI,aAAa,CAAC,IAAI,CACjC,KAAC,oBAAoB,IACnB,QAAQ,EAAE,GAAG,EAAE;wBACb,aAAa,CAAC,IAAI,CAAC,EAAE;4BACnB,IAAI,aAAa;gCAAE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;4BAClE,IAAI,IAAI,KAAK,MAAM;gCAAE,OAAO,MAAM,CAAC;4BACnC,OAAO,MAAM,CAAC;wBAChB,CAAC,CAAC,CAAC;oBACL,CAAC,EACD,QAAQ,EAAE,UAAU,KAAK,MAAM,EAC/B,OAAO,QACP,QAAQ,SACR,CACH,IACiB,GACM,CAC7B,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n useConsolidatedRef,\n useConfiguration,\n useFocusTrap,\n useI18n,\n useTestIds,\n useEscape,\n useUID,\n useEvent\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport * as caretUp from '../Icon/icons/caret-up.icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport Flex from '../Flex';\nimport { focusNonInteractiveElement, getActiveElement, isInstance } from '../../utils';\nimport Progress from '../Progress';\n\nimport {\n StyledTouchDialogContent,\n StyledTouchDialogHeader,\n StyledTouchDialog,\n StyledTouchDialogBackdrop,\n StyledExpandCollapse\n} from './TouchDialog.styles';\nimport { getTouchDialogTestIds } from './TouchDialog.test-ids';\nimport type { TouchDialogProps } from './TouchDialog.types';\nimport { StyledChildrenWrap } from './Dialog.styles';\n\nregisterIcon(caretUp, timesIcon);\n\nconst drawerSizeMapping = {\n auto: 'auto',\n compact: 'var(--touch-dialog-compact-height)',\n half: '50dvh',\n full: '90dvh'\n} as const;\n\nconst TouchDialog: ForwardRefForwardPropsComponent<TouchDialogProps> = forwardRef(\n function TouchDialog(\n {\n open,\n onDismiss: onDismissProp,\n children,\n size = 'half',\n onBeforeOpen,\n onAfterOpen: onAfterOpenProp,\n onBeforeClose,\n onAfterClose,\n heading,\n 'aria-label': ariaLabel,\n progress: progressProp,\n outerClickAction = 'close',\n testId,\n ...restProps\n }: PropsWithoutRef<TouchDialogProps>,\n ref: TouchDialogProps['ref']\n ) {\n const dialogRef = useConsolidatedRef(ref);\n const backdropRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n const { portalTarget } = useConfiguration();\n const headingRef = useRef<HTMLHeadingElement>(null);\n const headingWrapperRef = useRef<HTMLDivElement>(null);\n const isFullCompact = size === 'full-compact';\n const [drawerSize, setDrawerSize] = useState<'auto' | 'compact' | 'half' | 'full'>(\n isFullCompact ? 'full' : size\n );\n const headingId = useUID();\n const testIds = useTestIds(testId, getTouchDialogTestIds);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const returnRef = useRef<Element | null>(null);\n\n useEffect(() => {\n setDrawerSize(isFullCompact ? 'full' : size);\n }, [size]);\n\n const isAutoSize = size === 'auto' || isFullCompact;\n\n const resetSize = useCallback(() => {\n setDrawerSize(isFullCompact ? 'compact' : size);\n }, [size]);\n\n const shouldTrapFocus = open && drawerOpen && !(isFullCompact && drawerSize === 'compact');\n\n useFocusTrap(shouldTrapFocus ? dialogRef : null, false, [shouldTrapFocus]);\n\n const setFocus = useCallback(() => {\n if (progressProp || !drawerOpen || dialogRef.current?.contains(getActiveElement())) return;\n if (headingWrapperRef.current) {\n focusNonInteractiveElement(\n headingWrapperRef.current.querySelector('h2') ?? headingWrapperRef.current,\n ariaLabel\n );\n } else if (headingRef.current) {\n focusNonInteractiveElement(headingRef.current, ariaLabel);\n } else if (dialogRef.current) {\n focusNonInteractiveElement(dialogRef.current, ariaLabel);\n }\n }, [progressProp, drawerOpen, heading, ariaLabel]);\n\n const onDismiss = useCallback(() => {\n setDrawerOpen(false);\n onDismissProp?.();\n }, [onDismissProp]);\n\n const onOuterClick = useCallback(() => {\n if (outerClickAction === 'reset-size') {\n resetSize();\n } else {\n onDismiss();\n }\n }, [onDismiss, outerClickAction, resetSize]);\n\n const onAfterOpen = useCallback(() => {\n onAfterOpenProp?.();\n setFocus();\n }, [onAfterOpenProp, setFocus]);\n\n useEffect(() => {\n if (!progressProp) {\n // Delay focus to the next tick to allow progress to unmount so setFocus do not bail out\n setTimeout(setFocus, 0);\n }\n }, [progressProp, setFocus]);\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n const isCompact = isFullCompact && drawerSize === 'compact';\n const hasContent = children !== undefined || progressProp !== undefined;\n\n const dismissButton = (\n <Button\n data-testid={testIds.dismiss}\n variant='simple'\n icon\n label={t('dismiss')}\n onClick={onDismiss}\n >\n <Icon name='times' />\n </Button>\n );\n\n useEvent(\n 'click',\n e => {\n if (open && e.target === backdropRef.current) {\n onOuterClick();\n }\n },\n { target: backdropRef, dependencies: [onOuterClick, open] }\n );\n\n const content = (\n <StyledTouchDialogBackdrop\n ref={backdropRef}\n open={open}\n $compact={isCompact}\n onBeforeTransitionIn={() => {\n setDrawerOpen(true);\n if (isFullCompact) setDrawerSize('full');\n returnRef.current = getActiveElement();\n onBeforeOpen?.();\n }}\n onBeforeTransitionOut={() => {\n setDrawerOpen(false);\n }}\n onAfterTransitionOut={() => {\n resetSize();\n if (\n isInstance(returnRef.current, HTMLElement) &&\n dialogRef.current?.contains(getActiveElement())\n ) {\n returnRef.current.focus();\n }\n onAfterClose?.();\n }}\n >\n <StyledTouchDialog\n data-testid={testIds.root}\n aria-labelledby={heading ? headingId : undefined}\n aria-label={ariaLabel}\n {...restProps}\n ref={dialogRef}\n open={drawerOpen}\n placement='bottom'\n position='fixed'\n size={drawerSizeMapping[drawerSize]}\n shadow\n onAfterOpen={onAfterOpen}\n onBeforeClose={onBeforeClose}\n role='dialog'\n aria-modal={shouldTrapFocus ? 'true' : undefined}\n aria-busy={!!progressProp}\n >\n <Flex\n container={{ direction: 'row', justify: 'between', alignItems: 'center' }}\n as={StyledTouchDialogHeader}\n >\n {typeof heading === 'string' ? (\n <Text variant='h2' ref={headingRef} id={headingId}>\n {heading}\n </Text>\n ) : (\n heading && (\n <Flex item={{ grow: 1 }} ref={headingWrapperRef} id={headingId}>\n {heading}\n </Flex>\n )\n )}\n {dismissButton}\n </Flex>\n {hasContent && (\n <Flex\n as={StyledTouchDialogContent}\n container={{ gap: 1, direction: 'column' }}\n hidden={isCompact && !progressProp}\n >\n {children && (\n <StyledChildrenWrap\n inert={progressProp || isCompact ? '' : undefined}\n hidden={isCompact}\n >\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n )}\n {(!isAutoSize || isFullCompact) && (\n <StyledExpandCollapse\n onToggle={() => {\n setDrawerSize(prev => {\n if (isFullCompact) return prev === 'compact' ? 'full' : 'compact';\n if (prev === 'full') return 'half';\n return 'full';\n });\n }}\n expanded={drawerSize === 'full'}\n compact\n iconOnly\n />\n )}\n </StyledTouchDialog>\n </StyledTouchDialogBackdrop>\n );\n\n return portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default TouchDialog;\n"]}
|
|
@@ -2,6 +2,13 @@ export declare const StyledExpandCollapse: import("styled-components/dist/types"
|
|
|
2
2
|
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
3
3
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../ExpandCollapse").ExpandCollapseButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
4
4
|
export declare const StyledTouchDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Drawer").DrawerProps & import("../..").ForwardProps, never>> & string & Omit<import("react").FunctionComponent<import("../Drawer").DrawerProps & import("../..").ForwardProps>, keyof import("react").Component<any, {}, any>>;
|
|
5
|
+
export declare const StyledTouchDialogBackdrop: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("../Backdrop").BackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
$compact?: boolean;
|
|
9
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../Backdrop").BackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
10
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly []>;
|
|
11
|
+
}, keyof import("react").Component<any, {}, any>>;
|
|
5
12
|
export declare const StyledTouchDialogHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
13
|
export declare const StyledTouchDialogContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
14
|
//# sourceMappingURL=TouchDialog.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TouchDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.styles.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;2OAQhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,mVAyB7B,CAAC;AAIF,eAAO,MAAM,yBAAyB;;;eAAiC,OAAO;;;iDAM7E,CAAC;AAIF,eAAO,MAAM,uBAAuB,6NASnC,CAAC;AAIF,eAAO,MAAM,wBAAwB,6NAoBpC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { defaultThemeProp } from '../../theme';
|
|
3
3
|
import { StyledButton } from '../Button';
|
|
4
|
+
import Backdrop from '../Backdrop';
|
|
4
5
|
import Drawer from '../Drawer';
|
|
5
6
|
import { ExpandCollapseButton } from '../ExpandCollapse';
|
|
6
7
|
import { StyledIcon } from '../Icon';
|
|
@@ -22,8 +23,12 @@ export const StyledTouchDialog = styled(Drawer)(({ theme: { base, components } }
|
|
|
22
23
|
inset-block-end: calc(${base.spacing} * 0.5);
|
|
23
24
|
inset-inline: calc(${base.spacing} * 0.5);
|
|
24
25
|
max-height: 90dvh;
|
|
26
|
+
--touch-dialog-compact-height: calc(
|
|
27
|
+
${base['hit-area'].compact} + ${base.spacing} + ${base['hit-area']['finger-min']}
|
|
28
|
+
);
|
|
25
29
|
border-radius: ${components.card['border-radius']};
|
|
26
30
|
width: auto;
|
|
31
|
+
overflow: hidden;
|
|
27
32
|
transition-property: transform, box-shadow, opacity, height;
|
|
28
33
|
|
|
29
34
|
@media (height < 31.25rem) {
|
|
@@ -36,6 +41,11 @@ export const StyledTouchDialog = styled(Drawer)(({ theme: { base, components } }
|
|
|
36
41
|
}
|
|
37
42
|
`);
|
|
38
43
|
StyledTouchDialog.defaultProps = defaultThemeProp;
|
|
44
|
+
export const StyledTouchDialogBackdrop = styled(Backdrop)(({ $compact }) => $compact &&
|
|
45
|
+
css `
|
|
46
|
+
inset-block-start: calc(100dvh - var(--appshell-bottom-panel-offset, 0));
|
|
47
|
+
`);
|
|
48
|
+
StyledTouchDialogBackdrop.defaultProps = defaultThemeProp;
|
|
39
49
|
export const StyledTouchDialogHeader = styled.div(({ theme: { base } }) => css `
|
|
40
50
|
padding-inline: ${base.spacing};
|
|
41
51
|
padding-block-start: ${base.spacing};
|
|
@@ -52,6 +62,11 @@ export const StyledTouchDialogContent = styled.div(({ theme: { base } }) => css
|
|
|
52
62
|
position: relative;
|
|
53
63
|
padding-block-start: calc(${base.spacing} * 0.5);
|
|
54
64
|
|
|
65
|
+
&[hidden],
|
|
66
|
+
${StyledChildrenWrap}[hidden] {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
55
70
|
${StyledChildrenWrap} {
|
|
56
71
|
height: 100%;
|
|
57
72
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.styles.js","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,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../../theme';\nimport { StyledButton } from '../Button';\nimport Backdrop from '../Backdrop';\nimport Drawer from '../Drawer';\nimport { ExpandCollapseButton } from '../ExpandCollapse';\nimport { StyledIcon } from '../Icon';\n\nimport { StyledChildrenWrap } from './Dialog.styles';\n\nexport const StyledExpandCollapse = styled(ExpandCollapseButton)`\n position: absolute;\n inset-block-start: 0;\n width: 100%;\n\n &[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(-90deg);\n }\n`;\n\nStyledExpandCollapse.defaultProps = defaultThemeProp;\n\nexport const StyledTouchDialog = styled(Drawer)(\n ({ theme: { base, components } }) => css`\n display: flex;\n flex-direction: column;\n background: ${components.popover.background};\n inset-block-end: calc(${base.spacing} * 0.5);\n inset-inline: calc(${base.spacing} * 0.5);\n max-height: 90dvh;\n --touch-dialog-compact-height: calc(\n ${base['hit-area'].compact} + ${base.spacing} + ${base['hit-area']['finger-min']}\n );\n border-radius: ${components.card['border-radius']};\n width: auto;\n overflow: hidden;\n transition-property: transform, box-shadow, opacity, height;\n\n @media (height < 31.25rem) {\n overflow-y: auto;\n display: block;\n }\n\n &:has(${StyledExpandCollapse}) {\n padding-block-start: ${base['hit-area'].compact};\n }\n `\n);\n\nStyledTouchDialog.defaultProps = defaultThemeProp;\n\nexport const StyledTouchDialogBackdrop = styled(Backdrop)<{ $compact?: boolean }>(\n ({ $compact }) =>\n $compact &&\n css`\n inset-block-start: calc(100dvh - var(--appshell-bottom-panel-offset, 0));\n `\n);\n\nStyledTouchDialogBackdrop.defaultProps = defaultThemeProp;\n\nexport const StyledTouchDialogHeader = styled.div(\n ({ theme: { base } }) => css`\n padding-inline: ${base.spacing};\n padding-block-start: ${base.spacing};\n\n ${StyledButton} {\n margin-inline-start: auto;\n }\n `\n);\n\nStyledTouchDialogHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTouchDialogContent = styled.div(\n ({ theme: { base } }) => css`\n min-height: 0;\n overflow: auto;\n height: 100%;\n position: relative;\n padding-block-start: calc(${base.spacing} * 0.5);\n\n &[hidden],\n ${StyledChildrenWrap}[hidden] {\n display: none;\n }\n\n ${StyledChildrenWrap} {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-inline: ${base.spacing};\n }\n `\n);\n\nStyledTouchDialogContent.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -24,12 +24,13 @@ export interface TouchDialogProps extends BaseProps, TestIdProp {
|
|
|
24
24
|
progress?: boolean | ProgressProps['message'];
|
|
25
25
|
/**
|
|
26
26
|
* The initial height of the TouchDialog panel.
|
|
27
|
-
* - `'auto'` — height is driven by content (capped at 90% of the viewport).
|
|
27
|
+
* - `'auto'` — height is driven by content (capped at 90% of the viewport), without an expand control.
|
|
28
|
+
* - `'full-compact'` — initially opens to full height, with the option to collapse to a compact header.
|
|
28
29
|
* - `'half'` — half the viewport height.
|
|
29
30
|
* - `'full'` — opens to the maximum height (90% of the viewport).
|
|
30
31
|
* @default 'half'
|
|
31
32
|
*/
|
|
32
|
-
size?: 'auto' | 'half' | 'full';
|
|
33
|
+
size?: 'auto' | 'full-compact' | 'half' | 'full';
|
|
33
34
|
/** Callback fired before the TouchDialog starts opening. */
|
|
34
35
|
onBeforeOpen?: DrawerProps['onBeforeOpen'];
|
|
35
36
|
/** Callback fired after the TouchDialog finishes opening. */
|
|
@@ -38,6 +39,13 @@ export interface TouchDialogProps extends BaseProps, TestIdProp {
|
|
|
38
39
|
onBeforeClose?: DrawerProps['onBeforeClose'];
|
|
39
40
|
/** Callback fired after the TouchDialog finishes closing. */
|
|
40
41
|
onAfterClose?: DrawerProps['onAfterClose'];
|
|
42
|
+
/**
|
|
43
|
+
* Action performed when a click occurs outside the dialog.
|
|
44
|
+
* - `'close'` — dismisses the dialog.
|
|
45
|
+
* - `'reset-size'` — resets to `compact` for `full-compact`, otherwise to the configured size.
|
|
46
|
+
* @default 'close'
|
|
47
|
+
*/
|
|
48
|
+
outerClickAction?: 'close' | 'reset-size';
|
|
41
49
|
/** Ref for the dialog panel element. */
|
|
42
50
|
ref?: Ref<HTMLDivElement>;
|
|
43
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,UAAU;IAC7D;;;;OAIG;IACH,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,yIAAyI;IACzI,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C
|
|
1
|
+
{"version":3,"file":"TouchDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,UAAU;IAC7D;;;;OAIG;IACH,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,yIAAyI;IACzI,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;IACjD,4DAA4D;IAC5D,YAAY,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3C,6DAA6D;IAC7D,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACzC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC1C,wCAAwC;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref, ReactNode } from 'react';\n\nimport type { BaseProps, TestIdProp } from '../../types';\nimport type { DrawerProps } from '../Drawer';\nimport type { ProgressProps } from '../Progress';\n\nexport interface TouchDialogProps extends BaseProps, TestIdProp {\n /**\n * Whether the TouchDialog should be open or closed.\n * The component should not be unmounted before onAfterClose is called,\n * otherwise the closing animation will be interrupted.\n */\n open: DrawerProps['open'];\n /**\n * Callback fired when the TouchDialog is dismissed with user intent.\n * The parent component should toggle the `open` prop.\n */\n onDismiss: () => void;\n /** Heading text displayed at the top of the drawer. */\n heading?: ReactNode;\n /** Aria label for the dialog, used when there is no heading. */\n 'aria-label'?: string;\n /** Content of the TouchDialog. */\n children?: DrawerProps['children'];\n /** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */\n progress?: boolean | ProgressProps['message'];\n /**\n * The initial height of the TouchDialog panel.\n * - `'auto'` — height is driven by content (capped at 90% of the viewport).\n * - `'half'` — half the viewport height.\n * - `'full'` — opens to the maximum height (90% of the viewport).\n * @default 'half'\n */\n size?: 'auto' | 'half' | 'full';\n /** Callback fired before the TouchDialog starts opening. */\n onBeforeOpen?: DrawerProps['onBeforeOpen'];\n /** Callback fired after the TouchDialog finishes opening. */\n onAfterOpen?: DrawerProps['onAfterOpen'];\n /** Callback fired before the TouchDialog starts closing. */\n onBeforeClose?: DrawerProps['onBeforeClose'];\n /** Callback fired after the TouchDialog finishes closing. */\n onAfterClose?: DrawerProps['onAfterClose'];\n /** Ref for the dialog panel element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TouchDialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/TouchDialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref, ReactNode } from 'react';\n\nimport type { BaseProps, TestIdProp } from '../../types';\nimport type { DrawerProps } from '../Drawer';\nimport type { ProgressProps } from '../Progress';\n\nexport interface TouchDialogProps extends BaseProps, TestIdProp {\n /**\n * Whether the TouchDialog should be open or closed.\n * The component should not be unmounted before onAfterClose is called,\n * otherwise the closing animation will be interrupted.\n */\n open: DrawerProps['open'];\n /**\n * Callback fired when the TouchDialog is dismissed with user intent.\n * The parent component should toggle the `open` prop.\n */\n onDismiss: () => void;\n /** Heading text displayed at the top of the drawer. */\n heading?: ReactNode;\n /** Aria label for the dialog, used when there is no heading. */\n 'aria-label'?: string;\n /** Content of the TouchDialog. */\n children?: DrawerProps['children'];\n /** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */\n progress?: boolean | ProgressProps['message'];\n /**\n * The initial height of the TouchDialog panel.\n * - `'auto'` — height is driven by content (capped at 90% of the viewport), without an expand control.\n * - `'full-compact'` — initially opens to full height, with the option to collapse to a compact header.\n * - `'half'` — half the viewport height.\n * - `'full'` — opens to the maximum height (90% of the viewport).\n * @default 'half'\n */\n size?: 'auto' | 'full-compact' | 'half' | 'full';\n /** Callback fired before the TouchDialog starts opening. */\n onBeforeOpen?: DrawerProps['onBeforeOpen'];\n /** Callback fired after the TouchDialog finishes opening. */\n onAfterOpen?: DrawerProps['onAfterOpen'];\n /** Callback fired before the TouchDialog starts closing. */\n onBeforeClose?: DrawerProps['onBeforeClose'];\n /** Callback fired after the TouchDialog finishes closing. */\n onAfterClose?: DrawerProps['onAfterClose'];\n /**\n * Action performed when a click occurs outside the dialog.\n * - `'close'` — dismisses the dialog.\n * - `'reset-size'` — resets to `compact` for `full-compact`, otherwise to the configured size.\n * @default 'close'\n */\n outerClickAction?: 'close' | 'reset-size';\n /** Ref for the dialog panel element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockedModals.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/DockedModals.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DockedModals.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/DockedModals.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAqB5C,QAAA,MAAM,YAAY;eACI,SAAS;kDAW7B,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -7,8 +7,9 @@ const StyledDockedModals = styled.div(({ theme }) => {
|
|
|
7
7
|
return css `
|
|
8
8
|
position: fixed;
|
|
9
9
|
z-index: ${theme.base['z-index'].modal};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
inset-block-end: calc(
|
|
11
|
+
var(--appshell-bottom-offset, 0rem) + var(--appshell-bottom-panel-gap, 0rem)
|
|
12
|
+
);
|
|
12
13
|
right: 0;
|
|
13
14
|
pointer-events: none;
|
|
14
15
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockedModals.js","sourceRoot":"","sources":["../../../src/components/Modal/DockedModals.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,OAAO,GAAG,CAAA;;eAEG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK
|
|
1
|
+
{"version":3,"file":"DockedModals.js","sourceRoot":"","sources":["../../../src/components/Modal/DockedModals.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,OAAO,GAAG,CAAA;;eAEG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK;;;;;;;GAOvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,YAAY,CACnD,KAA+B,EAC/B,GAAwB;IAExB,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EACrE,EAAE,EAAE,kBAAkB,KAClB,KAAK,EACT,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\n\nconst StyledDockedModals = styled.div(({ theme }) => {\n return css`\n position: fixed;\n z-index: ${theme.base['z-index'].modal};\n inset-block-end: calc(\n var(--appshell-bottom-offset, 0rem) + var(--appshell-bottom-panel-gap, 0rem)\n );\n right: 0;\n pointer-events: none;\n width: 100%;\n `;\n});\n\nStyledDockedModals.defaultProps = defaultThemeProp;\n\nconst DockedModals = forwardRef(function DockedModals(\n props: { children?: ReactNode },\n ref: Ref<HTMLDivElement>\n) {\n return (\n <Flex\n container={{ justify: 'end', alignItems: 'end', gap: 2, pad: [0, 2] }}\n as={StyledDockedModals}\n {...props}\n ref={ref}\n />\n );\n});\n\nexport default DockedModals;\n"]}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"semi-bold": 400,
|
|
19
19
|
"normal": 300
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"icon-set": "streamline"
|
|
22
22
|
},
|
|
23
23
|
"components": {
|
|
24
24
|
"agent": {
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"stages": {
|
|
79
79
|
"status": {
|
|
80
80
|
"completed": {
|
|
81
|
-
"background": "#
|
|
82
|
-
"foreground-color": "#
|
|
81
|
+
"background": "#CEEEC4",
|
|
82
|
+
"foreground-color": "#03681C"
|
|
83
83
|
},
|
|
84
84
|
"current": {
|
|
85
85
|
"background": "#CFE4FF"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "10.0.0-build.9.
|
|
3
|
+
"version": "10.0.0-build.9.2",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|