@pega/cosmos-react-core 10.0.0-build.9.1 → 10.0.0-build.9.11
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/AIRewrite/AIRewrite.styles.d.ts +32 -12
- package/lib/components/AIRewrite/AIRewrite.styles.d.ts.map +1 -1
- package/lib/components/AIRewrite/AIRewrite.styles.js +5 -2
- package/lib/components/AIRewrite/AIRewrite.styles.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -3
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +9 -0
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts +2 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +22 -12
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +4 -2
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +43 -18
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +23 -2
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +63 -23
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/Notifications.d.ts +28 -0
- package/lib/components/AppShell/Notifications.d.ts.map +1 -0
- package/lib/components/AppShell/Notifications.js +145 -0
- package/lib/components/AppShell/Notifications.js.map +1 -0
- package/lib/components/AppShell/TouchAppShell.d.ts +11 -25
- package/lib/components/AppShell/TouchAppShell.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.js +36 -12
- package/lib/components/AppShell/TouchAppShell.js.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.d.ts +202 -1
- package/lib/components/AppShell/TouchAppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.js +45 -3
- package/lib/components/AppShell/TouchAppShell.styles.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +1 -1
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +7 -0
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js +6 -5
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +7 -0
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +117 -26
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +4 -1
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +68 -5
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +42 -12
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +29 -33
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/FormDialogWrapper.d.ts +5 -0
- package/lib/components/Dialog/FormDialogWrapper.d.ts.map +1 -0
- package/lib/components/Dialog/FormDialogWrapper.js +13 -0
- package/lib/components/Dialog/FormDialogWrapper.js.map +1 -0
- package/lib/components/Dialog/TouchDialog.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.js +40 -15
- package/lib/components/Dialog/TouchDialog.js.map +1 -1
- package/lib/components/Dialog/TouchDialog.styles.d.ts +8 -1
- package/lib/components/Dialog/TouchDialog.styles.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.styles.js +39 -23
- package/lib/components/Dialog/TouchDialog.styles.js.map +1 -1
- package/lib/components/Dialog/TouchDialog.types.d.ts +19 -6
- package/lib/components/Dialog/TouchDialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/TouchDialog.types.js.map +1 -1
- package/lib/components/Dialog/TouchFormDialog.d.ts +5 -0
- package/lib/components/Dialog/TouchFormDialog.d.ts.map +1 -0
- package/lib/components/Dialog/TouchFormDialog.js +53 -0
- package/lib/components/Dialog/TouchFormDialog.js.map +1 -0
- package/lib/components/Dialog/TouchFormDialog.styles.d.ts +7 -0
- package/lib/components/Dialog/TouchFormDialog.styles.d.ts.map +1 -0
- package/lib/components/Dialog/TouchFormDialog.styles.js +39 -0
- package/lib/components/Dialog/TouchFormDialog.styles.js.map +1 -0
- package/lib/components/Dialog/index.d.ts +2 -1
- package/lib/components/Dialog/index.d.ts.map +1 -1
- package/lib/components/Dialog/index.js +2 -1
- package/lib/components/Dialog/index.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +13 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/share-external-solid.icon.d.ts +5 -0
- package/lib/components/Icon/icons/share-external-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/share-external-solid.icon.js +7 -0
- package/lib/components/Icon/icons/share-external-solid.icon.js.map +1 -0
- package/lib/components/Icon/icons/share-external.icon.d.ts +5 -0
- package/lib/components/Icon/icons/share-external.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/share-external.icon.js +7 -0
- package/lib/components/Icon/icons/share-external.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/share-external-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/share-external-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/share-external-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/share-external-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/share-external.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/share-external.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/share-external.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/share-external.icon.js.map +1 -0
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +2 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/InlineEdit/InlineEdit.styles.d.ts +32 -12
- package/lib/components/InlineEdit/InlineEdit.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +56 -70
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +820 -57
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +325 -73
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +2 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +4 -3
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +6 -2
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/hooks/useAnimatedText.d.ts.map +1 -1
- package/lib/hooks/useAnimatedText.js +12 -1
- package/lib/hooks/useAnimatedText.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +10 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +10 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +12 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +10 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/theme/themes/orionDarkTheme.json +2 -1
- package/lib/theme/themes/orionTheme.json +3 -3
- package/lib/theme/themes/virgoDarkTheme.json +2 -1
- package/lib/theme/themes/virgoTheme.json +2 -1
- package/package.json +1 -1
|
@@ -1,38 +1,58 @@
|
|
|
1
1
|
export declare const StyledAIRewriteDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<Omit<import("../Dialog/Dialog.types").BaseDialogProps & {
|
|
2
2
|
onDismiss?: () => void;
|
|
3
|
-
onCancel: import("../Dialog/Dialog.types").FormAction;
|
|
4
3
|
onSubmit: import("../Dialog/Dialog.types").FormAction;
|
|
5
4
|
} & {
|
|
6
|
-
compact
|
|
5
|
+
compact?: boolean;
|
|
7
6
|
} & {
|
|
8
7
|
'aria-label': string;
|
|
9
8
|
heading?: never;
|
|
10
9
|
additionalInfo?: never;
|
|
11
|
-
} &
|
|
10
|
+
} & {
|
|
11
|
+
onAfterClose?: () => void;
|
|
12
|
+
onCancel: import("../Dialog/Dialog.types").FormAction | undefined;
|
|
13
|
+
} & Omit<import("../..").Attributes<"div">, "compact" | "aria-label" | "onSubmit" | "onCancel" | "heading" | "onAfterClose" | "onDismiss" | keyof import("../Dialog/Dialog.types").BaseDialogProps | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
14
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
15
|
}) | (Omit<Omit<import("../Dialog/Dialog.types").BaseDialogProps & {
|
|
14
16
|
onDismiss?: () => void;
|
|
15
|
-
onCancel: import("../Dialog/Dialog.types").FormAction;
|
|
16
17
|
onSubmit: import("../Dialog/Dialog.types").FormAction;
|
|
17
18
|
} & {
|
|
18
|
-
compact?:
|
|
19
|
+
compact?: boolean;
|
|
20
|
+
} & {
|
|
21
|
+
'aria-label': string;
|
|
22
|
+
heading?: never;
|
|
23
|
+
additionalInfo?: never;
|
|
24
|
+
} & {
|
|
25
|
+
onAfterClose: () => void;
|
|
26
|
+
onCancel?: import("../Dialog/Dialog.types").FormAction;
|
|
27
|
+
} & Omit<import("../..").Attributes<"div">, "compact" | "aria-label" | "onSubmit" | "onCancel" | "heading" | "onAfterClose" | "onDismiss" | keyof import("../Dialog/Dialog.types").BaseDialogProps | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
28
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
}) | (Omit<Omit<import("../Dialog/Dialog.types").BaseDialogProps & {
|
|
30
|
+
onDismiss?: () => void;
|
|
31
|
+
onSubmit: import("../Dialog/Dialog.types").FormAction;
|
|
32
|
+
} & {
|
|
33
|
+
compact?: false;
|
|
19
34
|
} & {
|
|
20
35
|
heading: string;
|
|
21
36
|
additionalInfo?: import("../AdditionalInfo").AdditionalInfoProps;
|
|
22
37
|
'aria-label'?: never;
|
|
23
|
-
} &
|
|
38
|
+
} & {
|
|
39
|
+
onAfterClose?: () => void;
|
|
40
|
+
onCancel: import("../Dialog/Dialog.types").FormAction | undefined;
|
|
41
|
+
} & Omit<import("../..").Attributes<"div">, "compact" | "aria-label" | "onSubmit" | "onCancel" | "heading" | "onAfterClose" | "onDismiss" | keyof import("../Dialog/Dialog.types").BaseDialogProps | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
24
42
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
25
43
|
}) | (Omit<Omit<import("../Dialog/Dialog.types").BaseDialogProps & {
|
|
26
44
|
onDismiss?: () => void;
|
|
27
|
-
onCancel: import("../Dialog/Dialog.types").FormAction;
|
|
28
45
|
onSubmit: import("../Dialog/Dialog.types").FormAction;
|
|
29
46
|
} & {
|
|
30
|
-
compact?: false
|
|
47
|
+
compact?: false;
|
|
31
48
|
} & {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} &
|
|
49
|
+
heading: string;
|
|
50
|
+
additionalInfo?: import("../AdditionalInfo").AdditionalInfoProps;
|
|
51
|
+
'aria-label'?: never;
|
|
52
|
+
} & {
|
|
53
|
+
onAfterClose: () => void;
|
|
54
|
+
onCancel?: import("../Dialog/Dialog.types").FormAction;
|
|
55
|
+
} & Omit<import("../..").Attributes<"div">, "compact" | "aria-label" | "onSubmit" | "onCancel" | "heading" | "onAfterClose" | "onDismiss" | keyof import("../Dialog/Dialog.types").BaseDialogProps | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
36
56
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
37
57
|
}), import("styled-components/dist/types").BaseObject>> & string & Omit<import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("../Dialog").FormDialogProps> & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
38
58
|
export declare const StyledFormSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRewrite.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AIRewrite/AIRewrite.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AIRewrite.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AIRewrite/AIRewrite.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uRAMhC,CAAC;AAIH,eAAO,MAAM,iBAAiB,6NAM5B,CAAC;AAIH,eAAO,MAAM,yBAAyB,6NAIrC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { defaultThemeProp } from '../../theme';
|
|
3
|
-
import FormDialog from '../Dialog
|
|
3
|
+
import { FormDialog } from '../Dialog';
|
|
4
|
+
import { StyledTouchDialog } from '../Dialog/TouchDialog.styles';
|
|
4
5
|
export const StyledAIRewriteDialog = styled(FormDialog)(({ theme }) => {
|
|
5
6
|
return css `
|
|
6
|
-
|
|
7
|
+
&:not(${StyledTouchDialog}) {
|
|
8
|
+
min-width: min(${theme.base['content-width'].xl}, calc(100vw - 2rem));
|
|
9
|
+
}
|
|
7
10
|
`;
|
|
8
11
|
});
|
|
9
12
|
StyledAIRewriteDialog.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRewrite.styles.js","sourceRoot":"","sources":["../../../src/components/AIRewrite/AIRewrite.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"AIRewrite.styles.js","sourceRoot":"","sources":["../../../src/components/AIRewrite/AIRewrite.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpE,OAAO,GAAG,CAAA;YACA,iBAAiB;uBACN,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;GAElD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;kBACM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;qBACvC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;wBACxB,KAAK,CAAC,IAAI,CAAC,OAAO;GACvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIlD,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { FormDialog } from '../Dialog';\nimport { StyledTouchDialog } from '../Dialog/TouchDialog.styles';\n\nexport const StyledAIRewriteDialog = styled(FormDialog)(({ theme }) => {\n return css`\n &:not(${StyledTouchDialog}) {\n min-width: min(${theme.base['content-width'].xl}, calc(100vw - 2rem));\n }\n `;\n});\n\nStyledAIRewriteDialog.defaultProps = defaultThemeProp;\n\nexport const StyledFormSection = styled.div(({ theme }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border-radius: ${theme.base['border-radius']};\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledFormSection.defaultProps = defaultThemeProp;\n\nexport const StyledInstructionsWrapper = styled.div`\n textarea {\n min-height: unset;\n }\n`;\n\nStyledInstructionsWrapper.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,OAAO,CAAC;AAQjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,OAAO,CAAC;AAQjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAiO9D,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -11,13 +11,13 @@ import { ThemeOverride } from '../Configuration';
|
|
|
11
11
|
import useThemeMode from '../../hooks/useThemeMode';
|
|
12
12
|
import MenuButton from '../MenuButton';
|
|
13
13
|
import AppShellOperator from './Operator';
|
|
14
|
+
import AppShellNotifications from './Notifications';
|
|
14
15
|
import ContextSwitcher from './ContextSwitcher';
|
|
15
16
|
import { StyledAppHeader, StyledAppHeaderInfo, StyledAppHeaderName, StyledAppHeaderSearchForm, StyledAppHeaderSpacer, StyledAppHeaderText, StyledAppHeaderOperator, StyledAppHeaderLogo } from './AppHeader.styles';
|
|
16
|
-
import { StyledShareIcon } from './AppShell.styles';
|
|
17
17
|
import AppShellContext from './AppShellContext';
|
|
18
18
|
import { getHeaderTheme } from './style-utils';
|
|
19
19
|
import ThemeSwitcher from './ThemeSwitcher';
|
|
20
|
-
const AppHeader = forwardRef(function AppHeader({ appName, contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {}, fullImageSrc, imageSrc, imageAltText, href, onClick, portalName, target, appNameHidden, operator, searchInput, searchLabel, searchPage, headerUtils, helpMenu, shareApp, portalSwitcher }, ref) {
|
|
20
|
+
const AppHeader = forwardRef(function AppHeader({ appName, contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {}, fullImageSrc, imageSrc, imageAltText, href, onClick, portalName, target, appNameHidden, operator, notifications, searchInput, searchLabel, searchPage, headerUtils, helpMenu, shareApp, portalSwitcher }, ref) {
|
|
21
21
|
const t = useI18n();
|
|
22
22
|
const isMediumOrAbove = useBreakpoint('md');
|
|
23
23
|
const isSmallOrAbove = useBreakpoint('sm');
|
|
@@ -75,7 +75,8 @@ const AppHeader = forwardRef(function AppHeader({ appName, contextSwitcher: { co
|
|
|
75
75
|
setSearchExpanded(false);
|
|
76
76
|
}) }))) })) : (_jsx(StyledAppHeaderSpacer, {})), !searchTakeover && headerUtils?.[1]] }), !searchTakeover && (_jsxs(_Fragment, { children: [onThemeModeChange && (_jsx(ThemeSwitcher, { themeMode: themeMode, onThemeModeChange: onThemeModeChange })), helpMenu && (_jsx(MenuButton, { variant: 'simple', icon: 'help', text: t('app_header_help'), iconOnly: true, menu: {
|
|
77
77
|
items: helpMenu
|
|
78
|
-
} })), portalSwitcher && _jsx(MenuButton, { ...portalSwitcher
|
|
78
|
+
} })), portalSwitcher && _jsx(MenuButton, { ...portalSwitcher, iconOnly: !isSmallOrAbove }), shareApp &&
|
|
79
|
+
(isSmallOrAbove ? (_jsx(Button, { variant: 'secondary', onClick: shareApp.onClick, children: _jsxs(Flex, { container: { gap: 0.5, alignItems: 'center' }, children: [_jsx(Icon, { name: 'share-external' }), _jsx("span", { children: shareLabel })] }) })) : (_jsx(Button, { variant: 'secondary', icon: true, label: shareLabel, onClick: shareApp.onClick, children: _jsx(Icon, { name: 'share-external' }) }))), notifications && _jsx(AppShellNotifications, { ...notifications }), _jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, name: operator.name, children: operator.avatar })] }))] }) }));
|
|
79
80
|
});
|
|
80
81
|
export default AppHeader;
|
|
81
82
|
//# sourceMappingURL=AppHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAA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KAAK,CAAC,CAAC;4CACpC,iBAAiB,CAAC,KAAK,CAAC,CAAC;wCAC3B,CAAC,CAAC,GAEJ,CACH,CAAC,GACsB,CAC7B,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,EACA,CAAC,cAAc,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,IAC/B,EACN,CAAC,cAAc,IAAI,CAClB,8BACG,iBAAiB,IAAI,CACpB,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,GAAI,CAC9E,EACA,QAAQ,IAAI,CACX,KAAC,UAAU,IACT,OAAO,EAAC,QAAQ,EAChB,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAC1B,QAAQ,QACR,IAAI,EAAE;gCACJ,KAAK,EAAE,QAAQ;6BAChB,GACD,CACH,EACA,cAAc,IAAI,KAAC,UAAU,OAAK,cAAc,GAAI,EACpD,QAAQ,IAAI,CACX,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,YACnD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,aACjD,KAAC,eAAe,IAAC,IAAI,EAAC,OAAO,GAAG,EAChC,yBAAO,UAAU,GAAQ,IACpB,GACA,CACV,EACD,KAAC,gBAAgB,IACf,EAAE,EAAE,uBAAuB,EAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EACtC,IAAI,EAAE,QAAQ,CAAC,IAAI,YAElB,QAAQ,CAAC,MAAM,GACC,IAClB,CACJ,IACI,GACO,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport type { FunctionComponent, Ref, ElementType } from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint, useElement, useI18n, useTheme } from '../../hooks';\nimport type { ForwardProps } from '../../types';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { ThemeOverride } from '../Configuration';\nimport useThemeMode from '../../hooks/useThemeMode';\nimport MenuButton from '../MenuButton';\n\nimport type { AppHeaderProps } from './AppShell.types';\nimport AppShellOperator from './Operator';\nimport ContextSwitcher from './ContextSwitcher';\nimport {\n StyledAppHeader,\n StyledAppHeaderInfo,\n StyledAppHeaderName,\n StyledAppHeaderSearchForm,\n StyledAppHeaderSpacer,\n StyledAppHeaderText,\n StyledAppHeaderOperator,\n StyledAppHeaderLogo\n} from './AppHeader.styles';\nimport { StyledShareIcon } from './AppShell.styles';\nimport AppShellContext from './AppShellContext';\nimport { getHeaderTheme } from './style-utils';\nimport ThemeSwitcher from './ThemeSwitcher';\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(function AppHeader(\n {\n appName,\n contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {},\n fullImageSrc,\n imageSrc,\n imageAltText,\n href,\n onClick,\n portalName,\n target,\n appNameHidden,\n operator,\n searchInput,\n searchLabel,\n searchPage,\n headerUtils,\n helpMenu,\n shareApp,\n portalSwitcher\n }: AppHeaderProps,\n ref: Ref<Element>\n) {\n const t = useI18n();\n const isMediumOrAbove = useBreakpoint('md');\n const isSmallOrAbove = useBreakpoint('sm');\n const [searchExpanded, setSearchExpanded] = useState(false);\n const [searchContainer, setSearchContainer] = useElement<HTMLElement>();\n const { drawerOpen, isTopBar, setSearchContainerEl } = useContext(AppShellContext);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const theme = useTheme();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n // Below `md` there's no room for the app/portal name side by side, so they stack into two rows.\n const stacked = !isMediumOrAbove;\n const searchCollapsible = !isMediumOrAbove || isTopBar;\n const searchDisplay = (() => {\n if (!searchExpanded) return searchCollapsible ? 'icon' : undefined;\n if (!isSmallOrAbove) return 'fullWidth';\n if (!isMediumOrAbove) return 'grow';\n return undefined;\n })();\n const searchTakeover = searchDisplay === 'fullWidth';\n\n const shareLabel = shareApp?.label ?? t('app_shell_share');\n\n useEffect(() => {\n if (searchPage && searchContainer) {\n setSearchContainerEl(searchContainer);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchContainer, setSearchContainerEl]);\n\n // Auto-collapse back to the icon when focus leaves the search area, as long as nothing was typed.\n useEffect(() => {\n if (!searchCollapsible || !searchExpanded || searchInput?.value || !searchContainer)\n return undefined;\n\n const handleFocusOut = (e: FocusEvent) => {\n const nextTarget = e.relatedTarget instanceof Node ? e.relatedTarget : null;\n if (!searchInput?.value && !searchContainer.contains(nextTarget)) setSearchExpanded(false);\n };\n\n searchContainer.addEventListener('focusout', handleFocusOut);\n return () => searchContainer.removeEventListener('focusout', handleFocusOut);\n }, [searchCollapsible, searchExpanded, searchInput?.value, searchContainer]);\n\n const { themeMode, onThemeModeChange } = useThemeMode();\n\n let appInfoAs: ElementType = 'div';\n if (href) appInfoAs = 'a';\n return (\n <ThemeOverride theme={headerTheme}>\n <Flex\n as={StyledAppHeader}\n container={{ alignItems: 'center', pad: 1 }}\n stacked={stacked}\n drawerOpen={drawerOpen}\n ref={ref}\n >\n {!searchTakeover && (\n <>\n {contexts && contexts.length > 1 && onContextClick && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n />\n )}\n\n <Flex\n as={StyledAppHeaderInfo}\n container={{ colGap: 0.5 }}\n item={{ shrink: 1 }}\n centerLogo={!fullImageSrc}\n >\n <Flex\n container={{ inline: true, alignItems: 'center' }}\n item={{ shrink: 1 }}\n as={appInfoAs}\n href={href}\n onClick={href ? onClick : undefined}\n target={target}\n >\n <Flex container={{ alignItems: 'center', gap: 1 }} item={{ shrink: 1 }}>\n {(fullImageSrc || imageSrc) && (\n <Flex\n container={{ alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledAppHeaderLogo}\n >\n <Image\n src={fullImageSrc || imageSrc}\n alt={imageAltText ?? t('application_logo')}\n />\n </Flex>\n )}\n <StyledAppHeaderName stacked={stacked || appNameHidden}>\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='primary'\n >\n {appName}\n </StyledAppHeaderText>\n {portalName && (\n <StyledAppHeaderText variant='secondary' stacked={stacked || appNameHidden}>\n {portalName}\n </StyledAppHeaderText>\n )}\n </StyledAppHeaderName>\n </Flex>\n </Flex>\n {headerUtils?.[0]}\n </Flex>\n </>\n )}\n\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={setSearchContainer}\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n searchDisplay={searchDisplay}\n >\n {!searchPage &&\n (searchDisplay === 'icon' ? (\n <Button\n icon\n variant='simple'\n label={t('search')}\n aria-label={t('expand_search')}\n onClick={() => {\n setSearchExpanded(true);\n setTimeout(() => searchInputRef.current?.focus());\n }}\n >\n <Icon name='search' />\n </Button>\n ) : (\n <SearchInput\n {...searchInput}\n ref={searchInputRef}\n onSearchSubmit={\n searchInput.onSearchSubmit &&\n (value => {\n searchInput.onSearchSubmit?.(value);\n setSearchExpanded(false);\n })\n }\n />\n ))}\n </StyledAppHeaderSearchForm>\n ) : (\n <StyledAppHeaderSpacer />\n )}\n {!searchTakeover && headerUtils?.[1]}\n </Flex>\n {!searchTakeover && (\n <>\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\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 {portalSwitcher && <MenuButton {...portalSwitcher} />}\n {shareApp && (\n <Button variant='secondary' onClick={shareApp.onClick}>\n <Flex container={{ gap: 0.5, alignItems: 'center' }}>\n <StyledShareIcon name='share' />\n <span>{shareLabel}</span>\n </Flex>\n </Button>\n )}\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.name}\n >\n {operator.avatar}\n </AppShellOperator>\n </>\n )}\n </Flex>\n </ThemeOverride>\n );\n});\n\nexport default AppHeader;\n"]}
|
|
1
|
+
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,UAAU,MAAM,eAAe,CAAC;AAGvC,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAC1C,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,e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AAQ,CAAC,OAAO,YACnD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,aACjD,KAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,GAAG,EAC9B,yBAAO,UAAU,GAAQ,IACpB,GACA,CACV,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,QAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,YAC3E,KAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,GAAG,GACvB,CACV,CAAC,EACH,aAAa,IAAI,KAAC,qBAAqB,OAAK,aAAa,GAAI,EAC9D,KAAC,gBAAgB,IACf,EAAE,EAAE,uBAAuB,EAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EACtC,IAAI,EAAE,QAAQ,CAAC,IAAI,YAElB,QAAQ,CAAC,MAAM,GACC,IAClB,CACJ,IACI,GACO,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport type { FunctionComponent, Ref, ElementType } from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint, useElement, useI18n, useTheme } from '../../hooks';\nimport type { ForwardProps } from '../../types';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { ThemeOverride } from '../Configuration';\nimport useThemeMode from '../../hooks/useThemeMode';\nimport MenuButton from '../MenuButton';\n\nimport type { AppHeaderProps } from './AppShell.types';\nimport AppShellOperator from './Operator';\nimport AppShellNotifications from './Notifications';\nimport ContextSwitcher from './ContextSwitcher';\nimport {\n StyledAppHeader,\n StyledAppHeaderInfo,\n StyledAppHeaderName,\n StyledAppHeaderSearchForm,\n StyledAppHeaderSpacer,\n StyledAppHeaderText,\n StyledAppHeaderOperator,\n StyledAppHeaderLogo\n} from './AppHeader.styles';\nimport AppShellContext from './AppShellContext';\nimport { getHeaderTheme } from './style-utils';\nimport ThemeSwitcher from './ThemeSwitcher';\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(function AppHeader(\n {\n appName,\n contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {},\n fullImageSrc,\n imageSrc,\n imageAltText,\n href,\n onClick,\n portalName,\n target,\n appNameHidden,\n operator,\n notifications,\n searchInput,\n searchLabel,\n searchPage,\n headerUtils,\n helpMenu,\n shareApp,\n portalSwitcher\n }: AppHeaderProps,\n ref: Ref<Element>\n) {\n const t = useI18n();\n const isMediumOrAbove = useBreakpoint('md');\n const isSmallOrAbove = useBreakpoint('sm');\n const [searchExpanded, setSearchExpanded] = useState(false);\n const [searchContainer, setSearchContainer] = useElement<HTMLElement>();\n const { drawerOpen, isTopBar, setSearchContainerEl } = useContext(AppShellContext);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const theme = useTheme();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n // Below `md` there's no room for the app/portal name side by side, so they stack into two rows.\n const stacked = !isMediumOrAbove;\n const searchCollapsible = !isMediumOrAbove || isTopBar;\n const searchDisplay = (() => {\n if (!searchExpanded) return searchCollapsible ? 'icon' : undefined;\n if (!isSmallOrAbove) return 'fullWidth';\n if (!isMediumOrAbove) return 'grow';\n return undefined;\n })();\n const searchTakeover = searchDisplay === 'fullWidth';\n\n const shareLabel = shareApp?.label ?? t('app_shell_share');\n\n useEffect(() => {\n if (searchPage && searchContainer) {\n setSearchContainerEl(searchContainer);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchContainer, setSearchContainerEl]);\n\n // Auto-collapse back to the icon when focus leaves the search area, as long as nothing was typed.\n useEffect(() => {\n if (!searchCollapsible || !searchExpanded || searchInput?.value || !searchContainer)\n return undefined;\n\n const handleFocusOut = (e: FocusEvent) => {\n const nextTarget = e.relatedTarget instanceof Node ? e.relatedTarget : null;\n if (!searchInput?.value && !searchContainer.contains(nextTarget)) setSearchExpanded(false);\n };\n\n searchContainer.addEventListener('focusout', handleFocusOut);\n return () => searchContainer.removeEventListener('focusout', handleFocusOut);\n }, [searchCollapsible, searchExpanded, searchInput?.value, searchContainer]);\n\n const { themeMode, onThemeModeChange } = useThemeMode();\n\n let appInfoAs: ElementType = 'div';\n if (href) appInfoAs = 'a';\n return (\n <ThemeOverride theme={headerTheme}>\n <Flex\n as={StyledAppHeader}\n container={{ alignItems: 'center', pad: 1 }}\n stacked={stacked}\n drawerOpen={drawerOpen}\n ref={ref}\n >\n {!searchTakeover && (\n <>\n {contexts && contexts.length > 1 && onContextClick && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n />\n )}\n\n <Flex\n as={StyledAppHeaderInfo}\n container={{ colGap: 0.5 }}\n item={{ shrink: 1 }}\n centerLogo={!fullImageSrc}\n >\n <Flex\n container={{ inline: true, alignItems: 'center' }}\n item={{ shrink: 1 }}\n as={appInfoAs}\n href={href}\n onClick={href ? onClick : undefined}\n target={target}\n >\n <Flex container={{ alignItems: 'center', gap: 1 }} item={{ shrink: 1 }}>\n {(fullImageSrc || imageSrc) && (\n <Flex\n container={{ alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledAppHeaderLogo}\n >\n <Image\n src={fullImageSrc || imageSrc}\n alt={imageAltText ?? t('application_logo')}\n />\n </Flex>\n )}\n <StyledAppHeaderName stacked={stacked || appNameHidden}>\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='primary'\n >\n {appName}\n </StyledAppHeaderText>\n {portalName && (\n <StyledAppHeaderText variant='secondary' stacked={stacked || appNameHidden}>\n {portalName}\n </StyledAppHeaderText>\n )}\n </StyledAppHeaderName>\n </Flex>\n </Flex>\n {headerUtils?.[0]}\n </Flex>\n </>\n )}\n\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={setSearchContainer}\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n searchDisplay={searchDisplay}\n >\n {!searchPage &&\n (searchDisplay === 'icon' ? (\n <Button\n icon\n variant='simple'\n label={t('search')}\n aria-label={t('expand_search')}\n onClick={() => {\n setSearchExpanded(true);\n setTimeout(() => searchInputRef.current?.focus());\n }}\n >\n <Icon name='search' />\n </Button>\n ) : (\n <SearchInput\n {...searchInput}\n ref={searchInputRef}\n onSearchSubmit={\n searchInput.onSearchSubmit &&\n (value => {\n searchInput.onSearchSubmit?.(value);\n setSearchExpanded(false);\n })\n }\n />\n ))}\n </StyledAppHeaderSearchForm>\n ) : (\n <StyledAppHeaderSpacer />\n )}\n {!searchTakeover && headerUtils?.[1]}\n </Flex>\n {!searchTakeover && (\n <>\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\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 {portalSwitcher && <MenuButton {...portalSwitcher} iconOnly={!isSmallOrAbove} />}\n {shareApp &&\n (isSmallOrAbove ? (\n <Button variant='secondary' onClick={shareApp.onClick}>\n <Flex container={{ gap: 0.5, alignItems: 'center' }}>\n <Icon name='share-external' />\n <span>{shareLabel}</span>\n </Flex>\n </Button>\n ) : (\n <Button variant='secondary' icon label={shareLabel} onClick={shareApp.onClick}>\n <Icon name='share-external' />\n </Button>\n ))}\n {notifications && <AppShellNotifications {...notifications} />}\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.name}\n >\n {operator.avatar}\n </AppShellOperator>\n </>\n )}\n </Flex>\n </ThemeOverride>\n );\n});\n\nexport default AppHeader;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,eAAO,MAAM,qBAAqB,6NAIhC,CAAC;AAIH,eAAO,MAAM,mBAAmB;gBAA4B,OAAO;YA2BjE,CAAC;AAIH,eAAO,MAAM,yBAAyB;oBACpB,MAAM,GAAG,MAAM,GAAG,WAAW;YAkF7C,CAAC;AAIH,eAAO,MAAM,qBAAqB,6NAEjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,6NAI9B,CAAC;AAIH,eAAO,MAAM,mBAAmB;cAA0B,OAAO;YAQhE,CAAC;AAGF,eAAO,MAAM,mBAAmB;;;aACrB,SAAS,CAAC,SAAS,CAAC;cACnB,OAAO;8HA+CjB,CAAC;AAIH,eAAO,MAAM,uBAAuB,yOAQnC,CAAC;AAIF,eAAO,MAAM,eAAe;aAA4B,OAAO;gBAAc,OAAO;
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,eAAO,MAAM,qBAAqB,6NAIhC,CAAC;AAIH,eAAO,MAAM,mBAAmB;gBAA4B,OAAO;YA2BjE,CAAC;AAIH,eAAO,MAAM,yBAAyB;oBACpB,MAAM,GAAG,MAAM,GAAG,WAAW;YAkF7C,CAAC;AAIH,eAAO,MAAM,qBAAqB,6NAEjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,6NAI9B,CAAC;AAIH,eAAO,MAAM,mBAAmB;cAA0B,OAAO;YAQhE,CAAC;AAGF,eAAO,MAAM,mBAAmB;;;aACrB,SAAS,CAAC,SAAS,CAAC;cACnB,OAAO;8HA+CjB,CAAC;AAIH,eAAO,MAAM,uBAAuB,yOAQnC,CAAC;AAIF,eAAO,MAAM,eAAe;aAA4B,OAAO;gBAAc,OAAO;YA4EnF,CAAC"}
|
|
@@ -230,6 +230,15 @@ export const StyledAppHeader = styled.header(({ stacked, drawerOpen, theme }) =>
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
+
|
|
234
|
+
&::before {
|
|
235
|
+
content: '';
|
|
236
|
+
position: absolute;
|
|
237
|
+
inset-block-start: calc(-1 * var(--appshell-hard-top-offset));
|
|
238
|
+
inset-inline: 0;
|
|
239
|
+
height: var(--appshell-hard-top-offset);
|
|
240
|
+
background: inherit;
|
|
241
|
+
}
|
|
233
242
|
`;
|
|
234
243
|
});
|
|
235
244
|
StyledAppHeader.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3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FontSize,\n getHoverColors,\n calculateForegroundColor,\n type FontSize\n} from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledImage } from '../Image';\nimport { StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { StyledPopover } from '../Popover';\nimport { StyledSearchInput } from '../SearchInput';\nimport {\n StyledSearchButton,\n StyledSearchFiltersButton,\n StyledSearchTextInput\n} from '../SearchInput/SearchInput.styles';\nimport Text from '../Text';\nimport type { TextProps } from '../Text';\n\nimport { headerHeight, navWidth } from './AppShell.styles';\n\nexport const StyledContextSwitcher = styled.div(({ theme }) => {\n return css`\n width: calc(${navWidth} - 2 * ${theme.base.spacing});\n `;\n});\n\nStyledContextSwitcher.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderInfo = styled.div<{ centerLogo: boolean }>(({ centerLogo, theme }) => {\n return css`\n & > :first-child {\n vertical-align: top;\n }\n\n & > :is(a, button) {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n & > :is(a, button):focus-visible {\n box-shadow: ${theme.base.shadow.focus};\n outline: none;\n }\n\n ${StyledImage} {\n height: 1.0725rem;\n\n ${centerLogo &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n }\n `;\n});\n\nStyledAppHeaderInfo.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearchForm = styled.form<{\n searchDisplay?: 'icon' | 'grow' | 'fullWidth';\n}>(({ searchDisplay, theme }) => {\n const {\n base: { animation },\n components: {\n 'app-shell': { header },\n input\n }\n } = theme;\n\n const {\n background: headerBg,\n 'search-input': {\n 'background-color': searchInputBg,\n 'foreground-color': searchInputFg,\n 'border-color': searchInputBorder\n }\n } = header;\n\n const searchBg = searchInputBg;\n const searchFg = calculateForegroundColor(headerBg, searchInputFg, theme);\n const searchBorder = calculateForegroundColor(headerBg, searchInputBorder, theme);\n\n return css`\n max-width: 33vw;\n min-width: 10rem;\n width: 100%;\n justify-self: center;\n margin-inline-start: 0;\n margin-inline-end: auto;\n transition: max-width ${animation.speed} ${animation.timing.ease};\n\n ${StyledSearchInput} input::placeholder {\n color: ${transparentize(0.4, searchFg)};\n }\n\n ${searchDisplay === 'icon' &&\n css`\n max-width: ${input.height};\n min-width: ${input.height};\n width: auto;\n margin-inline-start: auto;\n margin-inline-end: 0;\n `}\n\n ${searchDisplay === 'grow' &&\n css`\n flex-grow: 1;\n max-width: 100%;\n margin-inline-end: 0;\n `}\n\n ${searchDisplay === 'fullWidth' &&\n css`\n max-width: 100%;\n margin-inline-end: 0;\n `}\n\n &:not([focused]) {\n ${StyledSearchInput} {\n background: ${searchBg};\n border-color: ${searchBorder};\n ${StyledSearchButton} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n\n ${StyledSearchTextInput} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n\n ${StyledSearchFiltersButton} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n }\n }\n `;\n});\n\nStyledAppHeaderSearchForm.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSpacer = styled.div`\n margin: auto;\n`;\n\nexport const StyledAppHeaderLogo = styled.div(({ theme }) => {\n return css`\n max-width: min(${theme.base['content-width'].sm}, 25vw);\n `;\n});\nStyledAppHeaderLogo.defaultProps = defaultThemeProp;\n\n// Shrinks the app/portal name for ellipsis truncation; stacks vertically below `md` where there's no room for both names side by side.\nexport const StyledAppHeaderName = styled.div<{ stacked?: boolean }>(\n ({ theme, stacked }) => css`\n display: flex;\n flex-direction: ${stacked ? 'column' : 'row'};\n align-items: ${stacked ? 'stretch' : 'baseline'};\n gap: ${stacked ? 0 : theme.base.spacing};\n min-width: 0;\n `\n);\nStyledAppHeaderName.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderText = styled(Text)<{\n variant: TextProps['variant'];\n stacked?: boolean;\n}>(({ theme, variant, stacked }) => {\n const headerBg = theme.components['app-shell'].header.background;\n const headerFgColor = theme.components['app-shell'].header['foreground-color'];\n\n const foregroundColor =\n theme.components['app-shell'].header['app-name-color'] === 'auto'\n ? calculateForegroundColor(headerBg, headerFgColor, theme)\n : theme.components['app-shell'].header['app-name-color'];\n\n const secondaryColor =\n theme.components['app-shell'].header['portal-name-color'] === 'auto'\n ? tryCatch(() =>\n rgba(\n foregroundColor ?? theme.base.palette['foreground-color'],\n theme.base.transparency['transparent-2']\n )\n )\n : theme.components['app-shell'].header['portal-name-color'];\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: inline-block;\n max-width: 100%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${variant === 'secondary' ? secondaryColor : foregroundColor};\n font-family: ${theme.components.text['brand-primary']['font-family']};\n\n ${variant === 'primary' &&\n css`\n font-size: ${fontSize[theme.components.text['brand-primary']['font-size'] as FontSize]};\n font-weight: ${theme.components.text['brand-primary']['font-weight']};\n `}\n\n ${variant === 'secondary' &&\n css`\n font-size: ${fontSize[theme.components.text.secondary['font-size'] as FontSize]};\n ${stacked &&\n css`\n align-self: flex-start;\n `}\n `}\n `;\n});\n\nStyledAppHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderOperator = styled.button(\n ({ theme }) => css`\n border-radius: 50%;\n\n :focus-visible {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeader = styled.header<{ stacked: boolean; drawerOpen: boolean }>(\n ({ stacked, drawerOpen, theme }) => {\n const headerBg = theme.components['app-shell'].header.background;\n const headerFgColor = theme.components['app-shell'].header['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(headerBg, headerFgColor, theme);\n\n const hoverColors = getHoverColors(\n tryCatch(\n () => mix(0.01, theme.base.palette.interactive, headerBg),\n () => theme.base.palette.interactive\n ),\n theme.base['min-contrast']\n );\n\n return css`\n position: sticky;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n ${drawerOpen &&\n css`\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n `}\n top: var(--appshell-hard-top-offset, 0);\n gap: ${theme.base.spacing};\n max-width: 100%;\n height: ${headerHeight};\n background: ${headerBg};\n color: ${foregroundColor};\n border-bottom: solid 0.0625rem ${theme.components['app-shell'].header['border-color']};\n\n ${StyledAppHeaderInfo} {\n justify-self: flex-start;\n min-width: 33vw;\n\n ${stacked &&\n css`\n min-width: 0;\n `}\n }\n\n ${StyledSearchFiltersButton} {\n color: ${foregroundColor};\n }\n\n > ${StyledAppHeaderOperator} {\n justify-self: flex-end;\n\n + ${StyledPopover} {\n &,\n ${StyledMenuListContainer} {\n background: ${headerBg};\n }\n\n ${StyledMenuListContainer} li {\n color: ${foregroundColor};\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: ${hoverColors.foreground};\n background-color: ${hoverColors.background};\n }\n }\n }\n }\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,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CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { mix, rgba, transparentize } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n getHoverColors,\n calculateForegroundColor,\n type FontSize\n} from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledImage } from '../Image';\nimport { StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { StyledPopover } from '../Popover';\nimport { StyledSearchInput } from '../SearchInput';\nimport {\n StyledSearchButton,\n StyledSearchFiltersButton,\n StyledSearchTextInput\n} from '../SearchInput/SearchInput.styles';\nimport Text from '../Text';\nimport type { TextProps } from '../Text';\n\nimport { headerHeight, navWidth } from './AppShell.styles';\n\nexport const StyledContextSwitcher = styled.div(({ theme }) => {\n return css`\n width: calc(${navWidth} - 2 * ${theme.base.spacing});\n `;\n});\n\nStyledContextSwitcher.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderInfo = styled.div<{ centerLogo: boolean }>(({ centerLogo, theme }) => {\n return css`\n & > :first-child {\n vertical-align: top;\n }\n\n & > :is(a, button) {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n & > :is(a, button):focus-visible {\n box-shadow: ${theme.base.shadow.focus};\n outline: none;\n }\n\n ${StyledImage} {\n height: 1.0725rem;\n\n ${centerLogo &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n }\n `;\n});\n\nStyledAppHeaderInfo.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearchForm = styled.form<{\n searchDisplay?: 'icon' | 'grow' | 'fullWidth';\n}>(({ searchDisplay, theme }) => {\n const {\n base: { animation },\n components: {\n 'app-shell': { header },\n input\n }\n } = theme;\n\n const {\n background: headerBg,\n 'search-input': {\n 'background-color': searchInputBg,\n 'foreground-color': searchInputFg,\n 'border-color': searchInputBorder\n }\n } = header;\n\n const searchBg = searchInputBg;\n const searchFg = calculateForegroundColor(headerBg, searchInputFg, theme);\n const searchBorder = calculateForegroundColor(headerBg, searchInputBorder, theme);\n\n return css`\n max-width: 33vw;\n min-width: 10rem;\n width: 100%;\n justify-self: center;\n margin-inline-start: 0;\n margin-inline-end: auto;\n transition: max-width ${animation.speed} ${animation.timing.ease};\n\n ${StyledSearchInput} input::placeholder {\n color: ${transparentize(0.4, searchFg)};\n }\n\n ${searchDisplay === 'icon' &&\n css`\n max-width: ${input.height};\n min-width: ${input.height};\n width: auto;\n margin-inline-start: auto;\n margin-inline-end: 0;\n `}\n\n ${searchDisplay === 'grow' &&\n css`\n flex-grow: 1;\n max-width: 100%;\n margin-inline-end: 0;\n `}\n\n ${searchDisplay === 'fullWidth' &&\n css`\n max-width: 100%;\n margin-inline-end: 0;\n `}\n\n &:not([focused]) {\n ${StyledSearchInput} {\n background: ${searchBg};\n border-color: ${searchBorder};\n ${StyledSearchButton} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n\n ${StyledSearchTextInput} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n\n ${StyledSearchFiltersButton} {\n background: ${searchBg};\n color: ${searchFg};\n border-color: ${searchBorder};\n }\n }\n }\n `;\n});\n\nStyledAppHeaderSearchForm.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSpacer = styled.div`\n margin: auto;\n`;\n\nexport const StyledAppHeaderLogo = styled.div(({ theme }) => {\n return css`\n max-width: min(${theme.base['content-width'].sm}, 25vw);\n `;\n});\nStyledAppHeaderLogo.defaultProps = defaultThemeProp;\n\n// Shrinks the app/portal name for ellipsis truncation; stacks vertically below `md` where there's no room for both names side by side.\nexport const StyledAppHeaderName = styled.div<{ stacked?: boolean }>(\n ({ theme, stacked }) => css`\n display: flex;\n flex-direction: ${stacked ? 'column' : 'row'};\n align-items: ${stacked ? 'stretch' : 'baseline'};\n gap: ${stacked ? 0 : theme.base.spacing};\n min-width: 0;\n `\n);\nStyledAppHeaderName.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderText = styled(Text)<{\n variant: TextProps['variant'];\n stacked?: boolean;\n}>(({ theme, variant, stacked }) => {\n const headerBg = theme.components['app-shell'].header.background;\n const headerFgColor = theme.components['app-shell'].header['foreground-color'];\n\n const foregroundColor =\n theme.components['app-shell'].header['app-name-color'] === 'auto'\n ? calculateForegroundColor(headerBg, headerFgColor, theme)\n : theme.components['app-shell'].header['app-name-color'];\n\n const secondaryColor =\n theme.components['app-shell'].header['portal-name-color'] === 'auto'\n ? tryCatch(() =>\n rgba(\n foregroundColor ?? theme.base.palette['foreground-color'],\n theme.base.transparency['transparent-2']\n )\n )\n : theme.components['app-shell'].header['portal-name-color'];\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: inline-block;\n max-width: 100%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${variant === 'secondary' ? secondaryColor : foregroundColor};\n font-family: ${theme.components.text['brand-primary']['font-family']};\n\n ${variant === 'primary' &&\n css`\n font-size: ${fontSize[theme.components.text['brand-primary']['font-size'] as FontSize]};\n font-weight: ${theme.components.text['brand-primary']['font-weight']};\n `}\n\n ${variant === 'secondary' &&\n css`\n font-size: ${fontSize[theme.components.text.secondary['font-size'] as FontSize]};\n ${stacked &&\n css`\n align-self: flex-start;\n `}\n `}\n `;\n});\n\nStyledAppHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderOperator = styled.button(\n ({ theme }) => css`\n border-radius: 50%;\n\n :focus-visible {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeader = styled.header<{ stacked: boolean; drawerOpen: boolean }>(\n ({ stacked, drawerOpen, theme }) => {\n const headerBg = theme.components['app-shell'].header.background;\n const headerFgColor = theme.components['app-shell'].header['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(headerBg, headerFgColor, theme);\n\n const hoverColors = getHoverColors(\n tryCatch(\n () => mix(0.01, theme.base.palette.interactive, headerBg),\n () => theme.base.palette.interactive\n ),\n theme.base['min-contrast']\n );\n\n return css`\n position: sticky;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n ${drawerOpen &&\n css`\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n `}\n top: var(--appshell-hard-top-offset, 0);\n gap: ${theme.base.spacing};\n max-width: 100%;\n height: ${headerHeight};\n background: ${headerBg};\n color: ${foregroundColor};\n border-bottom: solid 0.0625rem ${theme.components['app-shell'].header['border-color']};\n\n ${StyledAppHeaderInfo} {\n justify-self: flex-start;\n min-width: 33vw;\n\n ${stacked &&\n css`\n min-width: 0;\n `}\n }\n\n ${StyledSearchFiltersButton} {\n color: ${foregroundColor};\n }\n\n > ${StyledAppHeaderOperator} {\n justify-self: flex-end;\n\n + ${StyledPopover} {\n &,\n ${StyledMenuListContainer} {\n background: ${headerBg};\n }\n\n ${StyledMenuListContainer} li {\n color: ${foregroundColor};\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: ${hoverColors.foreground};\n background-color: ${hoverColors.background};\n }\n }\n }\n }\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: calc(-1 * var(--appshell-hard-top-offset));\n inset-inline: 0;\n height: var(--appshell-hard-top-offset);\n background: inherit;\n }\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AppShellProps } from './AppShell.types';
|
|
2
|
-
|
|
2
|
+
import type { TouchAppShellProps } from './TouchAppShell';
|
|
3
|
+
declare const AppShellMain: import("react").ForwardRefExoticComponent<AppShellProps & Pick<TouchAppShellProps, "bottomTouchPanel"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
4
|
export default AppShellMain;
|
|
4
5
|
//# sourceMappingURL=AppShell.d.ts.map
|
|
@@ -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":"AAgDA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAQrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAmW1D,QAAA,MAAM,YAAY,yJA6LhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -11,7 +11,7 @@ import * as caretRightIcon from '../Icon/icons/caret-right.icon';
|
|
|
11
11
|
import * as sunIcon from '../Icon/icons/sun.icon';
|
|
12
12
|
import * as moonIcon from '../Icon/icons/moon.icon';
|
|
13
13
|
import * as circleMixedLeftIcon from '../Icon/icons/circle-mixed-left.icon';
|
|
14
|
-
import * as
|
|
14
|
+
import * as shareExternalIcon from '../Icon/icons/share-external.icon';
|
|
15
15
|
import { useI18n, useBreakpoint, useConsolidatedRef, useElement, useTransitionState, useEvent, useUID, usePreviewManager, useDirection } from '../../hooks';
|
|
16
16
|
import useThemeMode from '../../hooks/useThemeMode';
|
|
17
17
|
import { openCloseStates } from '../../hooks/useTransitionState';
|
|
@@ -25,7 +25,7 @@ import Tooltip from '../Tooltip';
|
|
|
25
25
|
import AppShellContext from './AppShellContext';
|
|
26
26
|
import AppHeader from './AppHeader';
|
|
27
27
|
import AppTopNav from './AppTopNav';
|
|
28
|
-
import { StyledAppMain, StyledBannerRegion, StyledAppShellToggleButton, StyledAppShellTooltip, StyledSidebarNav, AppShellGlobalStyle
|
|
28
|
+
import { StyledAppMain, StyledBannerRegion, StyledAppShellToggleButton, StyledAppShellTooltip, StyledSidebarNav, AppShellGlobalStyle } from './AppShell.styles';
|
|
29
29
|
import { followingNodes, focusRegion } from './utils';
|
|
30
30
|
import AppNavigationPanel from './AppNavigationPanel';
|
|
31
31
|
import NavigationList from './NavigationList';
|
|
@@ -33,11 +33,12 @@ import DocumentTabs, { getTabElementId, getTabPanelId } from './DocumentTabs';
|
|
|
33
33
|
import { StyledDocumentTabPanel } from './DocumentTabs.styles';
|
|
34
34
|
import TopNavDrawerProvider from './TopNavDrawerProvider';
|
|
35
35
|
import TouchAppShell from './TouchAppShell';
|
|
36
|
-
|
|
36
|
+
import { useNotificationsPopover } from './Notifications';
|
|
37
|
+
registerIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon, sunIcon, moonIcon, circleMixedLeftIcon, shareExternalIcon);
|
|
37
38
|
registerAction({ id: 'NextRegion', defaultKeyBinding: 'F9' }, { id: 'PrevRegion', defaultKeyBinding: 'Shift+F9' }, { id: 'KeyboardCommands', defaultKeyBinding: 'CommandOrControl+/' });
|
|
38
39
|
const AppShell = forwardRef(function AppShell(props, ref) {
|
|
39
40
|
const t = useI18n();
|
|
40
|
-
const { appInfo, contextSwitcher, searchInput, appHeader, searchPage, searchLabel = t('sitewide'), caseTypes, links, agent, banners, progress, main, operator, utils, headerUtils, helpMenu, cases, defaultExpanded = false, collapsedHoverMenus = false, shareApp, portalSwitcher, navOrientation = 'side-rail', documentTabs, utilsList, ...restProps } = props;
|
|
41
|
+
const { appInfo, contextSwitcher, searchInput, appHeader, searchPage, searchLabel = t('sitewide'), caseTypes, links, agent, banners, progress, main, operator, notifications, utils, headerUtils, helpMenu, cases, defaultExpanded = false, collapsedHoverMenus = false, shareApp, portalSwitcher, navOrientation = 'side-rail', documentTabs, utilsList, ...restProps } = props;
|
|
41
42
|
const skipLinks = useMemo(() => [
|
|
42
43
|
{
|
|
43
44
|
label: t('go_to_main_content'),
|
|
@@ -146,7 +147,7 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
146
147
|
headerEl,
|
|
147
148
|
searchContainerEl,
|
|
148
149
|
previewActive
|
|
149
|
-
]), children: [_jsx(SkipLinks, { items: skipLinks }), showAppHeader && (_jsx(AppHeader, { ...appInfo, contextSwitcher: contextSwitcher, searchInput: searchInput, searchLabel: searchLabel, operator: operator, headerUtils: headerUtils, helpMenu: helpMenu, searchPage: searchPage, shareApp: shareApp, portalSwitcher: portalSwitcher, ref: setHeaderEl })), isTopBar && (_jsx(TopNavDrawerProvider, { children: _jsx(AppTopNav, { appInfo: appInfo, links: links, caseTypes: caseTypes, cases: cases, agent: agent, utils: utils, searchInput: searchInput, searchPage: searchPage, searchLabel: searchLabel }) })), !isTopBar && isSmallOrAbove && (_jsxs(Flex, { ...restProps, container: {
|
|
150
|
+
]), children: [_jsx(SkipLinks, { items: skipLinks }), showAppHeader && (_jsx(AppHeader, { ...appInfo, contextSwitcher: contextSwitcher, searchInput: searchInput, searchLabel: searchLabel, operator: operator, notifications: notifications, headerUtils: headerUtils, helpMenu: helpMenu, searchPage: searchPage, shareApp: shareApp, portalSwitcher: portalSwitcher, ref: setHeaderEl })), isTopBar && (_jsx(TopNavDrawerProvider, { children: _jsx(AppTopNav, { appInfo: appInfo, links: links, caseTypes: caseTypes, cases: cases, agent: agent, utils: utils, searchInput: searchInput, searchPage: searchPage, searchLabel: searchLabel }) })), !isTopBar && isSmallOrAbove && (_jsxs(Flex, { ...restProps, container: {
|
|
150
151
|
direction: 'column',
|
|
151
152
|
justify: 'between'
|
|
152
153
|
}, id: navId, as: StyledSidebarNav, portalAgent: !!agent, ref: navRef, "data-app-region": true, onFocus: onFocus, "aria-label": t('app_shell_main_navigation_label'), children: [_jsx(AppNavigationPanel, { navState: sidebarNavState, appInfo: !showAppHeader ? appInfo : undefined, searchInput: !showAppHeader ? searchInput : undefined, searchLabel: searchLabel, caseTypes: caseTypes, links: links, cases: cases, utils: utilsList, onClick: () => {
|
|
@@ -163,12 +164,13 @@ const AppShell = forwardRef(function AppShell(props, ref) {
|
|
|
163
164
|
if (!documentTabs)
|
|
164
165
|
return mainRegion;
|
|
165
166
|
return (_jsx(StyledDocumentTabPanel, { role: 'tabpanel', id: documentTabs.currentTabId ? getTabPanelId(documentTabs.currentTabId) : undefined, "aria-labelledby": documentTabs.currentTabId ? getTabElementId(documentTabs.currentTabId) : undefined, tabIndex: 0, children: mainRegion }));
|
|
166
|
-
})()] })), _jsx(AppShellGlobalStyle, { isTopBar: isTopBar, showAppHeader: showAppHeader,
|
|
167
|
+
})()] })), _jsx(AppShellGlobalStyle, { isTopBar: isTopBar, showAppHeader: showAppHeader, isTouchDevice: false, isExtraSmallScreen: !isSmallOrAbove, hasDocumentTabs: !!documentTabs, navOpen: sidebarNavState === 'open' || sidebarNavState === 'opening' })] }));
|
|
167
168
|
});
|
|
168
169
|
const AppShellMain = forwardRef(function AppShellMain(props, ref) {
|
|
169
170
|
const t = useI18n();
|
|
171
|
+
const { start } = useDirection();
|
|
170
172
|
const navId = useUID();
|
|
171
|
-
const { appInfo, appHeader, contextSwitcher, searchPage, searchInput, searchLabel = t('sitewide'), caseTypes, links, cases, agent, utils, operator, headerUtils, helpMenu, shareApp, banners, progress, main, documentTabs, navOrientation = 'side-rail', ...restProps } = props;
|
|
173
|
+
const { appInfo, appHeader, contextSwitcher, searchPage, searchInput, searchLabel = t('sitewide'), caseTypes, links, cases, agent, utils, operator, notifications, headerUtils, helpMenu, shareApp, banners, progress, main, bottomTouchPanel, documentTabs, navOrientation = 'side-rail', ...restProps } = props;
|
|
172
174
|
const isSmallOrAbove = useBreakpoint('sm');
|
|
173
175
|
const isTopBar = navOrientation === 'top-bar' || !isSmallOrAbove;
|
|
174
176
|
const showAppHeader = isTouchDevice
|
|
@@ -198,7 +200,7 @@ const AppShellMain = forwardRef(function AppShellMain(props, ref) {
|
|
|
198
200
|
return {
|
|
199
201
|
name: shareLabel,
|
|
200
202
|
primary: shareLabel,
|
|
201
|
-
visual: _jsx(
|
|
203
|
+
visual: _jsx(Icon, { name: 'share-external' }),
|
|
202
204
|
onClick: shareApp.onClick
|
|
203
205
|
};
|
|
204
206
|
}
|
|
@@ -247,23 +249,31 @@ const AppShellMain = forwardRef(function AppShellMain(props, ref) {
|
|
|
247
249
|
};
|
|
248
250
|
}
|
|
249
251
|
}, [onThemeModeChange, showAppHeader, t, themeMode]);
|
|
252
|
+
// With the app header shown, `AppHeader` renders its own notifications button and popover.
|
|
253
|
+
const navNotifications = showAppHeader ? undefined : notifications;
|
|
254
|
+
const { toggle: toggleNotificationsPopover, popover: notificationsPopover } = useNotificationsPopover(navNotifications, start);
|
|
255
|
+
const notificationsUtilItem = useMemo(() => {
|
|
256
|
+
if (!navNotifications)
|
|
257
|
+
return;
|
|
258
|
+
const { visual, name, count } = navNotifications;
|
|
259
|
+
return { visual, name, count, onClick: e => toggleNotificationsPopover(e.currentTarget) };
|
|
260
|
+
}, [navNotifications, toggleNotificationsPopover]);
|
|
250
261
|
const utilsList = useMemo(() => [
|
|
251
262
|
...(utils ?? []),
|
|
263
|
+
...(notificationsUtilItem ? [notificationsUtilItem] : []),
|
|
252
264
|
...(contextSwitcherUtilItem ? [contextSwitcherUtilItem] : []),
|
|
253
265
|
...(shareApplicationUtilItem ? [shareApplicationUtilItem] : []),
|
|
254
266
|
...(operatorInfoUtilItem ? [operatorInfoUtilItem] : []),
|
|
255
267
|
...(themeSwitcherUtilItem ? [themeSwitcherUtilItem] : [])
|
|
256
268
|
], [
|
|
257
269
|
contextSwitcherUtilItem,
|
|
270
|
+
notificationsUtilItem,
|
|
258
271
|
operatorInfoUtilItem,
|
|
259
272
|
shareApplicationUtilItem,
|
|
260
273
|
themeSwitcherUtilItem,
|
|
261
274
|
utils
|
|
262
275
|
]);
|
|
263
|
-
|
|
264
|
-
return (_jsx(TouchAppShell, { appInfo: appInfo, appHeader: appHeader, contextSwitcher: contextSwitcher, searchPage: searchPage, searchInput: searchInput, searchLabel: searchLabel, caseTypes: caseTypes, links: links, cases: cases, agent: agent, utils: utils, utilsList: utilsList, operator: operator, headerUtils: headerUtils, helpMenu: helpMenu, shareApp: shareApp, banners: banners, progress: progress, main: main, documentTabs: documentTabs, navId: navId, restProps: restProps }));
|
|
265
|
-
}
|
|
266
|
-
return _jsx(AppShell, { ...props, utilsList: utilsList, ref: ref });
|
|
276
|
+
return (_jsxs(_Fragment, { children: [isTouchDevice ? (_jsx(TouchAppShell, { appInfo: appInfo, appHeader: appHeader, contextSwitcher: contextSwitcher, searchPage: searchPage, searchInput: searchInput, searchLabel: searchLabel, caseTypes: caseTypes, links: links, cases: cases, agent: agent, utils: utils, utilsList: utilsList, operator: operator, notifications: notifications, headerUtils: headerUtils, helpMenu: helpMenu, shareApp: shareApp, banners: banners, progress: progress, main: main, bottomTouchPanel: bottomTouchPanel, documentTabs: documentTabs, navId: navId, restProps: restProps })) : (_jsx(AppShell, { ...props, utilsList: utilsList, ref: ref })), notificationsPopover] }));
|
|
267
277
|
});
|
|
268
278
|
export default AppShellMain;
|
|
269
279
|
//# sourceMappingURL=AppShell.js.map
|