@pega/cosmos-react-wss 9.5.4 → 9.5.5-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.map +1 -1
- package/lib/components/AppShell/AppShell.js +21 -5
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +4 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +58 -39
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/PageTemplates/BannerPage.d.ts +15 -3
- package/lib/components/PageTemplates/BannerPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/BannerPage.js +125 -19
- package/lib/components/PageTemplates/BannerPage.js.map +1 -1
- package/lib/components/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/QuickCreate/QuickCreate.js +8 -8
- package/lib/components/QuickCreate/QuickCreate.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,+BAA+B,EAAkB,MAAM,yBAAyB,CAAC;AAS/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiBtD,QAAA,MAAM,QAAQ,EAAE,+BAA+B,CAAC,aAAa,CAkb3D,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { Avatar, Backdrop, Button, ThemeOverride, ContextSwitcher, debounce, Drawer, Flex, Icon, Image, Popover, SkipLinks, Text, useBreakpoint, useConsolidatedRef, useDirection, useElement, useI18n, useOuterEvent, useTheme, VisuallyHiddenText, MenuButton, ThemeSwitcher } from '@pega/cosmos-react-core';
|
|
3
|
+
import { Avatar, Backdrop, Button, ThemeOverride, ContextSwitcher, debounce, Drawer, Flex, getChildOfRootNode, Icon, Image, Popover, SkipLinks, Text, useBreakpoint, useConsolidatedRef, useDirection, useElement, useI18n, useOuterEvent, usePreviewManager, useTheme, VisuallyHiddenText, MenuButton, ThemeSwitcher } from '@pega/cosmos-react-core';
|
|
4
4
|
import Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';
|
|
5
5
|
import { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
|
|
6
6
|
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
7
7
|
import { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';
|
|
8
8
|
import useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';
|
|
9
9
|
import Footer from '../Footer';
|
|
10
|
-
import { StyledAppHeader, StyledCountIcon, StyledHamburgerMenu, StyledMain,
|
|
10
|
+
import { headerHeight, StyledAppHeader, StyledCountIcon, StyledHamburgerMenu, StyledMain, StyledNotificationCount, StyledPrimaryName, StyledEndNavBlock, StyledBannerRegion, tallHeaderHeight } from './AppShell.styles';
|
|
11
11
|
import Notifications from './Notifications';
|
|
12
12
|
import MobileHeaderContent from './MobileHeaderContent';
|
|
13
13
|
import NavLinks from './NavLinks';
|
|
@@ -27,6 +27,7 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
27
27
|
const [notificationsButtonEl, setNotificationsButtonEl] = useElement();
|
|
28
28
|
const minInlineWidth = useRef(0);
|
|
29
29
|
const theme = useTheme();
|
|
30
|
+
const { previewActive } = usePreviewManager();
|
|
30
31
|
const { themeMode, onThemeModeChange } = useThemeMode();
|
|
31
32
|
const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);
|
|
32
33
|
const headerRef = useConsolidatedRef(setHeaderEl, ref);
|
|
@@ -89,6 +90,16 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
89
90
|
useEffect(() => {
|
|
90
91
|
setHasMobileNav(!isSmallOrAbove || linksCollapsed);
|
|
91
92
|
}, [isSmallOrAbove, linksCollapsed]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!headerRef.current)
|
|
95
|
+
return;
|
|
96
|
+
const targetNode = getChildOfRootNode(headerRef);
|
|
97
|
+
if (!targetNode)
|
|
98
|
+
return;
|
|
99
|
+
if (!targetNode.style.getPropertyValue('--app-header-height')) {
|
|
100
|
+
targetNode.style.setProperty('--app-header-height', navPosition === 'below' ? tallHeaderHeight : headerHeight);
|
|
101
|
+
}
|
|
102
|
+
}, [headerEl, navPosition]);
|
|
92
103
|
useEffect(() => {
|
|
93
104
|
if (!hasMobileNav && drawerOpen) {
|
|
94
105
|
if (drawerContent === 'notifications' && notifications) {
|
|
@@ -102,7 +113,12 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
102
113
|
}
|
|
103
114
|
}, [hasMobileNav, drawerOpen]);
|
|
104
115
|
const hasFooter = !!footer?.length;
|
|
105
|
-
|
|
116
|
+
const useDefaultInlineLayout = isDefaultWSS || navPosition === 'inline';
|
|
117
|
+
return (_jsxs(_Fragment, { children: [_jsx(SkipLinks, { items: skipLinks }), _jsx(ThemeOverride, { theme: headerTheme, children: _jsxs(StyledAppHeader, { ref: headerRef, navPosition: navPosition, "$isDefaultWSS": useDefaultInlineLayout, children: [_jsxs(Flex, { container: {
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
justify: 'between',
|
|
120
|
+
pad: navPosition === 'below' ? [1, 0] : 0
|
|
121
|
+
}, children: [useDefaultInlineLayout ? (_jsxs(_Fragment, { children: [_jsxs(Flex, { container: { alignItems: 'center' }, children: [contexts && onContextClick && contexts.length > 1 && (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel, container: { justify: 'center', pad: [0, 0, 0, 1] } })), _jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] }))] })] }), !hasMobileNav && navPosition === 'inline' && (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true }))] })) : (_jsxs(Flex, { container: { alignItems: 'center' }, children: [contexts && onContextClick && contexts.length > 1 && (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel, container: { justify: 'center', pad: [0, 0, 0, 1] } })), navPosition !== 'below' || hasMobileNav ? (_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] }))] })) : null] })), _jsxs(Flex, { as: StyledEndNavBlock, container: { alignItems: 'center', gap: 1 }, mobile: hasMobileNav, children: [onThemeModeChange && (_jsx(ThemeSwitcher, { themeMode: themeMode, onThemeModeChange: onThemeModeChange })), notifications && (_jsxs(_Fragment, { children: [_jsx(Button, { ref: setNotificationsButtonEl, variant: 'simple', label: t('open_app_header_notifications'), icon: true, onClick: () => {
|
|
106
122
|
if (!hasMobileNav) {
|
|
107
123
|
if (notificationsPopover) {
|
|
108
124
|
setNotificationsPopover(false);
|
|
@@ -118,9 +134,9 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
118
134
|
}
|
|
119
135
|
}, children: _jsxs(StyledNotificationCount, { children: [_jsx(Icon, { name: 'bell' }), !!notifications.count && (_jsx(StyledCountIcon, { variant: 'urgent', children: notifications.count }))] }) }), _jsx(Popover, { ref: setPopoverEl, show: notificationsPopover, target: notificationsButtonEl, placement: 'bottom-end', children: _jsx(Notifications, { ...notifications, popover: true }) })] })), helpMenu && (_jsx(MenuButton, { variant: 'simple', icon: 'help', text: t('app_header_help'), iconOnly: true, menu: {
|
|
120
136
|
items: helpMenu
|
|
121
|
-
} })), !hasMobileNav && (
|
|
137
|
+
} })), !hasMobileNav && (_jsx(Operator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, name: operator.avatar.name, children: _jsx(Avatar, { ...operator.avatar }) })), hasMobileNav && (_jsx(Button, { as: StyledHamburgerMenu, label: t('open_app_header_drawer'), variant: 'simple', icon: true, onClick: () => openDrawer('navigationOperator'), children: _jsx(Icon, { name: 'bars' }) }))] })] }), navPosition === 'below' &&
|
|
122
138
|
!hasMobileNav &&
|
|
123
|
-
(
|
|
139
|
+
(useDefaultInlineLayout ? (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true })) : (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), _jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'center' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] })] }), _jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: 'below' })] })))] }) }), _jsxs(StyledMain, { navPosition: navPosition, "$isDefaultWSS": isDefaultWSS, "$hasFooter": hasFooter, previewActive: previewActive, children: [banners && _jsx(StyledBannerRegion, { children: banners }), main] }), footer && footer.length > 0 && _jsx(Footer, { links: footer }), _jsx(Backdrop, { open: backdropOpen, transitionSpeed: 'none', onAfterTransitionIn: () => setDrawerOpen(true), onBeforeTransitionOut: () => setDrawerOpen(false), onClick: e => {
|
|
124
140
|
if (e.currentTarget === e.target)
|
|
125
141
|
setDrawerOpen(false);
|
|
126
142
|
}, children: _jsxs(Drawer, { open: drawerOpen, onAfterClose: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,QAAQ,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AA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AAC,CAAC,MAAM;wBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;gBACzD,CAAC,YAED,MAAC,MAAM,IACL,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,GAAG,EAAE;wBACjB,WAAW,EAAE,CAAC;wBACd,IAAI,aAAa,KAAK,eAAe,EAAE,CAAC;4BACtC,aAAa,EAAE,oBAAoB,EAAE,EAAE,CAAC;wBAC1C,CAAC;oBACH,CAAC,EACD,WAAW,EAAE,GAAG,EAAE;wBAChB,IAAI,aAAa,KAAK,eAAe,EAAE,CAAC;4BACtC,aAAa,EAAE,mBAAmB,EAAE,EAAE,CAAC;wBACzC,CAAC;oBACH,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,GAAG,EACd,IAAI,EAAC,gCAAgC,EACrC,cAAc,mBAEb,aAAa,KAAK,eAAe,IAAI,aAAa,IAAI,CACrD,KAAC,aAAa,OAAK,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GAAI,CAC1E,EACA,aAAa,KAAK,oBAAoB,IAAI,CACzC,KAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACnC,CACH,IACM,GACA,IACV,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ElementType, PropsWithoutRef } from 'react';\n\nimport {\n Avatar,\n Backdrop,\n Button,\n ThemeOverride,\n ContextSwitcher,\n debounce,\n Drawer,\n Flex,\n Icon,\n Image,\n Popover,\n SkipLinks,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useElement,\n useI18n,\n useOuterEvent,\n useTheme,\n VisuallyHiddenText,\n MenuButton,\n ThemeSwitcher\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, SkipLinksProps } from '@pega/cosmos-react-core';\nimport Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';\nimport useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';\n\nimport Footer from '../Footer';\n\nimport type { AppShellProps } from './AppShell.types';\nimport {\n StyledAppHeader,\n StyledCountIcon,\n StyledHamburgerMenu,\n StyledMain,\n StyledModernAppHeaderOperator,\n StyledNotificationCount,\n StyledPrimaryName,\n StyledEndNavBlock,\n StyledBannerRegion\n} from './AppShell.styles';\nimport Notifications from './Notifications';\nimport MobileHeaderContent from './MobileHeaderContent';\nimport NavLinks from './NavLinks';\n\nconst AppShell: ForwardRefForwardPropsComponent<AppShellProps> = forwardRef(function AppShell(\n props: PropsWithoutRef<AppShellProps>,\n ref: AppShellProps['ref']\n) {\n const {\n main,\n banners,\n appInfo,\n navLinks,\n operator,\n notifications,\n contextSwitcher = {},\n navAlignment = 'end',\n navPosition = 'inline',\n isDefaultWSS = true,\n helpMenu,\n footer\n } = props;\n const t = useI18n();\n const {\n contexts,\n onContextClick,\n label: contextSwitcherLabel = t('switch_to')\n } = contextSwitcher;\n const [backdropOpen, setBackdropOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [drawerContent, setDrawerContent] = useState('');\n const [notificationsPopover, setNotificationsPopover] = useState(false);\n const [linksCollapsed, setLinksCollapsed] = useState(false);\n const [hasMobileNav, setHasMobileNav] = useState(true);\n\n const [headerEl, setHeaderEl] = useElement<HTMLElement>();\n const [navSectionEl, setNavSectionEl] = useElement<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLDivElement>();\n const [notificationsButtonEl, setNotificationsButtonEl] = useElement<HTMLButtonElement>();\n const minInlineWidth = useRef(0);\n const theme = useTheme();\n const { themeMode, onThemeModeChange } = useThemeMode();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n const headerRef = useConsolidatedRef(setHeaderEl, ref);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const { end } = useDirection();\n\n let appInfoAs: ElementType = 'div';\n if (appInfo.href) appInfoAs = 'a';\n else if (appInfo.onClick) appInfoAs = BareButton;\n\n const skipLinks: SkipLinksProps['items'] = useMemo(\n () => [\n {\n label: t('go_to_main_content'),\n target: { ariaLabel: t('main_content'), selector: 'main' }\n }\n ],\n [t]\n );\n\n const closeDrawer = () => {\n setDrawerContent('');\n setBackdropOpen(false);\n };\n\n const openDrawer = (content: 'notifications' | 'navigationOperator') => {\n setDrawerContent(content);\n setBackdropOpen(true);\n };\n\n useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], () => {\n setNotificationsPopover(false);\n notifications?.onNotificationsClose?.();\n });\n\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minInlineWidth.current) {\n setLinksCollapsed(false);\n }\n }, 100);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(debouncedResize);\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (\n entries[0].intersectionRatio > 0 &&\n entries[0].intersectionRatio < 1 &&\n !linksCollapsed\n ) {\n if (headerEl) minInlineWidth.current = headerEl.clientWidth + 1;\n setLinksCollapsed(true);\n } else if (navSectionEl) navSectionEl.style.visibility = 'visible';\n },\n { root: navPosition === 'below' ? null : navSectionEl, threshold: 1 }\n );\n\n if (headerEl && navSectionEl?.firstChild && navSectionEl?.lastChild) {\n intersectionObserver.observe(\n navAlignment === 'start'\n ? (navSectionEl.lastChild as Element)\n : (navSectionEl.firstChild as Element)\n );\n resizeObserver.observe(headerEl);\n }\n\n return () => {\n if (!headerEl) {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n }\n };\n }, [headerEl, navSectionEl, navLinks]);\n\n useEffect(() => {\n setHasMobileNav(!isSmallOrAbove || linksCollapsed);\n }, [isSmallOrAbove, linksCollapsed]);\n\n useEffect(() => {\n if (!hasMobileNav && drawerOpen) {\n if (drawerContent === 'notifications' && notifications) {\n setNotificationsPopover(true);\n }\n setDrawerOpen(false);\n } else if (hasMobileNav && notificationsPopover) {\n setNotificationsPopover(false);\n openDrawer('notifications');\n }\n }, [hasMobileNav, drawerOpen]);\n\n const hasFooter = !!footer?.length;\n\n return (\n <>\n <SkipLinks items={skipLinks} />\n <ThemeOverride theme={headerTheme}>\n <StyledAppHeader ref={headerRef} navPosition={navPosition} $isDefaultWSS={isDefaultWSS}>\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n {isDefaultWSS ? (\n <>\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n\n {!hasMobileNav && navPosition === 'inline' && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n )}\n </>\n ) : (\n <Flex\n container={{ alignItems: 'center' }}\n item={navPosition === 'inline' ? { grow: 1 } : undefined}\n >\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n {navPosition !== 'below' && (\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n )}\n\n {!hasMobileNav && navPosition === 'inline' && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n />\n )}\n </Flex>\n )}\n\n <Flex as={StyledEndNavBlock} container={{ alignItems: 'center' }} mobile={hasMobileNav}>\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\n )}\n {notifications && (\n <>\n <Button\n ref={setNotificationsButtonEl}\n variant='simple'\n label={t('open_app_header_notifications')}\n icon\n onClick={() => {\n if (!hasMobileNav) {\n if (notificationsPopover) {\n setNotificationsPopover(false);\n notifications.onNotificationsClose?.();\n } else {\n setNotificationsPopover(true);\n notifications.onNotificationsOpen?.();\n }\n } else {\n openDrawer('notifications');\n }\n }}\n >\n <StyledNotificationCount>\n <Icon name='bell' />\n {!!notifications.count && (\n <StyledCountIcon variant='urgent'>{notifications.count}</StyledCountIcon>\n )}\n </StyledNotificationCount>\n </Button>\n <Popover\n ref={setPopoverEl}\n show={notificationsPopover}\n target={notificationsButtonEl}\n placement='bottom-end'\n >\n <Notifications {...notifications} popover />\n </Popover>\n </>\n )}\n {helpMenu && (\n <MenuButton\n variant='simple'\n icon='help'\n text={t('app_header_help')}\n iconOnly\n menu={{\n items: helpMenu\n }}\n />\n )}\n {!hasMobileNav && (\n <Operator\n as={isDefaultWSS ? StyledAppHeaderOperator : StyledModernAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.avatar.name}\n >\n {isDefaultWSS ? (\n <Avatar {...operator.avatar} />\n ) : (\n <Avatar {...operator.avatar} size='s' />\n )}\n {!isDefaultWSS && operator.avatar.name && (\n <Text variant='secondary'>{t('hello_name', [operator.avatar.name])}</Text>\n )}\n </Operator>\n )}\n\n {hasMobileNav && (\n <Button\n as={StyledHamburgerMenu}\n label={t('open_app_header_drawer')}\n variant='simple'\n icon\n onClick={() => openDrawer('navigationOperator')}\n >\n <Icon name='bars' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n {navPosition === 'below' &&\n !hasMobileNav &&\n (isDefaultWSS ? (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n ) : (\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n </Flex>\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition='below'\n />\n </Flex>\n ))}\n </StyledAppHeader>\n </ThemeOverride>\n\n <StyledMain navPosition={navPosition} $isDefaultWSS={isDefaultWSS} $hasFooter={hasFooter}>\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledMain>\n\n {footer && footer.length > 0 && <Footer links={footer} />}\n\n <Backdrop\n open={backdropOpen}\n transitionSpeed='none'\n onAfterTransitionIn={() => setDrawerOpen(true)}\n onBeforeTransitionOut={() => setDrawerOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setDrawerOpen(false);\n }}\n >\n <Drawer\n open={drawerOpen}\n onAfterClose={() => {\n closeDrawer();\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsClose?.();\n }\n }}\n onAfterOpen={() => {\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsOpen?.();\n }\n }}\n position='fixed'\n placement={end}\n size='min(26rem, calc(100vw - 5rem))'\n nullWhenClosed\n >\n {drawerContent === 'notifications' && notifications && (\n <Notifications {...notifications} onClose={() => setDrawerOpen(false)} />\n )}\n {drawerContent === 'navigationOperator' && (\n <MobileHeaderContent\n appInfo={appInfo}\n navLinks={navLinks}\n operator={operator}\n onClose={() => setDrawerOpen(false)}\n />\n )}\n </Drawer>\n </Backdrop>\n </>\n );\n});\n\nexport default AppShell;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,kBAAkB,EAClB,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,C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e,QAAQ,CAAC","sourcesContent":["import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ElementType, PropsWithoutRef } from 'react';\n\nimport {\n Avatar,\n Backdrop,\n Button,\n ThemeOverride,\n ContextSwitcher,\n debounce,\n Drawer,\n Flex,\n getChildOfRootNode,\n Icon,\n Image,\n Popover,\n SkipLinks,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useElement,\n useI18n,\n useOuterEvent,\n usePreviewManager,\n useTheme,\n VisuallyHiddenText,\n MenuButton,\n ThemeSwitcher\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, SkipLinksProps } from '@pega/cosmos-react-core';\nimport Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';\nimport useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';\n\nimport Footer from '../Footer';\n\nimport type { AppShellProps } from './AppShell.types';\nimport {\n headerHeight,\n StyledAppHeader,\n StyledCountIcon,\n StyledHamburgerMenu,\n StyledMain,\n StyledNotificationCount,\n StyledPrimaryName,\n StyledEndNavBlock,\n StyledBannerRegion,\n tallHeaderHeight\n} from './AppShell.styles';\nimport Notifications from './Notifications';\nimport MobileHeaderContent from './MobileHeaderContent';\nimport NavLinks from './NavLinks';\n\nconst AppShell: ForwardRefForwardPropsComponent<AppShellProps> = forwardRef(function AppShell(\n props: PropsWithoutRef<AppShellProps>,\n ref: AppShellProps['ref']\n) {\n const {\n main,\n banners,\n appInfo,\n navLinks,\n operator,\n notifications,\n contextSwitcher = {},\n navAlignment = 'end',\n navPosition = 'inline',\n isDefaultWSS = true,\n helpMenu,\n footer\n } = props;\n const t = useI18n();\n const {\n contexts,\n onContextClick,\n label: contextSwitcherLabel = t('switch_to')\n } = contextSwitcher;\n const [backdropOpen, setBackdropOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [drawerContent, setDrawerContent] = useState('');\n const [notificationsPopover, setNotificationsPopover] = useState(false);\n const [linksCollapsed, setLinksCollapsed] = useState(false);\n const [hasMobileNav, setHasMobileNav] = useState(true);\n\n const [headerEl, setHeaderEl] = useElement<HTMLElement>();\n const [navSectionEl, setNavSectionEl] = useElement<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLDivElement>();\n const [notificationsButtonEl, setNotificationsButtonEl] = useElement<HTMLButtonElement>();\n const minInlineWidth = useRef(0);\n const theme = useTheme();\n const { previewActive } = usePreviewManager();\n const { themeMode, onThemeModeChange } = useThemeMode();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n const headerRef = useConsolidatedRef(setHeaderEl, ref);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const { end } = useDirection();\n\n let appInfoAs: ElementType = 'div';\n if (appInfo.href) appInfoAs = 'a';\n else if (appInfo.onClick) appInfoAs = BareButton;\n\n const skipLinks: SkipLinksProps['items'] = useMemo(\n () => [\n {\n label: t('go_to_main_content'),\n target: { ariaLabel: t('main_content'), selector: 'main' }\n }\n ],\n [t]\n );\n\n const closeDrawer = () => {\n setDrawerContent('');\n setBackdropOpen(false);\n };\n\n const openDrawer = (content: 'notifications' | 'navigationOperator') => {\n setDrawerContent(content);\n setBackdropOpen(true);\n };\n\n useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], () => {\n setNotificationsPopover(false);\n notifications?.onNotificationsClose?.();\n });\n\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minInlineWidth.current) {\n setLinksCollapsed(false);\n }\n }, 100);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(debouncedResize);\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (\n entries[0].intersectionRatio > 0 &&\n entries[0].intersectionRatio < 1 &&\n !linksCollapsed\n ) {\n if (headerEl) minInlineWidth.current = headerEl.clientWidth + 1;\n setLinksCollapsed(true);\n } else if (navSectionEl) navSectionEl.style.visibility = 'visible';\n },\n { root: navPosition === 'below' ? null : navSectionEl, threshold: 1 }\n );\n\n if (headerEl && navSectionEl?.firstChild && navSectionEl?.lastChild) {\n intersectionObserver.observe(\n navAlignment === 'start'\n ? (navSectionEl.lastChild as Element)\n : (navSectionEl.firstChild as Element)\n );\n resizeObserver.observe(headerEl);\n }\n\n return () => {\n if (!headerEl) {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n }\n };\n }, [headerEl, navSectionEl, navLinks]);\n\n useEffect(() => {\n setHasMobileNav(!isSmallOrAbove || linksCollapsed);\n }, [isSmallOrAbove, linksCollapsed]);\n\n useEffect(() => {\n if (!headerRef.current) return;\n const targetNode = getChildOfRootNode(headerRef);\n if (!targetNode) return;\n if (!targetNode.style.getPropertyValue('--app-header-height')) {\n targetNode.style.setProperty(\n '--app-header-height',\n navPosition === 'below' ? tallHeaderHeight : headerHeight\n );\n }\n }, [headerEl, navPosition]);\n\n useEffect(() => {\n if (!hasMobileNav && drawerOpen) {\n if (drawerContent === 'notifications' && notifications) {\n setNotificationsPopover(true);\n }\n setDrawerOpen(false);\n } else if (hasMobileNav && notificationsPopover) {\n setNotificationsPopover(false);\n openDrawer('notifications');\n }\n }, [hasMobileNav, drawerOpen]);\n\n const hasFooter = !!footer?.length;\n const useDefaultInlineLayout = isDefaultWSS || navPosition === 'inline';\n\n return (\n <>\n <SkipLinks items={skipLinks} />\n <ThemeOverride theme={headerTheme}>\n <StyledAppHeader\n ref={headerRef}\n navPosition={navPosition}\n $isDefaultWSS={useDefaultInlineLayout}\n >\n <Flex\n container={{\n alignItems: 'center',\n justify: 'between',\n pad: navPosition === 'below' ? [1, 0] : 0\n }}\n >\n {useDefaultInlineLayout ? (\n <>\n <Flex container={{ alignItems: 'center' }}>\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {!hasMobileNav && navPosition === 'inline' && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n )}\n </>\n ) : (\n <Flex container={{ alignItems: 'center' }}>\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n {navPosition !== 'below' || hasMobileNav ? (\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n ) : null}\n </Flex>\n )}\n\n <Flex\n as={StyledEndNavBlock}\n container={{ alignItems: 'center', gap: 1 }}\n mobile={hasMobileNav}\n >\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\n )}\n\n {notifications && (\n <>\n <Button\n ref={setNotificationsButtonEl}\n variant='simple'\n label={t('open_app_header_notifications')}\n icon\n onClick={() => {\n if (!hasMobileNav) {\n if (notificationsPopover) {\n setNotificationsPopover(false);\n notifications.onNotificationsClose?.();\n } else {\n setNotificationsPopover(true);\n notifications.onNotificationsOpen?.();\n }\n } else {\n openDrawer('notifications');\n }\n }}\n >\n <StyledNotificationCount>\n <Icon name='bell' />\n {!!notifications.count && (\n <StyledCountIcon variant='urgent'>{notifications.count}</StyledCountIcon>\n )}\n </StyledNotificationCount>\n </Button>\n <Popover\n ref={setPopoverEl}\n show={notificationsPopover}\n target={notificationsButtonEl}\n placement='bottom-end'\n >\n <Notifications {...notifications} popover />\n </Popover>\n </>\n )}\n\n {helpMenu && (\n <MenuButton\n variant='simple'\n icon='help'\n text={t('app_header_help')}\n iconOnly\n menu={{\n items: helpMenu\n }}\n />\n )}\n\n {!hasMobileNav && (\n <Operator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.avatar.name}\n >\n <Avatar {...operator.avatar} />\n </Operator>\n )}\n\n {hasMobileNav && (\n <Button\n as={StyledHamburgerMenu}\n label={t('open_app_header_drawer')}\n variant='simple'\n icon\n onClick={() => openDrawer('navigationOperator')}\n >\n <Icon name='bars' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n {navPosition === 'below' &&\n !hasMobileNav &&\n (useDefaultInlineLayout ? (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n ) : (\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'center' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n </Flex>\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition='below'\n />\n </Flex>\n ))}\n </StyledAppHeader>\n </ThemeOverride>\n\n <StyledMain\n navPosition={navPosition}\n $isDefaultWSS={isDefaultWSS}\n $hasFooter={hasFooter}\n previewActive={previewActive}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledMain>\n\n {footer && footer.length > 0 && <Footer links={footer} />}\n\n <Backdrop\n open={backdropOpen}\n transitionSpeed='none'\n onAfterTransitionIn={() => setDrawerOpen(true)}\n onBeforeTransitionOut={() => setDrawerOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setDrawerOpen(false);\n }}\n >\n <Drawer\n open={drawerOpen}\n onAfterClose={() => {\n closeDrawer();\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsClose?.();\n }\n }}\n onAfterOpen={() => {\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsOpen?.();\n }\n }}\n position='fixed'\n placement={end}\n size='min(26rem, calc(100vw - 5rem))'\n nullWhenClosed\n >\n {drawerContent === 'notifications' && notifications && (\n <Notifications {...notifications} onClose={() => setDrawerOpen(false)} />\n )}\n {drawerContent === 'navigationOperator' && (\n <MobileHeaderContent\n appInfo={appInfo}\n navLinks={navLinks}\n operator={operator}\n onClose={() => setDrawerOpen(false)}\n />\n )}\n </Drawer>\n </Backdrop>\n </>\n );\n});\n\nexport default AppShell;\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { AppShellProps } from './AppShell.types';
|
|
2
|
+
export declare const headerHeight = "3rem";
|
|
3
|
+
export declare const tallHeaderHeight = "6rem";
|
|
2
4
|
export declare const footerHeight = "2.25rem";
|
|
3
5
|
export declare const StyledNav: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
6
|
+
export declare const StyledPrimaryName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
7
|
export declare const StyledAppHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
|
|
5
8
|
navPosition: AppShellProps["navPosition"];
|
|
6
9
|
$isDefaultWSS: boolean;
|
|
7
10
|
}>> & string;
|
|
8
|
-
export declare const StyledPrimaryName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
9
11
|
export declare const StyledEndNavBlock: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
10
12
|
mobile: boolean;
|
|
11
13
|
}>> & string;
|
|
@@ -14,6 +16,7 @@ export declare const StyledMain: import("styled-components/dist/types").IStyledC
|
|
|
14
16
|
navPosition: AppShellProps["navPosition"];
|
|
15
17
|
$isDefaultWSS: boolean;
|
|
16
18
|
$hasFooter: boolean;
|
|
19
|
+
previewActive: boolean;
|
|
17
20
|
}>> & string;
|
|
18
21
|
export declare const StyledModernAppHeaderOperator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
19
22
|
export declare const StyledHamburgerMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
@@ -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":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAGvC,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,SAAS,uNAUrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,+NAY5B,CAAC;AAIH,eAAO,MAAM,eAAe;iBACb,aAAa,CAAC,aAAa,CAAC;mBAC1B,OAAO;YAwGvB,CAAC;AAIF,eAAO,MAAM,iBAAiB;YAAwB,OAAO;YAS3D,CAAC;AAEH,eAAO,MAAM,UAAU,yOA0CrB,CAAC;AAIH,eAAO,MAAM,UAAU;iBACR,aAAa,CAAC,aAAa,CAAC;mBAC1B,OAAO;gBACV,OAAO;mBACJ,OAAO;YAwDtB,CAAC;AAIH,eAAO,MAAM,6BAA6B,6NAgBxC,CAAC;AAIH,eAAO,MAAM,mBAAmB,yOAI9B,CAAC;AAIH,eAAO,MAAM,eAAe,uNAK1B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yOAmC3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,6NAE7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,6NAGjC,CAAC;AAEF,eAAO,MAAM,eAAe,6NAU1B,CAAC;AAIH,eAAO,MAAM,uBAAuB,6NAGnC,CAAC;AAIF,eAAO,MAAM,eAAe;;;2BAjW0B,CAAC;iDAsWtD,CAAC;AAIF,eAAO,MAAM,mBAAmB;cAA0B,OAAO;YAW/D,CAAC;AAIH,eAAO,MAAM,sBAAsB,iOAQjC,CAAC;AAIH,eAAO,MAAM,kBAAkB;;gOA0B7B,CAAC;AAIH,eAAO,MAAM,wBAAwB;aAA0B,OAAO;YAiBpE,CAAC;AAIH,eAAO,MAAM,yBAAyB;aAA0B,OAAO;YAMrE,CAAC;AAIH,eAAO,MAAM,2BAA2B;aAA0B,OAAO;YAUxE,CAAC;AAIF,eAAO,MAAM,kBAAkB,6NAAe,CAAC;AAI/C,eAAO,MAAM,yBAAyB,shBAQrC,CAAC;AAIF,eAAO,MAAM,aAAa,6NAGzB,CAAC;AAIF,eAAO,MAAM,eAAe;;gOAG3B,CAAC;AAIF,eAAO,MAAM,gBAAgB;;kHAK5B,CAAC;AAIF,eAAO,MAAM,mBAAmB;;mBAE/B,CAAC"}
|
|
@@ -4,10 +4,11 @@ import { calculateFontSize, calculateForegroundColor, Count, defaultThemeProp, S
|
|
|
4
4
|
import { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
|
|
5
5
|
import { StyledAlert } from '@pega/cosmos-react-core/lib/components/Badges/Alert';
|
|
6
6
|
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
7
|
+
import { resizeDrawerMaxWidth } from '@pega/cosmos-react-core/lib/styles/constants';
|
|
8
|
+
export const headerHeight = '3rem';
|
|
9
|
+
export const tallHeaderHeight = '6rem';
|
|
10
|
+
const topBarHeight = '2.75rem';
|
|
11
|
+
const navBarHeight = '3.25rem';
|
|
11
12
|
export const footerHeight = '2.25rem';
|
|
12
13
|
export const StyledNav = styled.nav `
|
|
13
14
|
white-space: nowrap;
|
|
@@ -20,15 +21,29 @@ export const StyledNav = styled.nav `
|
|
|
20
21
|
text-decoration: none;
|
|
21
22
|
}
|
|
22
23
|
`;
|
|
23
|
-
export const
|
|
24
|
+
export const StyledPrimaryName = styled.span(({ theme }) => {
|
|
25
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
26
|
+
return css `
|
|
27
|
+
color: ${theme.base.palette['foreground-color']};
|
|
28
|
+
font-size: ${fontSize.xxl};
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
display: block;
|
|
33
|
+
max-width: 50ch;
|
|
34
|
+
`;
|
|
35
|
+
});
|
|
36
|
+
StyledPrimaryName.defaultProps = defaultThemeProp;
|
|
37
|
+
export const StyledAppHeader = styled.header(({ navPosition, $isDefaultWSS, theme: { base, components: { 'app-shell': { header: { background: headerBg, 'foreground-color': headerFgColor, 'border-color': headerBorderColor }, nav: { background: navBg, 'foreground-color': navFgColor } } } } }) => {
|
|
24
38
|
const foregroundColor = calculateForegroundColor(headerBg, headerFgColor);
|
|
25
39
|
const isModernStacked = !$isDefaultWSS && navPosition === 'below';
|
|
40
|
+
const navForeground = calculateForegroundColor(navBg, navFgColor);
|
|
26
41
|
return css `
|
|
27
42
|
position: sticky;
|
|
28
43
|
inset-block-start: 0;
|
|
29
44
|
height: ${navPosition === 'below' ? tallHeaderHeight : headerHeight};
|
|
30
45
|
width: 100%;
|
|
31
|
-
background: ${isModernStacked ?
|
|
46
|
+
background: ${isModernStacked ? 'transparent' : headerBg};
|
|
32
47
|
z-index: calc(${base['z-index'].popover} + 1);
|
|
33
48
|
border-bottom: 0.0625rem solid
|
|
34
49
|
${$isDefaultWSS ? base.palette['border-line'] : headerBorderColor};
|
|
@@ -38,6 +53,10 @@ export const StyledAppHeader = styled.header(({ navPosition, $isDefaultWSS, them
|
|
|
38
53
|
height: 1.625rem;
|
|
39
54
|
}
|
|
40
55
|
|
|
56
|
+
${StyledPrimaryName} {
|
|
57
|
+
max-width: min(50ch, 50vw);
|
|
58
|
+
}
|
|
59
|
+
|
|
41
60
|
& > ${StyledFlex} {
|
|
42
61
|
height: ${headerHeight};
|
|
43
62
|
|
|
@@ -65,12 +84,14 @@ export const StyledAppHeader = styled.header(({ navPosition, $isDefaultWSS, them
|
|
|
65
84
|
|
|
66
85
|
${isModernStacked &&
|
|
67
86
|
css `
|
|
87
|
+
border-bottom: none;
|
|
88
|
+
|
|
68
89
|
& > ${StyledFlex}:first-child {
|
|
69
90
|
height: ${topBarHeight};
|
|
70
|
-
max-width: 80rem;
|
|
71
|
-
margin-inline: auto;
|
|
72
91
|
width: 100%;
|
|
73
|
-
|
|
92
|
+
background: ${navBg};
|
|
93
|
+
color: ${navForeground};
|
|
94
|
+
padding-inline: max(calc(${base.spacing} * 2), calc((100% - 80rem) / 2));
|
|
74
95
|
|
|
75
96
|
& > a,
|
|
76
97
|
& > button {
|
|
@@ -80,53 +101,40 @@ export const StyledAppHeader = styled.header(({ navPosition, $isDefaultWSS, them
|
|
|
80
101
|
|
|
81
102
|
& > ${StyledFlex}:nth-child(2) {
|
|
82
103
|
height: ${navBarHeight};
|
|
83
|
-
max-width: 80rem;
|
|
84
|
-
margin-inline: auto;
|
|
85
104
|
width: 100%;
|
|
86
|
-
|
|
105
|
+
background: ${headerBg};
|
|
106
|
+
color: ${foregroundColor};
|
|
107
|
+
padding-inline: max(calc(${base.spacing} * 2), calc((100% - 80rem) / 2));
|
|
108
|
+
|
|
109
|
+
${StyledPrimaryName} {
|
|
110
|
+
color: ${foregroundColor};
|
|
111
|
+
}
|
|
87
112
|
}
|
|
88
113
|
|
|
89
114
|
@media screen and (min-width: ${base.breakpoints.md}) {
|
|
90
115
|
& > ${StyledFlex}:first-child, & > ${StyledFlex}:nth-child(2) {
|
|
91
|
-
padding-inline: calc(${base.spacing} * 2.5);
|
|
116
|
+
padding-inline: max(calc(${base.spacing} * 2.5), calc((100% - 80rem) / 2));
|
|
92
117
|
}
|
|
93
118
|
}
|
|
94
|
-
|
|
95
|
-
&::after {
|
|
96
|
-
content: '';
|
|
97
|
-
position: absolute;
|
|
98
|
-
top: ${topBarHeight};
|
|
99
|
-
left: 0;
|
|
100
|
-
right: 0;
|
|
101
|
-
border-bottom: 0.0625rem solid ${base.palette['border-line']};
|
|
102
|
-
}
|
|
103
119
|
`}
|
|
104
120
|
`;
|
|
105
121
|
});
|
|
106
122
|
StyledAppHeader.defaultProps = defaultThemeProp;
|
|
107
|
-
export const StyledPrimaryName = styled.span(({ theme }) => {
|
|
108
|
-
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
109
|
-
return css `
|
|
110
|
-
color: ${theme.base.palette['foreground-color']};
|
|
111
|
-
font-size: ${fontSize.xxl};
|
|
112
|
-
white-space: nowrap;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
text-overflow: ellipsis;
|
|
115
|
-
display: block;
|
|
116
|
-
max-width: 50ch;
|
|
117
|
-
`;
|
|
118
|
-
});
|
|
119
|
-
StyledPrimaryName.defaultProps = defaultThemeProp;
|
|
120
123
|
export const StyledEndNavBlock = styled.div(({ mobile }) => {
|
|
121
|
-
return
|
|
124
|
+
return css `
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
|
|
127
|
+
${mobile &&
|
|
122
128
|
css `
|
|
123
129
|
margin-inline-start: auto;
|
|
124
|
-
`
|
|
130
|
+
`}
|
|
131
|
+
`;
|
|
125
132
|
});
|
|
126
133
|
export const StyledLink = styled.a(({ theme }) => {
|
|
127
134
|
const hoverColor = lighten(0.2, theme.base.palette.interactive);
|
|
128
135
|
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
129
136
|
return css `
|
|
137
|
+
color: inherit;
|
|
130
138
|
margin: 0 calc(0.5 * ${theme.base.spacing});
|
|
131
139
|
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
132
140
|
font-size: ${fontSize.m};
|
|
@@ -165,14 +173,14 @@ export const StyledLink = styled.a(({ theme }) => {
|
|
|
165
173
|
`;
|
|
166
174
|
});
|
|
167
175
|
StyledLink.defaultProps = defaultThemeProp;
|
|
168
|
-
export const StyledMain = styled.main(({ navPosition, theme, $isDefaultWSS, $hasFooter }) => {
|
|
176
|
+
export const StyledMain = styled.main(({ navPosition, theme, $isDefaultWSS, $hasFooter, previewActive }) => {
|
|
169
177
|
const calculatedHeaderHeight = navPosition === 'below' ? tallHeaderHeight : headerHeight;
|
|
170
178
|
return css `
|
|
171
179
|
--appshell-offset: ${calculatedHeaderHeight};
|
|
172
180
|
--appshell-horizontal-offset: 0;
|
|
173
181
|
position: relative;
|
|
174
182
|
min-height: calc(100vh - ${calculatedHeaderHeight});
|
|
175
|
-
background
|
|
183
|
+
background: ${theme.base.palette['app-background']};
|
|
176
184
|
|
|
177
185
|
:focus {
|
|
178
186
|
outline: none;
|
|
@@ -207,6 +215,17 @@ export const StyledMain = styled.main(({ navPosition, theme, $isDefaultWSS, $has
|
|
|
207
215
|
css `
|
|
208
216
|
--footer-height: ${footerHeight};
|
|
209
217
|
`}
|
|
218
|
+
|
|
219
|
+
@media (min-width: ${theme.base.breakpoints.md}) {
|
|
220
|
+
transition: margin-inline-end ${theme.base.animation.speed}
|
|
221
|
+
${theme.base.animation.timing.ease};
|
|
222
|
+
|
|
223
|
+
${previewActive &&
|
|
224
|
+
css `
|
|
225
|
+
transition: none;
|
|
226
|
+
margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});
|
|
227
|
+
`}
|
|
228
|
+
}
|
|
210
229
|
`;
|
|
211
230
|
});
|
|
212
231
|
StyledMain.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,MAAM,EAAE,EAAE,GAAG,EA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AY,CAAC,CAAA;;CAEtD,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { lighten, mix } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n calculateForegroundColor,\n Count,\n defaultThemeProp,\n StyledFlex,\n StyledImage,\n StyledText,\n StyledVisual,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport { StyledAlert } from '@pega/cosmos-react-core/lib/components/Badges/Alert';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nimport type { AppShellProps } from './AppShell.types';\n\nconst headerHeight = '3rem';\nconst tallHeaderHeight = '6rem';\nconst topBarHeight = '2.25rem';\nconst navBarHeight = '3.75rem';\nexport const footerHeight = '2.25rem';\n\nexport const StyledNav = styled.nav`\n white-space: nowrap;\n overflow: visible;\n visibility: hidden;\n height: 100%;\n\n a:hover,\n button:hover {\n text-decoration: none;\n }\n`;\n\nexport const StyledAppHeader = styled.header<{\n navPosition: AppShellProps['navPosition'];\n $isDefaultWSS: boolean;\n}>(\n ({\n navPosition,\n $isDefaultWSS,\n theme: {\n base,\n components: {\n 'app-shell': {\n header: {\n background: headerBg,\n 'foreground-color': headerFgColor,\n 'border-color': headerBorderColor\n }\n }\n }\n }\n }) => {\n const foregroundColor = calculateForegroundColor(headerBg, headerFgColor);\n const isModernStacked = !$isDefaultWSS && navPosition === 'below';\n\n return css`\n position: sticky;\n inset-block-start: 0;\n height: ${navPosition === 'below' ? tallHeaderHeight : headerHeight};\n width: 100%;\n background: ${isModernStacked ? base.palette['primary-background'] : headerBg};\n z-index: calc(${base['z-index'].popover} + 1);\n border-bottom: 0.0625rem solid\n ${$isDefaultWSS ? base.palette['border-line'] : headerBorderColor};\n color: ${foregroundColor};\n\n ${StyledImage} {\n height: 1.625rem;\n }\n\n & > ${StyledFlex} {\n height: ${headerHeight};\n\n ${StyledAppHeaderOperator} {\n margin: ${$isDefaultWSS ? base.spacing : 0};\n }\n\n & > a,\n & > button {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n min-height: ${headerHeight};\n\n &:focus {\n box-shadow: ${base.shadow.focus};\n }\n }\n }\n\n & > ${StyledNav} {\n height: calc(${tallHeaderHeight} - ${headerHeight});\n }\n\n ${isModernStacked &&\n css`\n & > ${StyledFlex}:first-child {\n height: ${topBarHeight};\n max-width: 80rem;\n margin-inline: auto;\n width: 100%;\n padding-inline: calc(${base.spacing} * 2);\n\n & > a,\n & > button {\n min-height: ${topBarHeight};\n }\n }\n\n & > ${StyledFlex}:nth-child(2) {\n height: ${navBarHeight};\n max-width: 80rem;\n margin-inline: auto;\n width: 100%;\n padding-inline: calc(${base.spacing} * 2);\n }\n\n @media screen and (min-width: ${base.breakpoints.md}) {\n & > ${StyledFlex}:first-child, & > ${StyledFlex}:nth-child(2) {\n padding-inline: calc(${base.spacing} * 2.5);\n }\n }\n\n &::after {\n content: '';\n position: absolute;\n top: ${topBarHeight};\n left: 0;\n right: 0;\n border-bottom: 0.0625rem solid ${base.palette['border-line']};\n }\n `}\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledPrimaryName = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n color: ${theme.base.palette['foreground-color']};\n font-size: ${fontSize.xxl};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n max-width: 50ch;\n `;\n});\n\nStyledPrimaryName.defaultProps = defaultThemeProp;\n\nexport const StyledEndNavBlock = styled.div<{ mobile: boolean }>(({ mobile }) => {\n return (\n mobile &&\n css`\n margin-inline-start: auto;\n `\n );\n});\n\nexport const StyledLink = styled.a(({ theme }) => {\n const hoverColor = lighten(0.2, theme.base.palette.interactive);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n margin: 0 calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n font-size: ${fontSize.m};\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n\n &:last-of-type {\n margin-inline-end: ${theme.base.spacing};\n }\n\n &[aria-current='page'] {\n &::after {\n content: '';\n position: absolute;\n inset-inline-start: 0;\n inset-block-end: 0;\n background-color: ${theme.base.palette.interactive};\n height: 0.125rem;\n width: 100%;\n }\n }\n\n &:hover {\n &::after {\n content: '';\n position: absolute;\n inset-inline-start: 0;\n inset-block-end: 0;\n background-color: ${hoverColor};\n height: 0.125rem;\n width: 100%;\n }\n }\n `;\n});\n\nStyledLink.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navPosition: AppShellProps['navPosition'];\n $isDefaultWSS: boolean;\n $hasFooter: boolean;\n}>(({ navPosition, theme, $isDefaultWSS, $hasFooter }) => {\n const calculatedHeaderHeight = navPosition === 'below' ? tallHeaderHeight : headerHeight;\n\n return css`\n --appshell-offset: ${calculatedHeaderHeight};\n --appshell-horizontal-offset: 0;\n position: relative;\n min-height: calc(100vh - ${calculatedHeaderHeight});\n background-color: ${theme.base.palette['app-background']};\n\n :focus {\n outline: none;\n }\n\n ${!$isDefaultWSS &&\n css`\n &:has([data-create-stage]) {\n height: calc(100vh - ${calculatedHeaderHeight});\n min-height: auto;\n overflow: auto;\n }\n\n ${$hasFooter &&\n css`\n &:not(:has([data-create-stage])) {\n --footer-height: ${footerHeight};\n min-height: calc(100vh - ${calculatedHeaderHeight} - ${footerHeight});\n }\n\n &:has([data-create-stage]) + footer {\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n border-top: none;\n }\n `}\n `}\n\n ${$isDefaultWSS &&\n $hasFooter &&\n css`\n --footer-height: ${footerHeight};\n `}\n `;\n});\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledModernAppHeaderOperator = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: flex;\n align-items: center;\n align-self: center;\n gap: ${theme.base.spacing};\n font-size: ${fontSize.m};\n white-space: nowrap;\n padding-inline: calc(0.75 * ${theme.base.spacing});\n\n ${StyledImage} {\n height: auto;\n }\n `;\n});\n\nStyledModernAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledHamburgerMenu = styled.button(({ theme }) => {\n return css`\n margin: ${theme.base.spacing};\n `;\n});\n\nStyledHamburgerMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.nav(({ theme }) => {\n return css`\n height: 100vh;\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledMobileLink = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n\n const hoverColor = tryCatch(() =>\n mix(0.95, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n\n return css`\n font-size: ${fontSize.m};\n padding: ${theme.base.spacing} calc(3 * ${theme.base.spacing});\n background-color: ${theme.base.palette['primary-background']};\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:hover,\n &:focus {\n background-color: ${hoverColor};\n text-decoration: none;\n }\n\n &[aria-current='page'] {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n background-color: ${activeColor};\n }\n\n @media (pointer: coarse) {\n height: ${theme.base['hit-area'].finger};\n }\n `;\n});\n\nStyledMobileLink.defaultProps = defaultThemeProp;\n\nexport const StyledLinkSection = styled.div`\n overflow: auto;\n`;\n\nexport const StyledOperatorSection = styled.div`\n position: sticky;\n bottom: 0;\n`;\n\nexport const HorizontalBreak = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin: ${theme.base.spacing} calc(6 * ${theme.base.spacing}) 0 calc(3 * ${theme.base.spacing});\n\n & + ${StyledFlex} {\n margin-inline-start: calc(3 * ${theme.base.spacing});\n }\n `;\n});\n\nHorizontalBreak.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationCount = styled.div`\n position: relative;\n display: inline-flex;\n`;\n\nStyledNotificationCount.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)`\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n`;\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNotifications = styled.div<{ popover?: boolean }>(({ popover, theme }) => {\n return css`\n min-height: ${popover ? '10rem' : '100vh'};\n max-height: ${popover ? '50vh' : '100vh'};\n background-color: ${theme.base.palette['primary-background']};\n\n ${popover &&\n css`\n max-width: 80ch;\n `}\n `;\n});\n\nStyledNotifications.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationList = styled.ul(({ theme }) => {\n return css`\n overflow: auto;\n\n & > li:not(:last-of-type) {\n border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};\n }\n `;\n});\n\nStyledNotificationList.defaultProps = defaultThemeProp;\n\nexport const StyledNotification = styled(BareButton)(({ theme }) => {\n const hoverColor = lighten(0.55, theme.base.palette.interactive);\n\n return css`\n width: 100%;\n padding: calc(2 * ${theme.base.spacing}) calc(3 * ${theme.base.spacing});\n background-color: ${theme.base.palette['primary-background']};\n text-decoration: none;\n cursor: pointer;\n text-align: start;\n white-space: normal;\n\n &:hover,\n &:focus {\n background-color: ${hoverColor};\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledVisual} {\n align-self: flex-start;\n }\n `;\n});\n\nStyledNotification.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationVisual = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n position: relative;\n ${StyledAlert} {\n position: absolute;\n inset-inline-start: 0.375rem;\n inset-block-start: 1.625rem;\n background-color: ${theme.base.palette.interactive};\n height: 0.75rem;\n width: 0.75rem;\n\n ${!unread &&\n css`\n display: none;\n `}\n }\n `;\n});\n\nStyledNotificationVisual.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationPrimary = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n font-weight: ${unread\n ? theme.base['font-weight'].bold\n : theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledNotificationPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationSecondary = styled.span<{ unread?: boolean }>(\n ({ theme, unread }) => {\n return css`\n ${StyledText} {\n opacity: ${unread\n ? theme.base.transparency['transparent-1']\n : theme.base.transparency['transparent-3']};\n }\n `;\n }\n);\n\nStyledNotificationSecondary.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div``;\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledVisuallyHiddenLabel = styled(StyledText)`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 0.0625rem;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 0.0625rem;\n`;\n\nStyledVisuallyHiddenLabel.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.div`\n display: flex;\n align-items: center;\n`;\n\nStyledNavList.defaultProps = defaultThemeProp;\n\nexport const StyledNavAction = styled(BareButton)`\n display: inline-flex;\n align-items: center;\n`;\n\nStyledNavAction.defaultProps = defaultThemeProp;\n\nexport const StyledUtilityDot = styled(StyledAlert)`\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n`;\n\nStyledUtilityDot.defaultProps = defaultThemeProp;\n\nexport const StyledUtilityVisual = styled(StyledVisual)`\n position: relative;\n`;\n\nStyledUtilityVisual.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACxC,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1D,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGtC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;CAGhD,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;;CAKlD,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;;CAEtD,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { lighten, mix } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n calculateForegroundColor,\n Count,\n defaultThemeProp,\n StyledFlex,\n StyledImage,\n StyledText,\n StyledVisual,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport { StyledAlert } from '@pega/cosmos-react-core/lib/components/Badges/Alert';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { resizeDrawerMaxWidth } from '@pega/cosmos-react-core/lib/styles/constants';\n\nimport type { AppShellProps } from './AppShell.types';\n\nexport const headerHeight = '3rem';\nexport const tallHeaderHeight = '6rem';\nconst topBarHeight = '2.75rem';\nconst navBarHeight = '3.25rem';\nexport const footerHeight = '2.25rem';\n\nexport const StyledNav = styled.nav`\n white-space: nowrap;\n overflow: visible;\n visibility: hidden;\n height: 100%;\n\n a:hover,\n button:hover {\n text-decoration: none;\n }\n`;\n\nexport const StyledPrimaryName = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n color: ${theme.base.palette['foreground-color']};\n font-size: ${fontSize.xxl};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n max-width: 50ch;\n `;\n});\n\nStyledPrimaryName.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeader = styled.header<{\n navPosition: AppShellProps['navPosition'];\n $isDefaultWSS: boolean;\n}>(\n ({\n navPosition,\n $isDefaultWSS,\n theme: {\n base,\n components: {\n 'app-shell': {\n header: {\n background: headerBg,\n 'foreground-color': headerFgColor,\n 'border-color': headerBorderColor\n },\n nav: { background: navBg, 'foreground-color': navFgColor }\n }\n }\n }\n }) => {\n const foregroundColor = calculateForegroundColor(headerBg, headerFgColor);\n const isModernStacked = !$isDefaultWSS && navPosition === 'below';\n const navForeground = calculateForegroundColor(navBg, navFgColor);\n\n return css`\n position: sticky;\n inset-block-start: 0;\n height: ${navPosition === 'below' ? tallHeaderHeight : headerHeight};\n width: 100%;\n background: ${isModernStacked ? 'transparent' : headerBg};\n z-index: calc(${base['z-index'].popover} + 1);\n border-bottom: 0.0625rem solid\n ${$isDefaultWSS ? base.palette['border-line'] : headerBorderColor};\n color: ${foregroundColor};\n\n ${StyledImage} {\n height: 1.625rem;\n }\n\n ${StyledPrimaryName} {\n max-width: min(50ch, 50vw);\n }\n\n & > ${StyledFlex} {\n height: ${headerHeight};\n\n ${StyledAppHeaderOperator} {\n margin: ${$isDefaultWSS ? base.spacing : 0};\n }\n\n & > a,\n & > button {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n min-height: ${headerHeight};\n\n &:focus {\n box-shadow: ${base.shadow.focus};\n }\n }\n }\n\n & > ${StyledNav} {\n height: calc(${tallHeaderHeight} - ${headerHeight});\n }\n\n ${isModernStacked &&\n css`\n border-bottom: none;\n\n & > ${StyledFlex}:first-child {\n height: ${topBarHeight};\n width: 100%;\n background: ${navBg};\n color: ${navForeground};\n padding-inline: max(calc(${base.spacing} * 2), calc((100% - 80rem) / 2));\n\n & > a,\n & > button {\n min-height: ${topBarHeight};\n }\n }\n\n & > ${StyledFlex}:nth-child(2) {\n height: ${navBarHeight};\n width: 100%;\n background: ${headerBg};\n color: ${foregroundColor};\n padding-inline: max(calc(${base.spacing} * 2), calc((100% - 80rem) / 2));\n\n ${StyledPrimaryName} {\n color: ${foregroundColor};\n }\n }\n\n @media screen and (min-width: ${base.breakpoints.md}) {\n & > ${StyledFlex}:first-child, & > ${StyledFlex}:nth-child(2) {\n padding-inline: max(calc(${base.spacing} * 2.5), calc((100% - 80rem) / 2));\n }\n }\n `}\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledEndNavBlock = styled.div<{ mobile: boolean }>(({ mobile }) => {\n return css`\n flex-shrink: 0;\n\n ${mobile &&\n css`\n margin-inline-start: auto;\n `}\n `;\n});\n\nexport const StyledLink = styled.a(({ theme }) => {\n const hoverColor = lighten(0.2, theme.base.palette.interactive);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n color: inherit;\n margin: 0 calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n font-size: ${fontSize.m};\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n\n &:last-of-type {\n margin-inline-end: ${theme.base.spacing};\n }\n\n &[aria-current='page'] {\n &::after {\n content: '';\n position: absolute;\n inset-inline-start: 0;\n inset-block-end: 0;\n background-color: ${theme.base.palette.interactive};\n height: 0.125rem;\n width: 100%;\n }\n }\n\n &:hover {\n &::after {\n content: '';\n position: absolute;\n inset-inline-start: 0;\n inset-block-end: 0;\n background-color: ${hoverColor};\n height: 0.125rem;\n width: 100%;\n }\n }\n `;\n});\n\nStyledLink.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navPosition: AppShellProps['navPosition'];\n $isDefaultWSS: boolean;\n $hasFooter: boolean;\n previewActive: boolean;\n}>(({ navPosition, theme, $isDefaultWSS, $hasFooter, previewActive }) => {\n const calculatedHeaderHeight = navPosition === 'below' ? tallHeaderHeight : headerHeight;\n\n return css`\n --appshell-offset: ${calculatedHeaderHeight};\n --appshell-horizontal-offset: 0;\n position: relative;\n min-height: calc(100vh - ${calculatedHeaderHeight});\n background: ${theme.base.palette['app-background']};\n\n :focus {\n outline: none;\n }\n\n ${!$isDefaultWSS &&\n css`\n &:has([data-create-stage]) {\n height: calc(100vh - ${calculatedHeaderHeight});\n min-height: auto;\n overflow: auto;\n }\n\n ${$hasFooter &&\n css`\n &:not(:has([data-create-stage])) {\n --footer-height: ${footerHeight};\n min-height: calc(100vh - ${calculatedHeaderHeight} - ${footerHeight});\n }\n\n &:has([data-create-stage]) + footer {\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n border-top: none;\n }\n `}\n `}\n\n ${$isDefaultWSS &&\n $hasFooter &&\n css`\n --footer-height: ${footerHeight};\n `}\n\n @media (min-width: ${theme.base.breakpoints.md}) {\n transition: margin-inline-end ${theme.base.animation.speed}\n ${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\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledModernAppHeaderOperator = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: flex;\n align-items: center;\n align-self: center;\n gap: ${theme.base.spacing};\n font-size: ${fontSize.m};\n white-space: nowrap;\n padding-inline: calc(0.75 * ${theme.base.spacing});\n\n ${StyledImage} {\n height: auto;\n }\n `;\n});\n\nStyledModernAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledHamburgerMenu = styled.button(({ theme }) => {\n return css`\n margin: ${theme.base.spacing};\n `;\n});\n\nStyledHamburgerMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.nav(({ theme }) => {\n return css`\n height: 100vh;\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledMobileLink = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n\n const hoverColor = tryCatch(() =>\n mix(0.95, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n\n return css`\n font-size: ${fontSize.m};\n padding: ${theme.base.spacing} calc(3 * ${theme.base.spacing});\n background-color: ${theme.base.palette['primary-background']};\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:hover,\n &:focus {\n background-color: ${hoverColor};\n text-decoration: none;\n }\n\n &[aria-current='page'] {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n background-color: ${activeColor};\n }\n\n @media (pointer: coarse) {\n height: ${theme.base['hit-area'].finger};\n }\n `;\n});\n\nStyledMobileLink.defaultProps = defaultThemeProp;\n\nexport const StyledLinkSection = styled.div`\n overflow: auto;\n`;\n\nexport const StyledOperatorSection = styled.div`\n position: sticky;\n bottom: 0;\n`;\n\nexport const HorizontalBreak = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin: ${theme.base.spacing} calc(6 * ${theme.base.spacing}) 0 calc(3 * ${theme.base.spacing});\n\n & + ${StyledFlex} {\n margin-inline-start: calc(3 * ${theme.base.spacing});\n }\n `;\n});\n\nHorizontalBreak.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationCount = styled.div`\n position: relative;\n display: inline-flex;\n`;\n\nStyledNotificationCount.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)`\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n`;\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNotifications = styled.div<{ popover?: boolean }>(({ popover, theme }) => {\n return css`\n min-height: ${popover ? '10rem' : '100vh'};\n max-height: ${popover ? '50vh' : '100vh'};\n background-color: ${theme.base.palette['primary-background']};\n\n ${popover &&\n css`\n max-width: 80ch;\n `}\n `;\n});\n\nStyledNotifications.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationList = styled.ul(({ theme }) => {\n return css`\n overflow: auto;\n\n & > li:not(:last-of-type) {\n border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};\n }\n `;\n});\n\nStyledNotificationList.defaultProps = defaultThemeProp;\n\nexport const StyledNotification = styled(BareButton)(({ theme }) => {\n const hoverColor = lighten(0.55, theme.base.palette.interactive);\n\n return css`\n width: 100%;\n padding: calc(2 * ${theme.base.spacing}) calc(3 * ${theme.base.spacing});\n background-color: ${theme.base.palette['primary-background']};\n text-decoration: none;\n cursor: pointer;\n text-align: start;\n white-space: normal;\n\n &:hover,\n &:focus {\n background-color: ${hoverColor};\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledVisual} {\n align-self: flex-start;\n }\n `;\n});\n\nStyledNotification.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationVisual = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n position: relative;\n ${StyledAlert} {\n position: absolute;\n inset-inline-start: 0.375rem;\n inset-block-start: 1.625rem;\n background-color: ${theme.base.palette.interactive};\n height: 0.75rem;\n width: 0.75rem;\n\n ${!unread &&\n css`\n display: none;\n `}\n }\n `;\n});\n\nStyledNotificationVisual.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationPrimary = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n font-weight: ${unread\n ? theme.base['font-weight'].bold\n : theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledNotificationPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationSecondary = styled.span<{ unread?: boolean }>(\n ({ theme, unread }) => {\n return css`\n ${StyledText} {\n opacity: ${unread\n ? theme.base.transparency['transparent-1']\n : theme.base.transparency['transparent-3']};\n }\n `;\n }\n);\n\nStyledNotificationSecondary.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div``;\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledVisuallyHiddenLabel = styled(StyledText)`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 0.0625rem;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 0.0625rem;\n`;\n\nStyledVisuallyHiddenLabel.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.div`\n display: flex;\n align-items: center;\n`;\n\nStyledNavList.defaultProps = defaultThemeProp;\n\nexport const StyledNavAction = styled(BareButton)`\n display: inline-flex;\n align-items: center;\n`;\n\nStyledNavAction.defaultProps = defaultThemeProp;\n\nexport const StyledUtilityDot = styled(StyledAlert)`\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n`;\n\nStyledUtilityDot.defaultProps = defaultThemeProp;\n\nexport const StyledUtilityVisual = styled(StyledVisual)`\n position: relative;\n`;\n\nStyledUtilityVisual.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -4,7 +4,7 @@ export interface BannerOptions {
|
|
|
4
4
|
/** An image url for the banner */
|
|
5
5
|
backgroundImage?: string;
|
|
6
6
|
/** A title for the banner */
|
|
7
|
-
title
|
|
7
|
+
title?: string;
|
|
8
8
|
/** A fallback background color if the background image is not provided */
|
|
9
9
|
backgroundColor?: string;
|
|
10
10
|
/** Text that will appear below the title */
|
|
@@ -19,12 +19,17 @@ export interface BannerOptions {
|
|
|
19
19
|
*/
|
|
20
20
|
tintImage?: boolean;
|
|
21
21
|
/** Controls how the banner fills vertical space.
|
|
22
|
-
* - 'fixed':
|
|
22
|
+
* - 'fixed': percentage-based height configured in authoring
|
|
23
23
|
* - 'content': shrinks to fit content
|
|
24
24
|
* - 'full': fills the visible viewport below the app shell
|
|
25
25
|
* @default 'fixed'
|
|
26
26
|
*/
|
|
27
27
|
height?: 'content' | 'fixed' | 'full';
|
|
28
|
+
/** Banner height as a percentage of the viewport (1-100, in dvh units) when height is 'fixed'.
|
|
29
|
+
* Falls back to 25 if invalid.
|
|
30
|
+
* @default 25
|
|
31
|
+
*/
|
|
32
|
+
heightValue?: number;
|
|
28
33
|
/** Horizontal alignment of the banner text content.
|
|
29
34
|
* @default 'center'
|
|
30
35
|
*/
|
|
@@ -40,10 +45,14 @@ export interface BannerOptions {
|
|
|
40
45
|
}
|
|
41
46
|
export interface BannerPageProps extends BaseProps {
|
|
42
47
|
banner: BannerOptions;
|
|
48
|
+
/** Title for the page, rendered invisibly as h1 if banner title is not provided. */
|
|
49
|
+
title: string;
|
|
43
50
|
/** Content for the first column */
|
|
44
51
|
a: ReactNode[];
|
|
45
52
|
/** Content for the second column. If not provided the first column will stretch. */
|
|
46
53
|
b?: ReactNode[];
|
|
54
|
+
/** Widget content rendered within the banner region, below the heading and message. */
|
|
55
|
+
bannerRegion?: ReactNode[];
|
|
47
56
|
ref?: Ref<HTMLDivElement>;
|
|
48
57
|
/** Variants for the sizing of the content columns. Two column will make the columns equal in size. */
|
|
49
58
|
variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';
|
|
@@ -51,7 +60,10 @@ export interface BannerPageProps extends BaseProps {
|
|
|
51
60
|
utilities?: ReactNode;
|
|
52
61
|
}
|
|
53
62
|
export declare const StyledBannerPage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
54
|
-
export declare const StyledBannerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "height"
|
|
63
|
+
export declare const StyledBannerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "height"> & {
|
|
64
|
+
$hasContent?: boolean;
|
|
65
|
+
$heightValue?: number;
|
|
66
|
+
}>> & string;
|
|
55
67
|
export declare const StyledBanner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "align" | "variant" | "tintImage" | "enableContentOverlap">>> & string;
|
|
56
68
|
export declare const StyledContentContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
57
69
|
export declare const StyledBannerHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BannerPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAoB7D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1F,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACz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oBlC,CAAC;AAIF,eAAO,MAAM,mBAAmB;;uJAS/B,CAAC;AAIF,eAAO,MAAM,mBAAmB;;uJAQ/B,CAAC;AAIF,eAAO,MAAM,wBAAwB;2BAAuC,OAAO;YAQlF,CAAC;AAsCF,eAAO,MAAM,UAAU,EAAE,+BAA+B,CAAC,eAAe,CAgOvE,CAAC"}
|
|
@@ -2,29 +2,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { transparentize } from 'polished';
|
|
3
3
|
import { forwardRef, useState, useRef } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
|
-
import { defaultThemeProp, Flex, Grid, Text, tryCatch, readableColor, useBreakpoint, useI18n, Tabs, TabPanel, createClassName } from '@pega/cosmos-react-core';
|
|
6
|
-
const BANNER_OVERLAP_MULTIPLIER =
|
|
5
|
+
import { defaultThemeProp, Flex, Grid, Text, tryCatch, readableColor, useBreakpoint, useI18n, Tabs, TabPanel, createClassName, VisuallyHiddenText, useTheme, readableHue, ThemeOverride } from '@pega/cosmos-react-core';
|
|
6
|
+
const BANNER_OVERLAP_MULTIPLIER = 8;
|
|
7
|
+
const DEFAULT_FIXED_HEIGHT_DVH = 25;
|
|
8
|
+
const CONTENT_PADDING_MULTIPLIER = 2.5;
|
|
9
|
+
// Clamp a 1-100 banner height (in dvh units) to a valid CSS dvh string, falling back to the default.
|
|
10
|
+
const getFixedHeightDvh = (value) => {
|
|
11
|
+
const clamped = value !== undefined && Number.isFinite(value)
|
|
12
|
+
? Math.min(100, Math.max(1, value))
|
|
13
|
+
: DEFAULT_FIXED_HEIGHT_DVH;
|
|
14
|
+
return `${clamped}dvh`;
|
|
15
|
+
};
|
|
7
16
|
export const StyledBannerPage = styled.div(({ theme }) => {
|
|
8
17
|
return css `
|
|
9
18
|
min-height: calc(100vh - var(--appshell-offset));
|
|
10
|
-
background
|
|
19
|
+
background: ${theme.base.palette['app-background']};
|
|
11
20
|
`;
|
|
12
21
|
});
|
|
13
22
|
StyledBannerPage.defaultProps = defaultThemeProp;
|
|
14
|
-
export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundColor, height = 'fixed',
|
|
23
|
+
export const StyledBannerContainer = styled.div(({ theme, backgroundImage, backgroundColor, height = 'fixed', $hasContent, $heightValue }) => {
|
|
24
|
+
const fixedHeight = getFixedHeightDvh($heightValue);
|
|
15
25
|
const heightValue = {
|
|
16
26
|
content: 'auto',
|
|
17
|
-
fixed:
|
|
27
|
+
fixed: fixedHeight,
|
|
18
28
|
full: 'calc(100dvh - var(--appshell-offset, 0rem))'
|
|
19
29
|
}[height];
|
|
20
|
-
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: ${heightValue};
|
|
23
|
-
${height !== 'content' &&
|
|
24
|
-
css `
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
`}
|
|
27
|
-
|
|
30
|
+
const backgroundStyles = css `
|
|
28
31
|
${backgroundImage &&
|
|
29
32
|
css `
|
|
30
33
|
background-image: url('${backgroundImage}');
|
|
@@ -38,6 +41,60 @@ export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundCo
|
|
|
38
41
|
background-color: ${backgroundColor};
|
|
39
42
|
`}
|
|
40
43
|
`;
|
|
44
|
+
const fixedHeightBannerWithContent = height === 'fixed' && $hasContent;
|
|
45
|
+
let layoutStyles;
|
|
46
|
+
if (fixedHeightBannerWithContent) {
|
|
47
|
+
layoutStyles = css `
|
|
48
|
+
min-height: ${fixedHeight};
|
|
49
|
+
position: relative;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
|
|
53
|
+
&::before {
|
|
54
|
+
content: '';
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset-block-start: 0;
|
|
57
|
+
inset-inline: 0;
|
|
58
|
+
height: ${fixedHeight};
|
|
59
|
+
z-index: 0;
|
|
60
|
+
${backgroundStyles}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
> * {
|
|
64
|
+
position: relative;
|
|
65
|
+
flex: 1;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
else if ($hasContent) {
|
|
70
|
+
layoutStyles = css `
|
|
71
|
+
${height === 'full' &&
|
|
72
|
+
css `
|
|
73
|
+
min-height: ${heightValue};
|
|
74
|
+
`}
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
|
|
78
|
+
> * {
|
|
79
|
+
flex: 1;
|
|
80
|
+
}
|
|
81
|
+
${backgroundStyles}
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
layoutStyles = css `
|
|
86
|
+
height: ${heightValue};
|
|
87
|
+
${backgroundStyles}
|
|
88
|
+
`;
|
|
89
|
+
}
|
|
90
|
+
return css `
|
|
91
|
+
width: 100%;
|
|
92
|
+
${layoutStyles}
|
|
93
|
+
--content-height-in-agent: calc(
|
|
94
|
+
100dvh - var(--appshell-top-offset, var(--appshell-offset, 0rem)) - calc(${theme.base
|
|
95
|
+
.spacing} * ${CONTENT_PADDING_MULTIPLIER})
|
|
96
|
+
);
|
|
97
|
+
`;
|
|
41
98
|
});
|
|
42
99
|
StyledBannerContainer.defaultProps = defaultThemeProp;
|
|
43
100
|
export const StyledBanner = styled.div(({ variant = 'light', backgroundColor, backgroundImage, tintImage = false, align = 'center', enableContentOverlap, theme: { base: { palette: { light, dark }, spacing } } }) => {
|
|
@@ -72,11 +129,11 @@ export const StyledContentContainer = styled.div(({ theme: { base: { breakpoints
|
|
|
72
129
|
margin: 0 auto;
|
|
73
130
|
|
|
74
131
|
@media screen and (min-width: ${breakpoints.md}) {
|
|
75
|
-
width:
|
|
76
|
-
padding: calc(${spacing} *
|
|
132
|
+
width: 85%;
|
|
133
|
+
padding: calc(${spacing} * ${CONTENT_PADDING_MULTIPLIER});
|
|
77
134
|
}
|
|
78
135
|
@media screen and (min-width: ${breakpoints.lg}) {
|
|
79
|
-
max-width:
|
|
136
|
+
max-width: 80rem;
|
|
80
137
|
}
|
|
81
138
|
`;
|
|
82
139
|
});
|
|
@@ -113,6 +170,9 @@ const horizontalAlignMap = {
|
|
|
113
170
|
center: 'center',
|
|
114
171
|
right: 'end'
|
|
115
172
|
};
|
|
173
|
+
const StyledBannerContentArea = styled.div `
|
|
174
|
+
text-align: start;
|
|
175
|
+
`;
|
|
116
176
|
const StyledPageTabContent = styled.div(({ theme }) => {
|
|
117
177
|
return css `
|
|
118
178
|
padding-block: calc(2 * ${theme.base.spacing});
|
|
@@ -123,7 +183,7 @@ const StyledPageTabContent = styled.div(({ theme }) => {
|
|
|
123
183
|
`;
|
|
124
184
|
});
|
|
125
185
|
StyledPageTabContent.defaultProps = defaultThemeProp;
|
|
126
|
-
export const BannerPage = forwardRef(function BannerPage({ banner, a, b, variant = 'two-column', utilities, className: classNameProp, ...restProps }, ref) {
|
|
186
|
+
export const BannerPage = forwardRef(function BannerPage({ banner, title, a, b, bannerRegion, variant = 'two-column', utilities, className: classNameProp, ...restProps }, ref) {
|
|
127
187
|
const t = useI18n();
|
|
128
188
|
const isMediumOrAbove = useBreakpoint('md');
|
|
129
189
|
const [panel, setPanel] = useState('content');
|
|
@@ -131,13 +191,59 @@ export const BannerPage = forwardRef(function BannerPage({ banner, a, b, variant
|
|
|
131
191
|
const className = createClassName('banner-page', classNameProp, { variant });
|
|
132
192
|
const gridCols = variantMap[variant];
|
|
133
193
|
const effectiveOverlap = !!banner.enableContentOverlap && banner.height !== 'full';
|
|
194
|
+
const hasBannerRegionContent = !!bannerRegion?.length;
|
|
195
|
+
const theme = useTheme();
|
|
196
|
+
const { light: paletteLight, dark: paletteDark } = theme.base.palette;
|
|
197
|
+
const isDarkBanner = (banner.variant ?? 'light') === 'dark';
|
|
198
|
+
const bgColor = banner.backgroundColor;
|
|
199
|
+
let effectiveBackground;
|
|
200
|
+
if (bgColor && bgColor.trim() !== '') {
|
|
201
|
+
effectiveBackground = bgColor;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
effectiveBackground = isDarkBanner ? paletteDark : paletteLight;
|
|
205
|
+
}
|
|
206
|
+
const effectiveForeground = tryCatch(() => readableColor(effectiveBackground)) ?? paletteDark;
|
|
207
|
+
const secondaryBackground = tryCatch(() => transparentize(0.7, readableColor(effectiveForeground)));
|
|
134
208
|
const pageContent = (_jsxs(Grid, { container: { gap: 2 }, md: { container: { cols: 'minmax(0, 1fr)' } }, lg: { container: { cols: b ? `${gridCols}` : 'minmax(0, 1fr)' } }, as: StyledContentContainer, className: createClassName('banner-page-content'), children: [!!a.length && _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: a.map(el => el) }), b && !!b.length && (_jsx(Flex, { container: { direction: 'column', gap: 2 }, children: b.map(el => el) }))] }));
|
|
135
|
-
const pageBanner = banner && (_jsx(StyledBannerContainer, { backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, height: banner.height, className: createClassName('banner-page-banner'), children: _jsx(Flex, { variant: banner.variant, backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, as: StyledBanner, container: {
|
|
209
|
+
const pageBanner = banner && (_jsx(StyledBannerContainer, { backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, height: banner.height, "$hasContent": hasBannerRegionContent, "$heightValue": banner.heightValue, className: createClassName('banner-page-banner'), children: _jsx(Flex, { variant: banner.variant, backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, as: StyledBanner, container: {
|
|
136
210
|
justify: verticalAlignMap[banner.verticalAlign ?? 'center'] ?? 'center',
|
|
137
211
|
alignItems: horizontalAlignMap[banner.align ?? 'center'] ?? 'center',
|
|
138
212
|
direction: 'column',
|
|
139
213
|
gap: 1
|
|
140
|
-
}, tintImage: banner.tintImage, align: banner.align, enableContentOverlap: effectiveOverlap, children: _jsxs(StyledContentContainer, { children: [_jsx(StyledBannerHeading, { variant: 'h1', children: banner.title }), banner.message && (_jsx(StyledBannerMessage, { variant: 'primary', as: 'p', children: banner.message }))
|
|
214
|
+
}, tintImage: banner.tintImage, align: banner.align, enableContentOverlap: effectiveOverlap, children: _jsxs(StyledContentContainer, { children: [banner.title && _jsx(StyledBannerHeading, { variant: 'h1', children: banner.title }), !banner.title && (_jsx(Text, { variant: 'h1', children: _jsx(VisuallyHiddenText, { children: title }) })), banner.message && (_jsx(StyledBannerMessage, { variant: 'primary', as: 'p', children: banner.message })), _jsx(ThemeOverride, { theme: {
|
|
215
|
+
components: {
|
|
216
|
+
agent: {
|
|
217
|
+
background: 'transparent',
|
|
218
|
+
'foreground-color': effectiveForeground,
|
|
219
|
+
'user-message': {
|
|
220
|
+
background: secondaryBackground,
|
|
221
|
+
'foreground-color': effectiveForeground
|
|
222
|
+
},
|
|
223
|
+
history: {
|
|
224
|
+
background: secondaryBackground,
|
|
225
|
+
'foreground-color': effectiveForeground,
|
|
226
|
+
item: {
|
|
227
|
+
'selected-background': transparentize(0.7, theme.base.palette.interactive)
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
'coach-message': {
|
|
231
|
+
avatar: {
|
|
232
|
+
background: `linear-gradient(135deg, ${theme.base.palette.ai} 0%, ${theme.base.palette.interactive} 100%)`,
|
|
233
|
+
'foreground-color': effectiveForeground
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
questionnaire: {
|
|
237
|
+
background: theme.base.palette['primary-background'],
|
|
238
|
+
'foreground-color': 'auto'
|
|
239
|
+
},
|
|
240
|
+
ai: readableHue(theme.base.palette.ai, effectiveBackground)
|
|
241
|
+
},
|
|
242
|
+
link: {
|
|
243
|
+
color: readableHue(theme.base.palette.interactive, effectiveBackground)
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}, children: hasBannerRegionContent && (_jsx(Flex, { as: StyledBannerContentArea, container: { direction: 'column', gap: 2, pad: [1, 0, 0, 0] }, className: createClassName('banner-page-banner-content'), children: bannerRegion.map(el => el) })) })] }) }) }));
|
|
141
247
|
const pageTabs = [
|
|
142
248
|
{ name: t('content'), id: 'content', content: pageContent },
|
|
143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,WAAW,GACa,IACV,CACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { transparentize } from 'polished';\nimport { forwardRef, useState, useRef } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Grid,\n Text,\n tryCatch,\n readableColor,\n useBreakpoint,\n useI18n,\n Tabs,\n TabPanel,\n createClassName\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nexport interface BannerOptions {\n /** An image url for the banner */\n backgroundImage?: string;\n /** A title for the banner */\n title: string;\n /** A fallback background color if the background image is not provided */\n backgroundColor?: string;\n /** Text that will appear below the title */\n message?: string;\n /** The light variant will provide a white translucent filter over the background image\n * with dark text. The dark variant will provide the opposite.\n * @default 'light'\n */\n variant?: 'light' | 'dark';\n /** Toggles the translucent filter provided by the variant\n * @default true\n */\n tintImage?: boolean;\n /** Controls how the banner fills vertical space.\n * - 'fixed': preset height based on the spacing token\n * - 'content': shrinks to fit content\n * - 'full': fills the visible viewport below the app shell\n * @default 'fixed'\n */\n height?: 'content' | 'fixed' | 'full';\n /** Horizontal alignment of the banner text content.\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /** Vertical alignment of the banner text content.\n * @default 'center'\n */\n verticalAlign?: 'top' | 'center' | 'bottom';\n /** When true and height is 'fixed' or 'content', page content overlaps the bottom of the banner.\n * Has no effect when height is 'full'.\n */\n enableContentOverlap?: boolean;\n}\n\nexport interface BannerPageProps extends BaseProps {\n banner: BannerOptions;\n /** Content for the first column */\n a: ReactNode[];\n /** Content for the second column. If not provided the first column will stretch. */\n b?: ReactNode[];\n ref?: Ref<HTMLDivElement>;\n /** Variants for the sizing of the content columns. Two column will make the columns equal in size. */\n variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';\n /** Utilities as the last column */\n utilities?: ReactNode;\n}\n\nconst BANNER_OVERLAP_MULTIPLIER = 12;\n\nexport const StyledBannerPage = styled.div(({ theme }) => {\n return css`\n min-height: calc(100vh - var(--appshell-offset));\n background-color: ${theme.base.palette['app-background']};\n `;\n});\n\nStyledBannerPage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContainer = styled.div<\n Pick<BannerOptions, 'backgroundImage' | 'backgroundColor' | 'height'>\n>(({ backgroundImage, backgroundColor, height = 'fixed', theme }) => {\n const heightValue = {\n content: 'auto',\n fixed: `calc(${theme.base.spacing} * 38)`,\n full: 'calc(100dvh - var(--appshell-offset, 0rem))'\n }[height];\n\n return css`\n width: 100%;\n height: ${heightValue};\n ${height !== 'content' &&\n css`\n overflow: hidden;\n `}\n\n ${backgroundImage &&\n css`\n background-image: url('${backgroundImage}');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n `}\n\n ${backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n `;\n});\n\nStyledBannerContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div<\n Pick<\n BannerOptions,\n | 'variant'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'tintImage'\n | 'align'\n | 'enableContentOverlap'\n >\n>(\n ({\n variant = 'light',\n backgroundColor,\n backgroundImage,\n tintImage = false,\n align = 'center',\n enableContentOverlap,\n theme: {\n base: {\n palette: { light, dark },\n spacing\n }\n }\n }) => {\n let textColor = variant === 'light' ? dark : light;\n let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);\n if (backgroundColor && !backgroundImage) {\n textColor = tryCatch(() => readableColor(backgroundColor)) ?? dark;\n overlayColor = 'transparent';\n } else if (!backgroundColor && !backgroundImage) {\n overlayColor = 'transparent';\n textColor = dark;\n }\n return css`\n background-color: ${tintImage ? overlayColor : 'transparent'};\n color: ${textColor};\n width: 100%;\n height: 100%;\n text-align: ${align};\n\n ${enableContentOverlap &&\n css`\n padding-block-end: calc(${spacing} * ${BANNER_OVERLAP_MULTIPLIER});\n `}\n `;\n }\n);\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(\n ({\n theme: {\n base: { breakpoints, spacing }\n }\n }) => {\n return css`\n padding: calc(${spacing} * 2);\n width: 100%;\n margin: 0 auto;\n\n @media screen and (min-width: ${breakpoints.md}) {\n width: 100%;\n padding: calc(${spacing} * 2.5);\n }\n @media screen and (min-width: ${breakpoints.lg}) {\n max-width: 93.75rem;\n }\n `;\n }\n);\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBannerHeading = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 3);\n word-break: break-word;\n `\n);\n\nStyledBannerHeading.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 1.5);\n `\n);\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledPageContentWrapper = styled.div<{ enableContentOverlap?: boolean }>(\n ({ theme, enableContentOverlap }) => css`\n ${enableContentOverlap &&\n css`\n margin-block-start: calc(${theme.base.spacing} * -${BANNER_OVERLAP_MULTIPLIER});\n position: relative;\n `}\n `\n);\n\nStyledPageContentWrapper.defaultProps = defaultThemeProp;\n\nconst variantMap = {\n 'two-column': 'minmax(0, 1fr) minmax(0, 1fr)',\n 'narrow-wide': 'minmax(0, 3fr) minmax(0, 7fr)',\n 'wide-narrow': 'minmax(0, 7fr) minmax(0, 3fr)'\n};\n\nconst verticalAlignMap = {\n top: 'start',\n center: 'center',\n bottom: 'end'\n} as const;\n\nconst horizontalAlignMap = {\n left: 'start',\n center: 'center',\n right: 'end'\n} as const;\n\nconst StyledPageTabContent = styled.div(({ theme }) => {\n return css`\n padding-block: calc(2 * ${theme.base.spacing});\n\n ${StyledContentContainer} {\n padding: 0;\n }\n `;\n});\n\nStyledPageTabContent.defaultProps = defaultThemeProp;\n\nexport const BannerPage: ForwardRefForwardPropsComponent<BannerPageProps> = forwardRef(\n function BannerPage(\n {\n banner,\n a,\n b,\n variant = 'two-column',\n utilities,\n className: classNameProp,\n ...restProps\n }: PropsWithoutRef<BannerPageProps>,\n ref: BannerPageProps['ref']\n ) {\n const t = useI18n();\n const isMediumOrAbove = useBreakpoint('md');\n\n const [panel, setPanel] = useState('content');\n const pageTabsRef = useRef<HTMLElement>(null);\n\n const className = createClassName('banner-page', classNameProp, { variant });\n const gridCols = variantMap[variant];\n\n const effectiveOverlap = !!banner.enableContentOverlap && banner.height !== 'full';\n\n const pageContent = (\n <Grid\n container={{ gap: 2 }}\n md={{ container: { cols: 'minmax(0, 1fr)' } }}\n lg={{ container: { cols: b ? `${gridCols}` : 'minmax(0, 1fr)' } }}\n as={StyledContentContainer}\n className={createClassName('banner-page-content')}\n >\n {!!a.length && <Flex container={{ direction: 'column', gap: 2 }}>{a.map(el => el)}</Flex>}\n {b && !!b.length && (\n <Flex container={{ direction: 'column', gap: 2 }}>{b.map(el => el)}</Flex>\n )}\n </Grid>\n );\n\n const pageBanner = banner && (\n <StyledBannerContainer\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n height={banner.height}\n className={createClassName('banner-page-banner')}\n >\n <Flex\n variant={banner.variant}\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n as={StyledBanner}\n container={{\n justify: verticalAlignMap[banner.verticalAlign ?? 'center'] ?? 'center',\n alignItems: horizontalAlignMap[banner.align ?? 'center'] ?? 'center',\n direction: 'column',\n gap: 1\n }}\n tintImage={banner.tintImage}\n align={banner.align}\n enableContentOverlap={effectiveOverlap}\n >\n <StyledContentContainer>\n <StyledBannerHeading variant='h1'>{banner.title}</StyledBannerHeading>\n {banner.message && (\n <StyledBannerMessage variant='primary' as='p'>\n {banner.message}\n </StyledBannerMessage>\n )}\n </StyledContentContainer>\n </Flex>\n </StyledBannerContainer>\n );\n\n const pageTabs = [\n { name: t('content'), id: 'content', content: pageContent },\n {\n name: t('chat_with_ai'),\n id: 'chat_with_ai',\n content: utilities\n }\n ];\n\n const handleTabChange = (id: string) => {\n setPanel(id);\n };\n\n if (utilities) {\n if (isMediumOrAbove) {\n return (\n <Flex\n as={StyledBannerPage}\n container={{ gap: 2 }}\n ref={ref}\n {...restProps}\n className={className}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n {pageContent}\n </StyledPageContentWrapper>\n </Flex>\n <div>{utilities}</div>\n </Flex>\n );\n }\n\n return (\n <Flex\n container={{ direction: 'column', gap: effectiveOverlap ? 0 : 2 }}\n as={StyledBannerPage}\n className={className}\n >\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n <Flex container={{ direction: 'column', pad: [undefined, 2, undefined] }}>\n <Tabs\n tabs={pageTabs}\n onTabClick={handleTabChange}\n currentTabId={panel}\n ref={pageTabsRef}\n />\n {pageTabs.map(tab => (\n <TabPanel tabId={tab.id} currentTabId={panel} tablistRef={pageTabsRef} key={tab.id}>\n <StyledPageTabContent>{tab.content}</StyledPageTabContent>\n </TabPanel>\n ))}\n </Flex>\n </StyledPageContentWrapper>\n </Flex>\n );\n }\n\n return (\n <StyledBannerPage ref={ref} {...restProps} className={className}>\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n {pageContent}\n </StyledPageContentWrapper>\n </StyledBannerPage>\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"BannerPage.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD,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gB,EACtC,SAAS,EAAE,eAAe,CAAC,6BAA6B,CAAC,YAEzD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,aACtE,KAAC,IAAI,IACH,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,eAAe,EAC3B,YAAY,EAAE,KAAK,EACnB,GAAG,EAAE,WAAW,GAChB,EACD,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACnB,KAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,YACnE,KAAC,oBAAoB,cAAE,GAAG,CAAC,OAAO,GAAwB,IADgB,GAAG,CAAC,EAAE,CAEvE,CACZ,CAAC,IACG,GACkB,IACtB,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,gBAAgB,IAAC,GAAG,EAAE,GAAG,KAAM,SAAS,EAAE,SAAS,EAAE,SAAS,aAC5D,UAAU,EACX,KAAC,wBAAwB,IACvB,oBAAoB,EAAE,gBAAgB,EACtC,SAAS,EAAE,eAAe,CAAC,6BAA6B,CAAC,YAExD,WAAW,GACa,IACV,CACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { transparentize } from 'polished';\nimport { forwardRef, useState, useRef } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Grid,\n Text,\n tryCatch,\n readableColor,\n useBreakpoint,\n useI18n,\n Tabs,\n TabPanel,\n createClassName,\n VisuallyHiddenText,\n useTheme,\n readableHue,\n ThemeOverride\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nexport interface BannerOptions {\n /** An image url for the banner */\n backgroundImage?: string;\n /** A title for the banner */\n title?: string;\n /** A fallback background color if the background image is not provided */\n backgroundColor?: string;\n /** Text that will appear below the title */\n message?: string;\n /** The light variant will provide a white translucent filter over the background image\n * with dark text. The dark variant will provide the opposite.\n * @default 'light'\n */\n variant?: 'light' | 'dark';\n /** Toggles the translucent filter provided by the variant\n * @default true\n */\n tintImage?: boolean;\n /** Controls how the banner fills vertical space.\n * - 'fixed': percentage-based height configured in authoring\n * - 'content': shrinks to fit content\n * - 'full': fills the visible viewport below the app shell\n * @default 'fixed'\n */\n height?: 'content' | 'fixed' | 'full';\n /** Banner height as a percentage of the viewport (1-100, in dvh units) when height is 'fixed'.\n * Falls back to 25 if invalid.\n * @default 25\n */\n heightValue?: number;\n /** Horizontal alignment of the banner text content.\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /** Vertical alignment of the banner text content.\n * @default 'center'\n */\n verticalAlign?: 'top' | 'center' | 'bottom';\n /** When true and height is 'fixed' or 'content', page content overlaps the bottom of the banner.\n * Has no effect when height is 'full'.\n */\n enableContentOverlap?: boolean;\n}\n\nexport interface BannerPageProps extends BaseProps {\n banner: BannerOptions;\n /** Title for the page, rendered invisibly as h1 if banner title is not provided. */\n title: string;\n /** Content for the first column */\n a: ReactNode[];\n /** Content for the second column. If not provided the first column will stretch. */\n b?: ReactNode[];\n /** Widget content rendered within the banner region, below the heading and message. */\n bannerRegion?: ReactNode[];\n ref?: Ref<HTMLDivElement>;\n /** Variants for the sizing of the content columns. Two column will make the columns equal in size. */\n variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';\n /** Utilities as the last column */\n utilities?: ReactNode;\n}\n\nconst BANNER_OVERLAP_MULTIPLIER = 8;\n\nconst DEFAULT_FIXED_HEIGHT_DVH = 25;\n\nconst CONTENT_PADDING_MULTIPLIER = 2.5;\n\n// Clamp a 1-100 banner height (in dvh units) to a valid CSS dvh string, falling back to the default.\nconst getFixedHeightDvh = (value: number | undefined): string => {\n const clamped =\n value !== undefined && Number.isFinite(value)\n ? Math.min(100, Math.max(1, value))\n : DEFAULT_FIXED_HEIGHT_DVH;\n return `${clamped}dvh`;\n};\n\nexport const StyledBannerPage = styled.div(({ theme }) => {\n return css`\n min-height: calc(100vh - var(--appshell-offset));\n background: ${theme.base.palette['app-background']};\n `;\n});\n\nStyledBannerPage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContainer = styled.div<\n Pick<BannerOptions, 'backgroundImage' | 'backgroundColor' | 'height'> & {\n $hasContent?: boolean;\n $heightValue?: number;\n }\n>(({ theme, backgroundImage, backgroundColor, height = 'fixed', $hasContent, $heightValue }) => {\n const fixedHeight = getFixedHeightDvh($heightValue);\n const heightValue = {\n content: 'auto',\n fixed: fixedHeight,\n full: 'calc(100dvh - var(--appshell-offset, 0rem))'\n }[height];\n\n const backgroundStyles = css`\n ${backgroundImage &&\n css`\n background-image: url('${backgroundImage}');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n `}\n\n ${backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n `;\n\n const fixedHeightBannerWithContent = height === 'fixed' && $hasContent;\n\n let layoutStyles;\n if (fixedHeightBannerWithContent) {\n layoutStyles = css`\n min-height: ${fixedHeight};\n position: relative;\n display: flex;\n flex-direction: column;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline: 0;\n height: ${fixedHeight};\n z-index: 0;\n ${backgroundStyles}\n }\n\n > * {\n position: relative;\n flex: 1;\n }\n `;\n } else if ($hasContent) {\n layoutStyles = css`\n ${height === 'full' &&\n css`\n min-height: ${heightValue};\n `}\n display: flex;\n flex-direction: column;\n\n > * {\n flex: 1;\n }\n ${backgroundStyles}\n `;\n } else {\n layoutStyles = css`\n height: ${heightValue};\n ${backgroundStyles}\n `;\n }\n\n return css`\n width: 100%;\n ${layoutStyles}\n --content-height-in-agent: calc(\n 100dvh - var(--appshell-top-offset, var(--appshell-offset, 0rem)) - calc(${theme.base\n .spacing} * ${CONTENT_PADDING_MULTIPLIER})\n );\n `;\n});\n\nStyledBannerContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div<\n Pick<\n BannerOptions,\n | 'variant'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'tintImage'\n | 'align'\n | 'enableContentOverlap'\n >\n>(\n ({\n variant = 'light',\n backgroundColor,\n backgroundImage,\n tintImage = false,\n align = 'center',\n enableContentOverlap,\n theme: {\n base: {\n palette: { light, dark },\n spacing\n }\n }\n }) => {\n let textColor = variant === 'light' ? dark : light;\n let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);\n if (backgroundColor && !backgroundImage) {\n textColor = tryCatch(() => readableColor(backgroundColor)) ?? dark;\n overlayColor = 'transparent';\n } else if (!backgroundColor && !backgroundImage) {\n overlayColor = 'transparent';\n textColor = dark;\n }\n return css`\n background-color: ${tintImage ? overlayColor : 'transparent'};\n color: ${textColor};\n width: 100%;\n height: 100%;\n text-align: ${align};\n\n ${enableContentOverlap &&\n css`\n padding-block-end: calc(${spacing} * ${BANNER_OVERLAP_MULTIPLIER});\n `}\n `;\n }\n);\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(\n ({\n theme: {\n base: { breakpoints, spacing }\n }\n }) => {\n return css`\n padding: calc(${spacing} * 2);\n width: 100%;\n margin: 0 auto;\n\n @media screen and (min-width: ${breakpoints.md}) {\n width: 85%;\n padding: calc(${spacing} * ${CONTENT_PADDING_MULTIPLIER});\n }\n @media screen and (min-width: ${breakpoints.lg}) {\n max-width: 80rem;\n }\n `;\n }\n);\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBannerHeading = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 3);\n word-break: break-word;\n `\n);\n\nStyledBannerHeading.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 1.5);\n `\n);\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledPageContentWrapper = styled.div<{ enableContentOverlap?: boolean }>(\n ({ theme, enableContentOverlap }) => css`\n ${enableContentOverlap &&\n css`\n margin-block-start: calc(${theme.base.spacing} * -${BANNER_OVERLAP_MULTIPLIER});\n position: relative;\n `}\n `\n);\n\nStyledPageContentWrapper.defaultProps = defaultThemeProp;\n\nconst variantMap = {\n 'two-column': 'minmax(0, 1fr) minmax(0, 1fr)',\n 'narrow-wide': 'minmax(0, 3fr) minmax(0, 7fr)',\n 'wide-narrow': 'minmax(0, 7fr) minmax(0, 3fr)'\n};\n\nconst verticalAlignMap = {\n top: 'start',\n center: 'center',\n bottom: 'end'\n} as const;\n\nconst horizontalAlignMap = {\n left: 'start',\n center: 'center',\n right: 'end'\n} as const;\n\nconst StyledBannerContentArea = styled.div`\n text-align: start;\n`;\n\nconst StyledPageTabContent = styled.div(({ theme }) => {\n return css`\n padding-block: calc(2 * ${theme.base.spacing});\n\n ${StyledContentContainer} {\n padding: 0;\n }\n `;\n});\n\nStyledPageTabContent.defaultProps = defaultThemeProp;\n\nexport const BannerPage: ForwardRefForwardPropsComponent<BannerPageProps> = forwardRef(\n function BannerPage(\n {\n banner,\n title,\n a,\n b,\n bannerRegion,\n variant = 'two-column',\n utilities,\n className: classNameProp,\n ...restProps\n }: PropsWithoutRef<BannerPageProps>,\n ref: BannerPageProps['ref']\n ) {\n const t = useI18n();\n const isMediumOrAbove = useBreakpoint('md');\n\n const [panel, setPanel] = useState('content');\n const pageTabsRef = useRef<HTMLElement>(null);\n\n const className = createClassName('banner-page', classNameProp, { variant });\n const gridCols = variantMap[variant];\n\n const effectiveOverlap = !!banner.enableContentOverlap && banner.height !== 'full';\n const hasBannerRegionContent = !!bannerRegion?.length;\n\n const theme = useTheme();\n const { light: paletteLight, dark: paletteDark } = theme.base.palette;\n const isDarkBanner = (banner.variant ?? 'light') === 'dark';\n\n const bgColor = banner.backgroundColor;\n\n let effectiveBackground: string;\n if (bgColor && bgColor.trim() !== '') {\n effectiveBackground = bgColor;\n } else {\n effectiveBackground = isDarkBanner ? paletteDark : paletteLight;\n }\n\n const effectiveForeground = tryCatch(() => readableColor(effectiveBackground)) ?? paletteDark;\n const secondaryBackground = tryCatch(() =>\n transparentize(0.7, readableColor(effectiveForeground))\n );\n\n const pageContent = (\n <Grid\n container={{ gap: 2 }}\n md={{ container: { cols: 'minmax(0, 1fr)' } }}\n lg={{ container: { cols: b ? `${gridCols}` : 'minmax(0, 1fr)' } }}\n as={StyledContentContainer}\n className={createClassName('banner-page-content')}\n >\n {!!a.length && <Flex container={{ direction: 'column', gap: 2 }}>{a.map(el => el)}</Flex>}\n {b && !!b.length && (\n <Flex container={{ direction: 'column', gap: 2 }}>{b.map(el => el)}</Flex>\n )}\n </Grid>\n );\n\n const pageBanner = banner && (\n <StyledBannerContainer\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n height={banner.height}\n $hasContent={hasBannerRegionContent}\n $heightValue={banner.heightValue}\n className={createClassName('banner-page-banner')}\n >\n <Flex\n variant={banner.variant}\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n as={StyledBanner}\n container={{\n justify: verticalAlignMap[banner.verticalAlign ?? 'center'] ?? 'center',\n alignItems: horizontalAlignMap[banner.align ?? 'center'] ?? 'center',\n direction: 'column',\n gap: 1\n }}\n tintImage={banner.tintImage}\n align={banner.align}\n enableContentOverlap={effectiveOverlap}\n >\n <StyledContentContainer>\n {banner.title && <StyledBannerHeading variant='h1'>{banner.title}</StyledBannerHeading>}\n {!banner.title && (\n <Text variant='h1'>\n <VisuallyHiddenText>{title}</VisuallyHiddenText>\n </Text>\n )}\n {banner.message && (\n <StyledBannerMessage variant='primary' as='p'>\n {banner.message}\n </StyledBannerMessage>\n )}\n <ThemeOverride\n theme={{\n components: {\n agent: {\n background: 'transparent',\n 'foreground-color': effectiveForeground,\n 'user-message': {\n background: secondaryBackground,\n 'foreground-color': effectiveForeground\n },\n history: {\n background: secondaryBackground,\n 'foreground-color': effectiveForeground,\n item: {\n 'selected-background': transparentize(0.7, theme.base.palette.interactive)\n }\n },\n 'coach-message': {\n avatar: {\n background: `linear-gradient(135deg, ${theme.base.palette.ai} 0%, ${theme.base.palette.interactive} 100%)`,\n 'foreground-color': effectiveForeground\n }\n },\n questionnaire: {\n background: theme.base.palette['primary-background'],\n 'foreground-color': 'auto'\n },\n ai: readableHue(theme.base.palette.ai, effectiveBackground)\n },\n link: {\n color: readableHue(theme.base.palette.interactive, effectiveBackground)\n }\n }\n }}\n >\n {hasBannerRegionContent && (\n <Flex\n as={StyledBannerContentArea}\n container={{ direction: 'column', gap: 2, pad: [1, 0, 0, 0] }}\n className={createClassName('banner-page-banner-content')}\n >\n {bannerRegion.map(el => el)}\n </Flex>\n )}\n </ThemeOverride>\n </StyledContentContainer>\n </Flex>\n </StyledBannerContainer>\n );\n\n const pageTabs = [\n { name: t('content'), id: 'content', content: pageContent },\n {\n name: t('chat_with_ai'),\n id: 'chat_with_ai',\n content: utilities\n }\n ];\n\n const handleTabChange = (id: string) => {\n setPanel(id);\n };\n\n if (utilities) {\n if (isMediumOrAbove) {\n return (\n <Flex\n as={StyledBannerPage}\n container={{ gap: 2 }}\n ref={ref}\n {...restProps}\n className={className}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n {pageContent}\n </StyledPageContentWrapper>\n </Flex>\n <div>{utilities}</div>\n </Flex>\n );\n }\n\n return (\n <Flex\n container={{ direction: 'column', gap: effectiveOverlap ? 0 : 2 }}\n as={StyledBannerPage}\n className={className}\n >\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n <Flex container={{ direction: 'column', pad: [undefined, 2, undefined] }}>\n <Tabs\n tabs={pageTabs}\n onTabClick={handleTabChange}\n currentTabId={panel}\n ref={pageTabsRef}\n />\n {pageTabs.map(tab => (\n <TabPanel tabId={tab.id} currentTabId={panel} tablistRef={pageTabsRef} key={tab.id}>\n <StyledPageTabContent>{tab.content}</StyledPageTabContent>\n </TabPanel>\n ))}\n </Flex>\n </StyledPageContentWrapper>\n </Flex>\n );\n }\n\n return (\n <StyledBannerPage ref={ref} {...restProps} className={className}>\n {pageBanner}\n <StyledPageContentWrapper\n enableContentOverlap={effectiveOverlap}\n className={createClassName('banner-page-content-wrapper')}\n >\n {pageContent}\n </StyledPageContentWrapper>\n </StyledBannerPage>\n );\n }\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickCreate.d.ts","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAwBpD,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CA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,MAAM,8BAA8B;;uJAIzC,CAAC;AAsBH,eAAO,MAAM,cAAc;oBAAkC,kBAAkB;0JAU7E,CAAC;AAIH,QAAA,MAAM,WAAW,EAAE,+BAA+B,CAAC,gBAAgB,CAsKlE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -127,20 +127,20 @@ const QuickCreate = forwardRef(function QuickCreate({ heading, actions, classNam
|
|
|
127
127
|
const isStacked = displayVariant === 'stacked';
|
|
128
128
|
const supplementalColorsList = supplementalColors(theme);
|
|
129
129
|
const getActionColor = (actionColor, idx) => {
|
|
130
|
-
|
|
130
|
+
const isColorIgnored = theme.base['case-type-colors'] === 'ignored';
|
|
131
|
+
if (isColorIgnored)
|
|
132
|
+
return undefined;
|
|
133
|
+
if (actionColor !== undefined) {
|
|
131
134
|
const supplementalColor = resolveSupplementalColor(theme, actionColor);
|
|
132
|
-
|
|
133
|
-
return supplementalColor;
|
|
134
|
-
if (isSolidColor(actionColor))
|
|
135
|
-
return actionColor;
|
|
135
|
+
return supplementalColor ?? (isSolidColor(actionColor) ? actionColor : undefined);
|
|
136
136
|
}
|
|
137
137
|
return supplementalColorsList[idx % supplementalColorsList.length];
|
|
138
138
|
};
|
|
139
139
|
const getIconComp = (iconName, iconBackground) => {
|
|
140
|
-
return iconBackground !== undefined ? (_jsx(StyledCaseIcon, {
|
|
140
|
+
return iconBackground !== undefined ? (_jsx(StyledCaseIcon, { name: iconName, foreground: readableColor(iconBackground, {
|
|
141
141
|
mode: 'light',
|
|
142
142
|
level: 'AANonText'
|
|
143
|
-
}), background: iconBackground,
|
|
143
|
+
}), background: iconBackground, displayVariant: displayVariant })) : (_jsx(StyledCaseIcon, { size: 'm', name: iconName, displayVariant: displayVariant }));
|
|
144
144
|
};
|
|
145
145
|
const getGridCols = () => {
|
|
146
146
|
if (isMediumOrAbove)
|
|
@@ -160,7 +160,7 @@ const QuickCreate = forwardRef(function QuickCreate({ heading, actions, classNam
|
|
|
160
160
|
gap: 0.25,
|
|
161
161
|
alignItems: 'start',
|
|
162
162
|
justify: 'center'
|
|
163
|
-
}, item: { grow: 1 }, children: [_jsx(StyledButtonText, { as: 'span', children: label }), description && (_jsx(StyledQuickCreateSecondaryText, { variant: 'secondary', forwardedAs: 'p', children: description }))] })] }), _jsx(StyledArrowSection, { container: true, children: _jsx(Icon, { name: 'arrow-right', size: '
|
|
163
|
+
}, item: { grow: 1 }, children: [_jsx(StyledButtonText, { as: 'span', children: label }), description && (_jsx(StyledQuickCreateSecondaryText, { variant: 'secondary', forwardedAs: 'p', children: description }))] })] }), _jsx(StyledArrowSection, { container: true, children: _jsx(Icon, { name: 'arrow-right', size: 's' }) })] })) }) }, label));
|
|
164
164
|
}) }) })] }));
|
|
165
165
|
});
|
|
166
166
|
export default QuickCreate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickCreate.js","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAqBnF,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAA2B,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IAC7F,MAAM,UAAU,GAAG,UAAU,CAAC,C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R,UAAU,EAAC,aAAa,EACxB,KAAK,EAAC,QAAQ,GACd,GACiB,IACM,CAC9B,GACuB,IAzEnB,KAAK,CA0ET,CACN,CAAC;oBACJ,CAAC,CAAC,GACG,GACW,IACE,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { Ref, MouseEventHandler } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n Flex,\n Grid,\n StyledIcon,\n Icon,\n Text,\n VisuallyHiddenText,\n useBreakpoint,\n useTheme,\n supplementalColors,\n resolveSupplementalColor,\n isSolidColor,\n readableColor,\n useConsolidatedRef,\n createClassName\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledIconShape } from '@pega/cosmos-react-core/lib/components/Icon/Icon';\n\nexport interface QuickCreateAction {\n label: string;\n icon?: string;\n description?: string;\n color?: string;\n onClick: MouseEventHandler;\n}\n\nexport type QuickCreateVariant = 'inline' | 'stacked';\n\nexport interface QuickCreateProps extends BaseProps, NoChildrenProp {\n heading: string;\n actions: QuickCreateAction[];\n variant?: QuickCreateVariant;\n showHeader?: boolean;\n backgroundColor?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledQuickCreateCard = styled(Card)<{ showHeader?: boolean }>(({ theme, showHeader }) => {\n const background = showHeader ? theme.components.card.background : 'transparent';\n\n return css`\n background: ${background};\n\n ${!showHeader &&\n css`\n padding: 0;\n `}\n `;\n});\n\nStyledQuickCreateCard.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreate = styled(CardContent)<{ showHeader?: boolean }>(({ showHeader }) => {\n return css`\n ${!showHeader &&\n css`\n &&&& {\n padding: 0;\n }\n `}\n\n ul {\n list-style: none;\n }\n `;\n});\n\nStyledQuickCreate.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreateButton = styled(Button)<{\n displayVariant: QuickCreateVariant;\n backgroundColor?: string;\n}>(({ theme, displayVariant, backgroundColor }) => {\n const background = backgroundColor || theme.base.palette['primary-background'];\n\n return css`\n height: 100%;\n width: 100%;\n max-height: none;\n min-height: ${displayVariant === 'stacked' ? `calc(${theme.base.spacing} * 12.5)` : 'auto'};\n padding-block: calc(${theme.base.spacing} * 1.5);\n padding-inline: calc(${theme.base.spacing} * 2);\n border-radius: ${theme.base['border-radius']};\n border-color: ${theme.base.palette['border-line']};\n justify-content: ${displayVariant === 'stacked' ? 'center' : 'start'};\n text-align: ${displayVariant === 'stacked' ? 'center' : 'start'};\n white-space: break-spaces;\n word-break: break-word;\n background: ${background};\n `;\n});\n\nStyledQuickCreateButton.defaultProps = defaultThemeProp;\n\nconst StyledButtonText = styled.span(({ theme }) => {\n return css`\n ${lineClamp(2)}\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n `;\n});\n\nStyledButtonText.defaultProps = defaultThemeProp;\n\nconst StyledQuickCreateContainer = styled(Flex)<{ variant: QuickCreateVariant }>(({ variant }) => {\n return css`\n width: 100%;\n\n ${variant === 'stacked' &&\n css`\n text-align: center;\n `}\n `;\n});\n\nStyledQuickCreateContainer.defaultProps = defaultThemeProp;\n\nconst StyledIconSection = styled(Flex)<{ variant: QuickCreateVariant }>(({ variant }) => {\n return css`\n min-width: ${variant === 'stacked' ? 'auto' : '2rem'};\n stroke-width: 50%;\n `;\n});\n\nStyledIconSection.defaultProps = defaultThemeProp;\n\nconst StyledMiddleSection = styled(Flex)``;\n\nStyledMiddleSection.defaultProps = defaultThemeProp;\n\nconst StyledStackedRow = styled(Flex)(() => {\n return css`\n width: 100%;\n justify-content: center;\n `;\n});\n\nStyledStackedRow.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreateSecondaryText = styled(Text)(() => {\n return css`\n ${lineClamp(2)}\n `;\n});\n\nStyledQuickCreateSecondaryText.defaultProps = defaultThemeProp;\n\nconst StyledArrowSection = styled(Flex)(() => {\n return css`\n min-width: 2rem;\n\n ${StyledIconShape} {\n height: 1rem;\n }\n\n ${StyledIcon} {\n fill: CanvasText;\n height: 100%;\n align-self: flex-end;\n }\n `;\n});\n\nStyledArrowSection.defaultProps = defaultThemeProp;\n\nexport const StyledCaseIcon = styled(Icon)<{ displayVariant: QuickCreateVariant }>(({\n displayVariant\n}) => {\n return css`\n ${displayVariant === 'stacked' &&\n css`\n height: 3rem;\n width: 3rem;\n `}\n `;\n});\n\nStyledCaseIcon.defaultProps = defaultThemeProp;\n\nconst QuickCreate: ForwardRefForwardPropsComponent<QuickCreateProps> = forwardRef(\n function QuickCreate(\n {\n heading,\n actions,\n className,\n variant = 'inline',\n backgroundColor,\n showHeader = true,\n ...restProps\n }: QuickCreateProps,\n ref: QuickCreateProps['ref']\n ) {\n const theme = useTheme();\n const consolidatedRef = useConsolidatedRef<HTMLDivElement>(ref);\n\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: consolidatedRef });\n const isMediumOrAbove = useBreakpoint('md', { breakpointRef: consolidatedRef });\n\n const displayVariant: QuickCreateVariant = variant === 'stacked' ? 'stacked' : 'inline';\n const isStacked = displayVariant === 'stacked';\n\n const supplementalColorsList = supplementalColors(theme);\n\n const getActionColor = (actionColor: string | undefined, idx: number): string | undefined => {\n if (actionColor !== undefined && theme.base['case-type-colors'] !== 'ignored') {\n const supplementalColor = resolveSupplementalColor(theme, actionColor);\n\n if (supplementalColor !== undefined) return supplementalColor;\n if (isSolidColor(actionColor)) return actionColor;\n }\n\n return supplementalColorsList[idx % supplementalColorsList.length];\n };\n\n const getIconComp = (iconName: string, iconBackground: string | undefined) => {\n return iconBackground !== undefined ? (\n <StyledCaseIcon\n size='m'\n name={iconName}\n foreground={readableColor(iconBackground, {\n mode: 'light',\n level: 'AANonText'\n })}\n background={iconBackground}\n shape='square'\n displayVariant={displayVariant}\n />\n ) : (\n <StyledCaseIcon size='m' name={iconName} displayVariant={displayVariant} />\n );\n };\n\n const getGridCols = () => {\n if (isMediumOrAbove) return 'repeat(4, minmax(0, 1fr))';\n if (isSmallOrAbove) return 'repeat(2, minmax(0, 1fr))';\n\n return `repeat(auto-fill, minmax(min(calc(${theme.base.spacing} * 30), 100%), 1fr))`;\n };\n\n return (\n <StyledQuickCreateCard\n {...restProps}\n ref={consolidatedRef}\n showHeader={showHeader}\n className={createClassName('quick-create', className)}\n >\n {showHeader ? (\n <CardHeader>\n <Text variant='h2'>{heading}</Text>\n </CardHeader>\n ) : (\n <VisuallyHiddenText as='h2'>{heading}</VisuallyHiddenText>\n )}\n\n <StyledQuickCreate showHeader={showHeader}>\n <Grid\n as='ul'\n container={{\n gap: 1.5,\n cols: getGridCols(),\n ...(showHeader ? {} : { justifyContent: 'center' })\n }}\n >\n {actions.map(({ label, icon, description, color, onClick }, idx) => {\n const iconBackground = getActionColor(color, idx);\n\n return (\n <li key={label}>\n <StyledQuickCreateButton\n onClick={onClick}\n variant='secondary'\n displayVariant={displayVariant}\n backgroundColor={backgroundColor}\n >\n {isStacked ? (\n <StyledQuickCreateContainer\n variant={displayVariant}\n container={{ gap: 0.75, alignItems: 'center', direction: 'column' }}\n >\n {icon && (\n <StyledStackedRow container>\n <StyledIconSection variant={displayVariant} container>\n {getIconComp(icon, iconBackground)}\n </StyledIconSection>\n </StyledStackedRow>\n )}\n\n <StyledStackedRow container>\n <StyledButtonText as='span'>{label}</StyledButtonText>\n </StyledStackedRow>\n\n {description && (\n <StyledStackedRow container>\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n </StyledStackedRow>\n )}\n </StyledQuickCreateContainer>\n ) : (\n <StyledQuickCreateContainer\n variant={displayVariant}\n container={{ gap: 0, alignItems: 'center' }}\n >\n <Flex container={{ gap: 1.5, alignItems: 'center' }} item={{ grow: 1 }}>\n {icon && (\n <StyledIconSection variant={displayVariant} container>\n {getIconComp(icon, iconBackground)}\n </StyledIconSection>\n )}\n\n <StyledMiddleSection\n container={{\n direction: 'column',\n gap: 0.25,\n alignItems: 'start',\n justify: 'center'\n }}\n item={{ grow: 1 }}\n >\n <StyledButtonText as='span'>{label}</StyledButtonText>\n\n {description && (\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n )}\n </StyledMiddleSection>\n </Flex>\n\n <StyledArrowSection container>\n <Icon\n name='arrow-right'\n size='m'\n background='transparent'\n shape='square'\n />\n </StyledArrowSection>\n </StyledQuickCreateContainer>\n )}\n </StyledQuickCreateButton>\n </li>\n );\n })}\n </Grid>\n </StyledQuickCreate>\n </StyledQuickCreateCard>\n );\n }\n);\n\nexport default QuickCreate;\n"]}
|
|
1
|
+
{"version":3,"file":"QuickCreate.js","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAqBnF,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAA2B,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IAC7F,MAAM,UAAU,GAAG,UAAU,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C,IAAI,EAAC,GAAG,GAAG,GACjB,IACM,CAC9B,GACuB,IApEnB,KAAK,CAqET,CACN,CAAC;oBACJ,CAAC,CAAC,GACG,GACW,IACE,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { Ref, MouseEventHandler } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n Flex,\n Grid,\n StyledIcon,\n Icon,\n Text,\n VisuallyHiddenText,\n useBreakpoint,\n useTheme,\n supplementalColors,\n resolveSupplementalColor,\n isSolidColor,\n readableColor,\n useConsolidatedRef,\n createClassName\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledIconShape } from '@pega/cosmos-react-core/lib/components/Icon/Icon';\n\nexport interface QuickCreateAction {\n label: string;\n icon?: string;\n description?: string;\n color?: string;\n onClick: MouseEventHandler;\n}\n\nexport type QuickCreateVariant = 'inline' | 'stacked';\n\nexport interface QuickCreateProps extends BaseProps, NoChildrenProp {\n heading: string;\n actions: QuickCreateAction[];\n variant?: QuickCreateVariant;\n showHeader?: boolean;\n backgroundColor?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledQuickCreateCard = styled(Card)<{ showHeader?: boolean }>(({ theme, showHeader }) => {\n const background = showHeader ? theme.components.card.background : 'transparent';\n\n return css`\n background: ${background};\n\n ${!showHeader &&\n css`\n padding: 0;\n `}\n `;\n});\n\nStyledQuickCreateCard.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreate = styled(CardContent)<{ showHeader?: boolean }>(({ showHeader }) => {\n return css`\n ${!showHeader &&\n css`\n &&&& {\n padding: 0;\n }\n `}\n\n ul {\n list-style: none;\n }\n `;\n});\n\nStyledQuickCreate.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreateButton = styled(Button)<{\n displayVariant: QuickCreateVariant;\n backgroundColor?: string;\n}>(({ theme, displayVariant, backgroundColor }) => {\n const background = backgroundColor || theme.base.palette['primary-background'];\n\n return css`\n height: 100%;\n width: 100%;\n max-height: none;\n min-height: ${displayVariant === 'stacked' ? `calc(${theme.base.spacing} * 12.5)` : 'auto'};\n padding-block: calc(${theme.base.spacing} * 1.5);\n padding-inline: calc(${theme.base.spacing} * 2);\n border-radius: ${theme.base['border-radius']};\n border-color: ${theme.base.palette['border-line']};\n justify-content: ${displayVariant === 'stacked' ? 'center' : 'start'};\n text-align: ${displayVariant === 'stacked' ? 'center' : 'start'};\n white-space: break-spaces;\n word-break: break-word;\n background: ${background};\n `;\n});\n\nStyledQuickCreateButton.defaultProps = defaultThemeProp;\n\nconst StyledButtonText = styled.span(({ theme }) => {\n return css`\n ${lineClamp(2)}\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n `;\n});\n\nStyledButtonText.defaultProps = defaultThemeProp;\n\nconst StyledQuickCreateContainer = styled(Flex)<{ variant: QuickCreateVariant }>(({ variant }) => {\n return css`\n width: 100%;\n\n ${variant === 'stacked' &&\n css`\n text-align: center;\n `}\n `;\n});\n\nStyledQuickCreateContainer.defaultProps = defaultThemeProp;\n\nconst StyledIconSection = styled(Flex)<{ variant: QuickCreateVariant }>(({ variant }) => {\n return css`\n min-width: ${variant === 'stacked' ? 'auto' : '2rem'};\n stroke-width: 50%;\n `;\n});\n\nStyledIconSection.defaultProps = defaultThemeProp;\n\nconst StyledMiddleSection = styled(Flex)``;\n\nStyledMiddleSection.defaultProps = defaultThemeProp;\n\nconst StyledStackedRow = styled(Flex)(() => {\n return css`\n width: 100%;\n justify-content: center;\n `;\n});\n\nStyledStackedRow.defaultProps = defaultThemeProp;\n\nexport const StyledQuickCreateSecondaryText = styled(Text)(() => {\n return css`\n ${lineClamp(2)}\n `;\n});\n\nStyledQuickCreateSecondaryText.defaultProps = defaultThemeProp;\n\nconst StyledArrowSection = styled(Flex)(() => {\n return css`\n min-width: 2rem;\n\n ${StyledIconShape} {\n height: 1rem;\n }\n\n ${StyledIcon} {\n fill: CanvasText;\n height: 100%;\n align-self: flex-end;\n }\n `;\n});\n\nStyledArrowSection.defaultProps = defaultThemeProp;\n\nexport const StyledCaseIcon = styled(Icon)<{ displayVariant: QuickCreateVariant }>(({\n displayVariant\n}) => {\n return css`\n ${displayVariant === 'stacked' &&\n css`\n height: 3rem;\n width: 3rem;\n `}\n `;\n});\n\nStyledCaseIcon.defaultProps = defaultThemeProp;\n\nconst QuickCreate: ForwardRefForwardPropsComponent<QuickCreateProps> = forwardRef(\n function QuickCreate(\n {\n heading,\n actions,\n className,\n variant = 'inline',\n backgroundColor,\n showHeader = true,\n ...restProps\n }: QuickCreateProps,\n ref: QuickCreateProps['ref']\n ) {\n const theme = useTheme();\n const consolidatedRef = useConsolidatedRef<HTMLDivElement>(ref);\n\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: consolidatedRef });\n const isMediumOrAbove = useBreakpoint('md', { breakpointRef: consolidatedRef });\n\n const displayVariant: QuickCreateVariant = variant === 'stacked' ? 'stacked' : 'inline';\n const isStacked = displayVariant === 'stacked';\n\n const supplementalColorsList = supplementalColors(theme);\n\n const getActionColor = (actionColor: string | undefined, idx: number): string | undefined => {\n const isColorIgnored = theme.base['case-type-colors'] === 'ignored';\n\n if (isColorIgnored) return undefined;\n\n if (actionColor !== undefined) {\n const supplementalColor = resolveSupplementalColor(theme, actionColor);\n\n return supplementalColor ?? (isSolidColor(actionColor) ? actionColor : undefined);\n }\n\n return supplementalColorsList[idx % supplementalColorsList.length];\n };\n\n const getIconComp = (iconName: string, iconBackground: string | undefined) => {\n return iconBackground !== undefined ? (\n <StyledCaseIcon\n name={iconName}\n foreground={readableColor(iconBackground, {\n mode: 'light',\n level: 'AANonText'\n })}\n background={iconBackground}\n displayVariant={displayVariant}\n />\n ) : (\n <StyledCaseIcon size='m' name={iconName} displayVariant={displayVariant} />\n );\n };\n\n const getGridCols = () => {\n if (isMediumOrAbove) return 'repeat(4, minmax(0, 1fr))';\n if (isSmallOrAbove) return 'repeat(2, minmax(0, 1fr))';\n\n return `repeat(auto-fill, minmax(min(calc(${theme.base.spacing} * 30), 100%), 1fr))`;\n };\n\n return (\n <StyledQuickCreateCard\n {...restProps}\n ref={consolidatedRef}\n showHeader={showHeader}\n className={createClassName('quick-create', className)}\n >\n {showHeader ? (\n <CardHeader>\n <Text variant='h2'>{heading}</Text>\n </CardHeader>\n ) : (\n <VisuallyHiddenText as='h2'>{heading}</VisuallyHiddenText>\n )}\n\n <StyledQuickCreate showHeader={showHeader}>\n <Grid\n as='ul'\n container={{\n gap: 1.5,\n cols: getGridCols(),\n ...(showHeader ? {} : { justifyContent: 'center' })\n }}\n >\n {actions.map(({ label, icon, description, color, onClick }, idx) => {\n const iconBackground = getActionColor(color, idx);\n\n return (\n <li key={label}>\n <StyledQuickCreateButton\n onClick={onClick}\n variant='secondary'\n displayVariant={displayVariant}\n backgroundColor={backgroundColor}\n >\n {isStacked ? (\n <StyledQuickCreateContainer\n variant={displayVariant}\n container={{ gap: 0.75, alignItems: 'center', direction: 'column' }}\n >\n {icon && (\n <StyledStackedRow container>\n <StyledIconSection variant={displayVariant} container>\n {getIconComp(icon, iconBackground)}\n </StyledIconSection>\n </StyledStackedRow>\n )}\n\n <StyledStackedRow container>\n <StyledButtonText as='span'>{label}</StyledButtonText>\n </StyledStackedRow>\n\n {description && (\n <StyledStackedRow container>\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n </StyledStackedRow>\n )}\n </StyledQuickCreateContainer>\n ) : (\n <StyledQuickCreateContainer\n variant={displayVariant}\n container={{ gap: 0, alignItems: 'center' }}\n >\n <Flex container={{ gap: 1.5, alignItems: 'center' }} item={{ grow: 1 }}>\n {icon && (\n <StyledIconSection variant={displayVariant} container>\n {getIconComp(icon, iconBackground)}\n </StyledIconSection>\n )}\n\n <StyledMiddleSection\n container={{\n direction: 'column',\n gap: 0.25,\n alignItems: 'start',\n justify: 'center'\n }}\n item={{ grow: 1 }}\n >\n <StyledButtonText as='span'>{label}</StyledButtonText>\n\n {description && (\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n )}\n </StyledMiddleSection>\n </Flex>\n\n <StyledArrowSection container>\n <Icon name='arrow-right' size='s' />\n </StyledArrowSection>\n </StyledQuickCreateContainer>\n )}\n </StyledQuickCreateButton>\n </li>\n );\n })}\n </Grid>\n </StyledQuickCreate>\n </StyledQuickCreateCard>\n );\n }\n);\n\nexport default QuickCreate;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-wss",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.5-2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "9.5.
|
|
18
|
-
"@pega/cosmos-react-work": "9.5.
|
|
17
|
+
"@pega/cosmos-react-core": "9.5.5-2",
|
|
18
|
+
"@pega/cosmos-react-work": "9.5.5-2",
|
|
19
19
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
20
20
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
21
21
|
"polished": "^4.1.0",
|