@czi-sds/components 22.3.0 → 22.3.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/dist/index.cjs.d.ts +38 -31
- package/dist/index.cjs.js +73 -41
- package/dist/index.esm.d.ts +38 -31
- package/dist/index.esm.js +74 -42
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.esm.d.ts
CHANGED
|
@@ -29,10 +29,11 @@ import { ListItemProps as RawListItemProps } from "@mui/material";
|
|
|
29
29
|
import { ListSubheaderProps as RawListSubheaderProps } from "@mui/material";
|
|
30
30
|
import { MenuProps as RawMenuProps } from "@mui/material";
|
|
31
31
|
import { ChipProps as ChipProps$0 } from "@mui/material";
|
|
32
|
+
import { LinkProps as LinkProps$1 } from "@mui/material";
|
|
32
33
|
import { TabProps as RawTabProps } from "@mui/material";
|
|
33
34
|
import { TabsProps as RawTabsProps } from "@mui/material";
|
|
34
35
|
import React from "react";
|
|
35
|
-
import { CSSProperties, ReactElement, ReactNode, SyntheticEvent, ComponentType, ElementType } from "react";
|
|
36
|
+
import { CSSProperties, ReactElement, ReactNode, SyntheticEvent, HTMLAttributeAnchorTarget, ComponentType, ElementType } from "react";
|
|
36
37
|
import { Theme, ThemeOptions, TypographyStyle, Breakpoints, PaletteOptions } from "@mui/material/styles";
|
|
37
38
|
import { SerializedStyles } from "@emotion/react";
|
|
38
39
|
import { AlertProps } from "@mui/lab";
|
|
@@ -776,9 +777,10 @@ type ButtonTypeMap = {
|
|
|
776
777
|
square: "primary" | "secondary" | "destructive";
|
|
777
778
|
};
|
|
778
779
|
type ButtonSize = "small" | "medium" | "large";
|
|
779
|
-
interface BaseButtonProps {
|
|
780
|
+
interface BaseButtonProps extends RawButtonProps {
|
|
780
781
|
children?: React.ReactNode;
|
|
781
782
|
isAllCaps?: boolean;
|
|
783
|
+
target?: HTMLAttributeAnchorTarget;
|
|
782
784
|
}
|
|
783
785
|
interface SdsIconButtonProps extends BaseButtonProps {
|
|
784
786
|
sdsStyle: "icon";
|
|
@@ -799,23 +801,11 @@ interface SdsButtonProps extends BaseButtonProps {
|
|
|
799
801
|
children: React.ReactNode;
|
|
800
802
|
}
|
|
801
803
|
type SdsProps = SdsIconButtonProps | SdsMinimalButtonProps | SdsButtonProps;
|
|
802
|
-
type ButtonProps =
|
|
804
|
+
type ButtonProps = SdsProps;
|
|
803
805
|
/**
|
|
804
806
|
* @see https://mui.com/material-ui/react-button/
|
|
805
807
|
*/
|
|
806
|
-
declare const Button: React.ForwardRefExoticComponent<(Omit<
|
|
807
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
808
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & {
|
|
809
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
810
|
-
} & SdsIconButtonProps, "ref"> | Omit<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
811
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
812
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & {
|
|
813
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
814
|
-
} & SdsMinimalButtonProps, "ref"> | Omit<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
815
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
816
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & {
|
|
817
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
818
|
-
} & SdsButtonProps, "ref">) & React.RefAttributes<HTMLButtonElement>>;
|
|
808
|
+
declare const Button: React.ForwardRefExoticComponent<(Omit<SdsIconButtonProps, "ref"> | Omit<SdsMinimalButtonProps, "ref"> | Omit<SdsButtonProps, "ref">) & React.RefAttributes<HTMLButtonElement>>;
|
|
819
809
|
interface BannerExtraProps extends CommonThemeProps {
|
|
820
810
|
sdsType: "primary" | "secondary";
|
|
821
811
|
}
|
|
@@ -846,21 +836,13 @@ type ButtonDropdownProps = ButtonProps & SdsProps$0;
|
|
|
846
836
|
/**
|
|
847
837
|
* @see https://mui.com/material-ui/react-button/
|
|
848
838
|
*/
|
|
849
|
-
declare const ButtonDropdown: React.ForwardRefExoticComponent<(Omit<
|
|
850
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
851
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & {
|
|
852
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
853
|
-
} & SdsIconButtonProps & {
|
|
839
|
+
declare const ButtonDropdown: React.ForwardRefExoticComponent<(Omit<SdsIconButtonProps & {
|
|
854
840
|
sdsStyle: "icon";
|
|
855
841
|
sdsType?: "primary" | "secondary" | "tertiary" | undefined;
|
|
856
842
|
icon: keyof IconNameToSizes | React.ReactElement<CustomSVGProps>;
|
|
857
843
|
sdsIconProps?: Partial<IconProps<keyof IconNameToSizes>> | undefined;
|
|
858
844
|
sdsSize?: SDSButtonDropdownSizes | undefined;
|
|
859
|
-
}, "ref"> | Omit<
|
|
860
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
861
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & {
|
|
862
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
863
|
-
} & SdsButtonProps & {
|
|
845
|
+
}, "ref"> | Omit<SdsButtonProps & {
|
|
864
846
|
sdsStyle: "rounded" | "square";
|
|
865
847
|
sdsType?: "primary" | "secondary" | "destructive" | undefined;
|
|
866
848
|
icon?: keyof IconNameToSizes | React.ReactElement<CustomSVGProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
@@ -1129,10 +1111,20 @@ interface ContentCardTitleProps {
|
|
|
1129
1111
|
titleText?: string;
|
|
1130
1112
|
subtitleText?: string;
|
|
1131
1113
|
metadataText?: string;
|
|
1114
|
+
classes?: {
|
|
1115
|
+
cardHeader?: string;
|
|
1116
|
+
cardOverline?: string;
|
|
1117
|
+
cardTitle?: string;
|
|
1118
|
+
cardSubtitle?: string;
|
|
1119
|
+
cardMetadata?: string;
|
|
1120
|
+
};
|
|
1132
1121
|
}
|
|
1133
1122
|
interface ContentCardActionsProps {
|
|
1134
1123
|
buttonsPosition?: "left" | "right";
|
|
1135
1124
|
clickableCard?: ContentCardProps["clickableCard"];
|
|
1125
|
+
classes?: {
|
|
1126
|
+
cardActions?: string;
|
|
1127
|
+
};
|
|
1136
1128
|
children: React.ReactElement<ButtonProps> | Array<React.ReactElement<ButtonProps>>;
|
|
1137
1129
|
}
|
|
1138
1130
|
/**
|
|
@@ -1149,7 +1141,20 @@ interface BaseContentCardProps extends CardProps {
|
|
|
1149
1141
|
decorativeBorder?: boolean;
|
|
1150
1142
|
children?: React.ReactNode;
|
|
1151
1143
|
clickableCard?: boolean;
|
|
1144
|
+
clickableCardProps?: Partial<SdsMinimalButtonProps>;
|
|
1152
1145
|
buttonsPosition?: "left" | "right";
|
|
1146
|
+
classes?: {
|
|
1147
|
+
cardPaper?: string;
|
|
1148
|
+
cardContent?: string;
|
|
1149
|
+
cardHeader?: string;
|
|
1150
|
+
cardMedia?: string;
|
|
1151
|
+
cardOverline?: string;
|
|
1152
|
+
cardTitle?: string;
|
|
1153
|
+
cardSubtitle?: string;
|
|
1154
|
+
cardMetadata?: string;
|
|
1155
|
+
cardActions?: string;
|
|
1156
|
+
clickableCardButton?: string;
|
|
1157
|
+
};
|
|
1153
1158
|
}
|
|
1154
1159
|
interface ImageContentCardProps extends BaseContentCardProps {
|
|
1155
1160
|
visualElementType: "image";
|
|
@@ -1486,16 +1491,16 @@ interface NavigationHeaderPrimaryNavItem<T extends string> extends Record<string
|
|
|
1486
1491
|
tagColor?: SdsTagColorType;
|
|
1487
1492
|
onClick?: (e: React.SyntheticEvent) => void;
|
|
1488
1493
|
}
|
|
1489
|
-
interface BaseHeaderSecondaryNavItem {
|
|
1494
|
+
interface BaseHeaderSecondaryNavItem extends Partial<SdsMinimalButtonProps> {
|
|
1490
1495
|
label: string;
|
|
1491
1496
|
}
|
|
1492
1497
|
interface TextHeaderSecondaryNavItem extends BaseHeaderSecondaryNavItem {
|
|
1493
1498
|
onClick?(): void;
|
|
1494
|
-
|
|
1499
|
+
itemType: "text";
|
|
1495
1500
|
}
|
|
1496
1501
|
interface DropdownHeaderSecondaryNavItem extends BaseHeaderSecondaryNavItem {
|
|
1497
|
-
|
|
1498
|
-
items: Pick<TextHeaderSecondaryNavItem, "label" | "onClick">[];
|
|
1502
|
+
itemType: "dropdown";
|
|
1503
|
+
items: Pick<TextHeaderSecondaryNavItem, "label" | "onClick" | "component" | "href">[];
|
|
1499
1504
|
}
|
|
1500
1505
|
type NavigationHeaderSecondaryNavItem = TextHeaderSecondaryNavItem | DropdownHeaderSecondaryNavItem;
|
|
1501
1506
|
interface NavigationHeaderProps<T extends string = string> {
|
|
@@ -1504,6 +1509,8 @@ interface NavigationHeaderProps<T extends string = string> {
|
|
|
1504
1509
|
hasInvertedStyle?: boolean;
|
|
1505
1510
|
logo?: ReactNode;
|
|
1506
1511
|
logoUrl?: string;
|
|
1512
|
+
logoLinkComponent?: ElementType;
|
|
1513
|
+
logoLinkProps?: LinkProps$1;
|
|
1507
1514
|
primaryNavItems?: NavigationHeaderPrimaryNavItem<T>[];
|
|
1508
1515
|
primaryNavPosition?: "left" | "right";
|
|
1509
1516
|
searchProps?: Partial<InputSearchProps>;
|
|
@@ -1682,4 +1689,4 @@ type TooltipTableContentProps = TooltipTableExtraProps;
|
|
|
1682
1689
|
*/
|
|
1683
1690
|
declare const TooltipTableContent: (props: TooltipTableContentProps) => JSX.Element;
|
|
1684
1691
|
export { AccordionDetails, AccordionHeader, AccordionProps, Accordion, Alert, AutocompleteSingleColumnOption, AutocompleteMultiColumnOption, SDSAutocompleteOptions, AutocompleteMultiColumnValue, AutocompleteSingleColumnValue, SDSAutocompleteValue, AutocompleteSingleColumnOnChange, AutocompleteMultiColumnOnChange, SDSAutocompleteOnChange, AutocompleteProps, StyledPopper as AutocompleteMultiColumnStyledPopper, StyledPaper$0 as AutocompleteSingleColumnStyledPaper, Autocomplete$0 as Autocomplete, BannerProps, Banner, SdsIconButtonProps, SdsMinimalButtonProps, SdsButtonProps, SdsProps, ButtonProps, Button, ButtonDropdownProps, ButtonDropdown, ButtonIconInternalProps, ButtonIconProps, ButtonIcon, ButtonToggleProps, ButtonToggle, CalloutIntentType, CalloutSdsStyleType, CalloutProps, ExposedCalloutProps, Callout, CalloutTitle, CellBasicRawProps, CellBasicProps, CellBasic, CellComponentProps, CellComponent, CellHeaderDirection, CellHeaderProps, CellHeader, Chip, InputDropdown as ComplexFilterInputDropdown, InputDropdown as DropdownInputDropdown, InputDropdown, StyledPopper$1 as ComplexFilterPopper, StyledPopper$1 as DropdownPopper, ComplexFilterProps, ComplexFilter, ContentCardActions, StyledContentCardBody as ContentCardBody, CardMedia as ContentCardMedia, ContentCard, DialogContext, DialogProps, Dialog, DialogActionsProps, DialogActions, DialogContentProps, _default, _default as DialogContent, DialogPaperProps, DialogPaper, Subtitle$0 as DialogTitleSubtitle, Title as DialogTitleTitle, Overline as DialogTitleOverline, DialogTitleProps, DialogTitle, StyledPaper$1 as DropdownPaper, ExtraDropdownProps, DropdownProps, Dropdown, DefaultDropdownMenuOption, MINIMUM_DROPDOWN_MENU_POPPER_WIDTH, DropdownMenuProps, DropdownMenu, SdsIconWithColor$0 as SdsIconWithColor, IconProps, Icon, CheckboxProps, InputCheckbox, InputDropdownProps$0 as InputDropdownProps, RadioContentProps, RadioProps, InputRadio, AccessibleInputSearchProps, InputSearchProps, InputSearch, InputSliderProps, InputSlider, InputTextProps, InputText, InputToggle, LinkProps$0 as LinkProps, Link, ListProps, List, ListItemLabel, ListItemProps, ListItem, ListSubheaderProps, ListSubheader, LoadingIndicatorProps$0 as LoadingIndicatorProps, LoadingIndicator, MenuProps, Menu, IconNameToSmallSizes, MenuItemExtraProps, MenuItemProps, MenuItem, DefaultMenuSelectOption, MenuSelectProps, MenuSelect, NavigationFooterNavItem, FooterImage, NavigationFooterProps, NavItemProps, FooterLinkProps, NavigationFooter, NavigationHeaderProps, IconButtonProps, NavigationHeader, NavigationJumpToProps, NavigationJumpTo, NotificationIntentType, NotificationProps, ExposedNotificationProps, Notification, PaginationInternalProps, PaginationProps, Pagination, Panel, SingleButtonDefinition, SegmentedControlProps, SegmentedControl, SdsTableProps, TableProps, Table, TableHeaderProps, TableHeader, TableRowProps, TableRow, Tabs, TabProps$0 as TabProps, Tab, SdsTagProps, TagProps, Tag, SdsTagFilterProps, TagFilterProps, TagFilter, Tooltip, TooltipCondensedProps, TooltipCondensed, TooltipTableContent, TooltipTableContent as TooltipTable, AccentColor, BaseColor, IntentColor, SDSPalette, SDSTheme, SDSThemeOptions, AppTheme, Shadows, TypographyStyles, Typography, FontWeights, Corners, Spaces, Spacings, Color, Colors, IconSize, IconSizes, Border, Borders, Theme$0 as Theme, defaultTheme, makeSdsSemanticAppTheme, SDSLightAppTheme, SDSDarkAppTheme, SDSChooseTheme, defaultAppTheme, SDSPaletteLight, SDSPaletteDark, makeThemeOptions, focusVisibleA11yStyle, fontBody, fontBodyL, fontBodyM, fontBodyS, fontBodyXs, fontBodyXxs, fontBodyXxxs, fontBodySemiboldL, fontBodySemiboldM, fontBodySemiboldS, fontBodySemiboldXs, fontBodySemiboldXxs, fontBodySemiboldXxxs, fontCaps, fontCapsXxs, fontCapsXxxs, fontCapsXxxxs, fontHeader, fontHeaderXxl, fontHeaderXl, fontHeaderL, fontHeaderM, fontHeaderS, fontHeaderXs, fontHeaderXxs, fontHeaderXxxs, fontCode, fontCodeXs, fontCodeS, fontCodeSemiboldXs, fontCodeSemiboldS, fontTabular, fontTabularXs, fontTabularS, fontTabularSemiboldXs, fontTabularSemiboldS, CommonThemeProps, getSpaces, getSpacings, getTypography, getMode, getPalette, getColors, getSemanticColors, getShadows, getCorners, getFontWeights, getIconSizes, getBorders, getBreakpoints };
|
|
1685
|
-
export type { AutocompleteBaseProps, AutocompleteMultiColumnProps, AutocompleteOptionBasic, AutocompleteOptionComponent, DefaultAutocompleteOption, ChipProps, ContentCardProps, CardMediaProps as ContentCardMediaProps, ContentCardActionsProps, ContentCardTitleProps, IconNameToSizes, InputToggleExtraProps as InputToggleProps, PanelProps, BasicPanelProps, OverlayPanelProps, TabsProps$0 as TabsProps, SdsTagColorType, TooltipProps, TooltipTableContentProps };
|
|
1692
|
+
export type { AutocompleteBaseProps, AutocompleteMultiColumnProps, AutocompleteOptionBasic, AutocompleteOptionComponent, DefaultAutocompleteOption, ChipProps, ContentCardProps, CardMediaProps as ContentCardMediaProps, ContentCardActionsProps, ContentCardTitleProps, IconNameToSizes, InputToggleExtraProps as InputToggleProps, NavigationHeaderSecondaryNavItem, PanelProps, BasicPanelProps, OverlayPanelProps, TabsProps$0 as TabsProps, SdsTagColorType, TooltipProps, TooltipTableContentProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { forwardRef, useEffect, useRef, useState, useCallback, createElement, useMemo, createContext, memo, Fragment as Fragment$1, useContext } from 'react';
|
|
5
5
|
import { css, ThemeContext as ThemeContext$1 } from '@emotion/react';
|
|
6
|
-
import { createTheme as createTheme$2, AccordionDetails as AccordionDetails$1, AccordionSummary, accordionSummaryClasses, SvgIcon, Accordion as Accordion$1, accordionClasses, accordionDetailsClasses, Alert as Alert$2, Button as Button$1, buttonClasses, IconButton, TextField, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, useTheme as useTheme$4, Popper, ClickAwayListener, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, Chip as Chip$1, darken as darken$1, Card,
|
|
6
|
+
import { createTheme as createTheme$2, AccordionDetails as AccordionDetails$1, AccordionSummary, accordionSummaryClasses, SvgIcon, Accordion as Accordion$1, accordionClasses, accordionDetailsClasses, Alert as Alert$2, Button as Button$1, buttonClasses, IconButton, TextField, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, useTheme as useTheme$4, Popper, ClickAwayListener, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, Chip as Chip$1, darken as darken$1, Card, CardContent, styled as styled$3, CardActions, css as css$2, CardMedia, Dialog as Dialog$1, DialogActions as DialogActions$1, dialogActionsClasses, DialogContent, DialogTitle as DialogTitle$1, Typography, Checkbox, checkboxClasses, FormControlLabel, Radio, radioClasses, Slider, sliderClasses, Switch, switchClasses, Link as Link$1, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Menu as Menu$1, menuClasses, Divider, useMediaQuery, AppBar, Toolbar, Drawer, Tabs as Tabs$1, tabsClasses, Tab as Tab$1, Slide, Box as Box$1, drawerClasses, ToggleButtonGroup, toggleButtonClasses, ToggleButton, TableCell, TableContainer, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
|
|
7
7
|
export { CardMedia as ContentCardMedia } from '@mui/material';
|
|
8
8
|
import styled$2 from '@emotion/styled';
|
|
9
9
|
import { Check, Remove, Clear } from '@mui/icons-material';
|
|
@@ -6878,6 +6878,9 @@ var doNotForwardProps$o = [
|
|
|
6878
6878
|
"buttonsPosition",
|
|
6879
6879
|
"clickableCard",
|
|
6880
6880
|
"imageSize",
|
|
6881
|
+
"clickableCardProps",
|
|
6882
|
+
"cardSdsType",
|
|
6883
|
+
"classes",
|
|
6881
6884
|
];
|
|
6882
6885
|
var StyledCard = styled$2(Card, {
|
|
6883
6886
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6895,24 +6898,25 @@ var StyledCard = styled$2(Card, {
|
|
|
6895
6898
|
var showDecorativeBorder = visualElementType === "image"
|
|
6896
6899
|
? boundingBox && decorativeBorder && imagePadding
|
|
6897
6900
|
: boundingBox && decorativeBorder;
|
|
6898
|
-
return css(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "], ["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), (_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, flexDirection, boundingBox && css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n border: 1px solid ", ";\n "], ["\n border: 1px solid ", ";\n "])), (_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.borderSecondary), sdsType === "wide" &&
|
|
6901
|
+
return css(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n overflow: visible;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "], ["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n overflow: visible;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), (_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, flexDirection, boundingBox && css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n border: 1px solid ", ";\n "], ["\n border: 1px solid ", ";\n "])), (_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.borderSecondary), sdsType === "wide" &&
|
|
6899
6902
|
showDecorativeBorder && css(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n border-left: 4px solid ", ";\n "], ["\n border-left: 4px solid ", ";\n "])), (_c = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.accent) === null || _c === void 0 ? void 0 : _c.border), sdsType === "narrow" &&
|
|
6900
6903
|
showDecorativeBorder && css(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n border-top: 4px solid ", ";\n "], ["\n border-top: 4px solid ", ";\n "])), (_d = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.accent) === null || _d === void 0 ? void 0 : _d.border));
|
|
6901
6904
|
});
|
|
6902
|
-
var StyledCardActionArea = styled$2(
|
|
6905
|
+
var StyledCardActionArea = styled$2(Button, {
|
|
6903
6906
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
6904
6907
|
})(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6905
6908
|
var _a, _b;
|
|
6906
|
-
var _c = props.imagePosition, imagePosition = _c === void 0 ? "left" : _c, _d = props.
|
|
6909
|
+
var _c = props.imagePosition, imagePosition = _c === void 0 ? "left" : _c, _d = props.cardSdsType, cardSdsType = _d === void 0 ? "wide" : _d, visualElementType = props.visualElementType;
|
|
6907
6910
|
var semanticColors = getSemanticColors(props);
|
|
6908
|
-
var
|
|
6911
|
+
var shadows = getShadows(props);
|
|
6912
|
+
var flexDirection = cardSdsType === "wide"
|
|
6909
6913
|
? imagePosition === "left"
|
|
6910
6914
|
? "row"
|
|
6911
6915
|
: "row-reverse"
|
|
6912
6916
|
: visualElementType === "image"
|
|
6913
6917
|
? "column"
|
|
6914
6918
|
: "row";
|
|
6915
|
-
return "\n display: flex;\n flex-direction: ".concat(flexDirection, ";\n align-items: unset;\n\n background-color: ").concat((_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, ";\n\n &:hover,\n &:active {\n background-color: ").concat((_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.
|
|
6919
|
+
return "\n display: flex;\n flex-direction: ".concat(flexDirection, ";\n align-items: unset;\n height: 100%;\n padding: 0;\n margin: 0;\n overflow: auto;\n text-align: unset;\n\n background-color: ").concat((_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, ";\n\n &:hover,\n &:active {\n background-color: ").concat((_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.surface, ";\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.l, " !important;\n }\n ");
|
|
6916
6920
|
});
|
|
6917
6921
|
var StyledIconMediaWrapper = styled$2("div", {
|
|
6918
6922
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6925,9 +6929,9 @@ var StyledIconMediaWrapper = styled$2("div", {
|
|
|
6925
6929
|
var StyledCardContent = styled$2("div", {
|
|
6926
6930
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
6927
6931
|
})(templateObject_13$2 || (templateObject_13$2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6928
|
-
var _a = props.boundingBox, boundingBox = _a === void 0 ? true : _a
|
|
6932
|
+
var _a = props.boundingBox, boundingBox = _a === void 0 ? true : _a;
|
|
6929
6933
|
var spaces = getSpaces(props);
|
|
6930
|
-
return css(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n
|
|
6934
|
+
return css(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-width: 100px;\n width: 100%;\n height: 100%;\n\n ", "\n "], ["\n display: flex;\n flex-direction: column;\n min-width: 100px;\n width: 100%;\n height: 100%;\n\n ", "\n "])), boundingBox && css(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject(["\n padding: ", "px;\n "], ["\n padding: ", "px;\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.xl));
|
|
6931
6935
|
});
|
|
6932
6936
|
var StyledContentCardBody = styled$2(CardContent, {
|
|
6933
6937
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6992,8 +6996,9 @@ var templateObject_1$H, templateObject_2$q, templateObject_3$i, templateObject_4
|
|
|
6992
6996
|
* @see https://mui.com/material-ui/react-dialog/
|
|
6993
6997
|
*/
|
|
6994
6998
|
var ContentCardTitle = forwardRef(function ContentCardTitle(props, ref) {
|
|
6995
|
-
var overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText;
|
|
6996
|
-
|
|
6999
|
+
var overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _a = props.classes, classes = _a === void 0 ? EMPTY_OBJECT : _a;
|
|
7000
|
+
var cardHeader = classes.cardHeader, cardOverline = classes.cardOverline, cardTitle = classes.cardTitle, cardSubtitle = classes.cardSubtitle, cardMetadata = classes.cardMetadata;
|
|
7001
|
+
return (jsxs("div", { ref: ref, children: [jsxs(StyledTitleWrapper, { className: cardHeader, children: [overlineText && (jsx(StyledOverlineText, { className: cardOverline, children: overlineText })), titleText && (jsx(StyledTitleText, { className: cardTitle, children: titleText })), subtitleText && (jsx(StyledSubtitleText, { className: cardSubtitle, children: subtitleText }))] }), metadataText && (jsx(StyledMetadataText, { className: cardMetadata, children: metadataText }))] }));
|
|
6997
7002
|
});
|
|
6998
7003
|
|
|
6999
7004
|
var doNotForwardProps$m = ["buttonsPosition"];
|
|
@@ -7019,7 +7024,8 @@ var isButtonElement = function (child) {
|
|
|
7019
7024
|
* @see https://mui.com/material-ui/api/card-actions/
|
|
7020
7025
|
*/
|
|
7021
7026
|
var ContentCardActions = forwardRef(function ContentCardActions(props, ref) {
|
|
7022
|
-
var buttonsPosition = props.buttonsPosition, clickableCard = props.clickableCard, children = props.children;
|
|
7027
|
+
var buttonsPosition = props.buttonsPosition, clickableCard = props.clickableCard, children = props.children, _a = props.classes, classes = _a === void 0 ? EMPTY_OBJECT : _a;
|
|
7028
|
+
var cardActions = classes.cardActions;
|
|
7023
7029
|
/**
|
|
7024
7030
|
* (masoudmanson):
|
|
7025
7031
|
* We need to ensure that only SDS buttons are used within the
|
|
@@ -7047,11 +7053,11 @@ var ContentCardActions = forwardRef(function ContentCardActions(props, ref) {
|
|
|
7047
7053
|
if (!clickableCardButton) {
|
|
7048
7054
|
return null;
|
|
7049
7055
|
}
|
|
7050
|
-
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, children: [
|
|
7051
|
-
React__default.cloneElement(clickableCardButton, __assign({ component: "
|
|
7056
|
+
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, className: cardActions, children: [
|
|
7057
|
+
React__default.cloneElement(clickableCardButton, __assign({ component: "div" }, clickableCardButton === null || clickableCardButton === void 0 ? void 0 : clickableCardButton.props)),
|
|
7052
7058
|
] }));
|
|
7053
7059
|
}
|
|
7054
|
-
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, children: validChildren }));
|
|
7060
|
+
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, className: cardActions, children: validChildren }));
|
|
7055
7061
|
});
|
|
7056
7062
|
|
|
7057
7063
|
var doNotForwardProps$l = [
|
|
@@ -7085,7 +7091,7 @@ var templateObject_1$F, templateObject_2$p, templateObject_3$h, templateObject_4
|
|
|
7085
7091
|
* @see https://mui.com/material-ui/api/card-media/
|
|
7086
7092
|
*/
|
|
7087
7093
|
var ContentCardImageMedia = forwardRef(function ContentCardImageMedia(props, ref) {
|
|
7088
|
-
var image = props.image, imageSize = props.imageSize, sdsType = props.sdsType;
|
|
7094
|
+
var image = props.image, imageSize = props.imageSize, sdsType = props.sdsType, className = props.className;
|
|
7089
7095
|
/**
|
|
7090
7096
|
* (masoudmanson): These styles makes the image responsive and
|
|
7091
7097
|
* ensures the image is the right aspect ratio in different card sizes.
|
|
@@ -7102,12 +7108,16 @@ var ContentCardImageMedia = forwardRef(function ContentCardImageMedia(props, ref
|
|
|
7102
7108
|
* (masoudmanson): We need to make sure the image is wrapped in a CardMedia component.
|
|
7103
7109
|
* - If it's a string, wrap it in CardMedia with proper styles.
|
|
7104
7110
|
* - If it's already a CardMedia component, clone it and apply the styles.
|
|
7111
|
+
* - If it's a valid element, clone it and apply the styles.
|
|
7112
|
+
* - If it's null, return null.
|
|
7105
7113
|
*/
|
|
7106
7114
|
var imageElement = typeof image === "string" ? (jsx(CardMedia, { component: "img", src: image, alt: "Content Card Media", sx: __assign({}, imageMediaStyles) })) : React__default.isValidElement(image) && image.type === CardMedia ? (React__default.cloneElement(image, {
|
|
7107
7115
|
component: "img",
|
|
7108
7116
|
sx: __assign(__assign({}, image.props.sx), imageMediaStyles),
|
|
7117
|
+
})) : React__default.isValidElement(image) ? (React__default.cloneElement(image, {
|
|
7118
|
+
style: __assign(__assign({}, imageMediaStyles), { objectFit: "cover", objectPosition: "center" }),
|
|
7109
7119
|
})) : null;
|
|
7110
|
-
return (jsx(StyledImageMediaWrapper, __assign({ ref: ref }, props, { children: imageElement })));
|
|
7120
|
+
return (jsx(StyledImageMediaWrapper, __assign({ ref: ref }, props, { className: className, children: imageElement })));
|
|
7111
7121
|
});
|
|
7112
7122
|
|
|
7113
7123
|
var CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE = 300;
|
|
@@ -7135,10 +7145,10 @@ var useResponsiveWidth = function (initialSdsType) {
|
|
|
7135
7145
|
* (masoudmanson): This function is used to add the clickableCard and
|
|
7136
7146
|
* buttonsPosition props to the ContentCardActions sub-component.
|
|
7137
7147
|
*/
|
|
7138
|
-
var enhanceChildrenWithCardActionsProps = function (children, clickableCard, buttonsPosition) {
|
|
7148
|
+
var enhanceChildrenWithCardActionsProps = function (children, clickableCard, buttonsPosition, classes) {
|
|
7139
7149
|
return React__default.Children.map(children, function (child) {
|
|
7140
7150
|
if (React__default.isValidElement(child) && child.type === ContentCardActions) {
|
|
7141
|
-
return React__default.cloneElement(child, __assign(__assign({}, child.props), { buttonsPosition: buttonsPosition, clickableCard: clickableCard }));
|
|
7151
|
+
return React__default.cloneElement(child, __assign(__assign({}, child.props), { buttonsPosition: buttonsPosition, classes: classes, clickableCard: clickableCard }));
|
|
7142
7152
|
}
|
|
7143
7153
|
return child;
|
|
7144
7154
|
});
|
|
@@ -7147,11 +7157,12 @@ var enhanceChildrenWithCardActionsProps = function (children, clickableCard, but
|
|
|
7147
7157
|
* @see https://mui.com/material-ui/react-card/
|
|
7148
7158
|
*/
|
|
7149
7159
|
var ContentCard = React__default.forwardRef(function (props, ref) {
|
|
7150
|
-
var _a = props.visualElementType, visualElementType = _a === void 0 ? "none" : _a, image = props.image, icon = props.icon, _b = props.imagePadding, imagePadding = _b === void 0 ? false : _b, _c = props.imageSize, imageSize = _c === void 0 ? CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE : _c, overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _d = props.boundingBox, propsBoundingBox = _d === void 0 ? true : _d, children = props.children, _e = props.sdsType, sdsType = _e === void 0 ? "wide" : _e, _f = props.clickableCard, clickableCard = _f === void 0 ? false : _f, _g = props.imagePosition, imagePosition = _g === void 0 ? "left" : _g, _h = props.buttonsPosition, buttonsPosition = _h === void 0 ? "left" : _h;
|
|
7160
|
+
var _a = props.visualElementType, visualElementType = _a === void 0 ? "none" : _a, image = props.image, icon = props.icon, _b = props.imagePadding, imagePadding = _b === void 0 ? false : _b, _c = props.imageSize, imageSize = _c === void 0 ? CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE : _c, overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _d = props.boundingBox, propsBoundingBox = _d === void 0 ? true : _d, children = props.children, _e = props.sdsType, sdsType = _e === void 0 ? "wide" : _e, _f = props.clickableCard, clickableCard = _f === void 0 ? false : _f, _g = props.imagePosition, imagePosition = _g === void 0 ? "left" : _g, _h = props.buttonsPosition, buttonsPosition = _h === void 0 ? "left" : _h, clickableCardProps = props.clickableCardProps, _j = props.classes, classes = _j === void 0 ? EMPTY_OBJECT : _j;
|
|
7161
|
+
var cardMedia = classes.cardMedia, cardContent = classes.cardContent, cardHeader = classes.cardHeader, cardMetadata = classes.cardMetadata, cardOverline = classes.cardOverline, cardSubtitle = classes.cardSubtitle, cardTitle = classes.cardTitle, cardActions = classes.cardActions, cardPaper = classes.cardPaper, clickableCardButton = classes.clickableCardButton;
|
|
7151
7162
|
// Force boundingBox to be true when clickableCard is true
|
|
7152
7163
|
var boundingBox = clickableCard ? true : propsBoundingBox;
|
|
7153
7164
|
var cardRef = useRef(null);
|
|
7154
|
-
var
|
|
7165
|
+
var _k = useResponsiveWidth(sdsType), handleResize = _k.handleResize, dynamicSdsType = _k.dynamicSdsType;
|
|
7155
7166
|
useEffect(function () {
|
|
7156
7167
|
var element = cardRef.current;
|
|
7157
7168
|
if (!element)
|
|
@@ -7167,9 +7178,21 @@ var ContentCard = React__default.forwardRef(function (props, ref) {
|
|
|
7167
7178
|
resizeObserver.disconnect();
|
|
7168
7179
|
};
|
|
7169
7180
|
}, [handleResize]);
|
|
7170
|
-
var visualElement = visualElementType === "image" && image ? (jsx(ContentCardImageMedia, { imagePadding: imagePadding, boundingBox: boundingBox, sdsType: dynamicSdsType, imageSize: imageSize, image: image, imagePosition: imagePosition })) : visualElementType === "icon" && icon ? (jsx(StyledIconMediaWrapper, { boundingBox: boundingBox, children: icon })) : null;
|
|
7171
|
-
var cardInnerContent = (jsxs(Fragment, { children: [visualElement, jsxs(StyledCardContent, { boundingBox: boundingBox, clickableCard: clickableCard, children: [jsx(ContentCardTitle, { overlineText: overlineText, titleText: titleText, subtitleText: subtitleText, metadataText: metadataText
|
|
7172
|
-
|
|
7181
|
+
var visualElement = visualElementType === "image" && image ? (jsx(ContentCardImageMedia, { imagePadding: imagePadding, boundingBox: boundingBox, sdsType: dynamicSdsType, imageSize: imageSize, image: image, imagePosition: imagePosition, className: cardMedia })) : visualElementType === "icon" && icon ? (jsx(StyledIconMediaWrapper, { boundingBox: boundingBox, className: cardMedia, children: icon })) : null;
|
|
7182
|
+
var cardInnerContent = (jsxs(Fragment, { children: [visualElement, jsxs(StyledCardContent, { boundingBox: boundingBox, clickableCard: clickableCard, className: cardContent, children: [jsx(ContentCardTitle, { overlineText: overlineText, titleText: titleText, subtitleText: subtitleText, metadataText: metadataText, classes: {
|
|
7183
|
+
cardHeader: cardHeader,
|
|
7184
|
+
cardMetadata: cardMetadata,
|
|
7185
|
+
cardOverline: cardOverline,
|
|
7186
|
+
cardSubtitle: cardSubtitle,
|
|
7187
|
+
cardTitle: cardTitle,
|
|
7188
|
+
} }), jsx(StyledCardContentAligner, { children: enhanceChildrenWithCardActionsProps(children, clickableCard, buttonsPosition, {
|
|
7189
|
+
cardActions: cardActions,
|
|
7190
|
+
}) })] })] }));
|
|
7191
|
+
return (jsx(StyledCard, __assign({ ref: mergeRefs([ref, cardRef]) }, props, { sdsType: dynamicSdsType, boundingBox: boundingBox, className: cardPaper, children: clickableCard ? (jsx(StyledCardActionArea, __assign({}, clickableCardProps, {
|
|
7192
|
+
// (masoudmanson): The following props are for internal use only and should not be user editable.
|
|
7193
|
+
// To prevent users from overriding them, we use the spread operator to pass user provided props
|
|
7194
|
+
// to the StyledCardActionArea component on top while hardcoding the rest after it.
|
|
7195
|
+
sdsStyle: "minimal", cardSdsType: dynamicSdsType, visualElementType: visualElementType, imagePosition: imagePosition, className: clickableCardButton, children: cardInnerContent }))) : (cardInnerContent) })));
|
|
7173
7196
|
});
|
|
7174
7197
|
|
|
7175
7198
|
var DialogContext = createContext({ sdsSize: "m" });
|
|
@@ -14273,6 +14296,8 @@ var doNotForwardProps$9 = [
|
|
|
14273
14296
|
"isNarrow",
|
|
14274
14297
|
"primaryNavPosition",
|
|
14275
14298
|
"showSearch",
|
|
14299
|
+
"logoLinkComponent",
|
|
14300
|
+
"logoLinkProps",
|
|
14276
14301
|
];
|
|
14277
14302
|
var StyledHeader = styled$2(AppBar, {
|
|
14278
14303
|
shouldForwardProp: function (prop) { return !doNotForwardProps$9.includes(prop); },
|
|
@@ -14519,7 +14544,7 @@ var NarrowStyledTextItem = function (props) {
|
|
|
14519
14544
|
};
|
|
14520
14545
|
var StyledTextItem = styled$2(Button, {
|
|
14521
14546
|
shouldForwardProp: function (prop) { return !ButtonDoNotForwardProps.includes(prop); },
|
|
14522
|
-
})(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width:
|
|
14547
|
+
})(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width: fit-content;\n min-width: unset;\n\n ", "\n"], ["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width: fit-content;\n min-width: unset;\n\n ", "\n"])), fontHeaderS, function (props) {
|
|
14523
14548
|
var _a, _b;
|
|
14524
14549
|
var hasInvertedStyle = props.hasInvertedStyle, open = props.open, isNarrow = props.isNarrow;
|
|
14525
14550
|
var semanticColors = getSemanticColors(props);
|
|
@@ -14545,7 +14570,7 @@ var StyledTextItem = styled$2(Button, {
|
|
|
14545
14570
|
var doNotForwardProps$6 = ["hasInvertedStyle", "isNarrow"];
|
|
14546
14571
|
var StyledAccordion = styled$2(Accordion, {
|
|
14547
14572
|
shouldForwardProp: function (prop) { return !doNotForwardProps$6.includes(prop); },
|
|
14548
|
-
})(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n width:
|
|
14573
|
+
})(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n width: fit-content;\n min-width: unset;\n\n .MuiAccordionDetails-root .MuiButtonBase-root .primary-text {\n ", "\n }\n\n ", "\n"], ["\n width: fit-content;\n min-width: unset;\n\n .MuiAccordionDetails-root .MuiButtonBase-root .primary-text {\n ", "\n }\n\n ", "\n"])), fontBodyS$1, function (props) {
|
|
14549
14574
|
var _a, _b;
|
|
14550
14575
|
var hasInvertedStyle = props.hasInvertedStyle, isNarrow = props.isNarrow;
|
|
14551
14576
|
var spaces = getSpaces(props);
|
|
@@ -14579,7 +14604,7 @@ var StyledSubItem = styled$2(MenuItem)(templateObject_7 || (templateObject_7 = _
|
|
|
14579
14604
|
var templateObject_1$g, templateObject_2$9, templateObject_3$4, templateObject_4$3, templateObject_5$2, templateObject_6$1, templateObject_7;
|
|
14580
14605
|
|
|
14581
14606
|
function SecondaryNavItem(_a) {
|
|
14582
|
-
var item = _a.item, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow;
|
|
14607
|
+
var item = _a.item, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow, rest = __rest(_a, ["item", "hasInvertedStyle", "isNarrow"]);
|
|
14583
14608
|
var _b = useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
14584
14609
|
var open = Boolean(anchorEl);
|
|
14585
14610
|
function onClose() {
|
|
@@ -14594,32 +14619,39 @@ function SecondaryNavItem(_a) {
|
|
|
14594
14619
|
}
|
|
14595
14620
|
setMenuWidth(button.offsetWidth);
|
|
14596
14621
|
}, []);
|
|
14597
|
-
return (jsxs(Fragment$1, { children: [item.
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14603
|
-
|
|
14604
|
-
|
|
14605
|
-
|
|
14622
|
+
return (jsxs(Fragment$1, { children: [item.itemType === "text" && (jsx(StyledTextItem, __assign({ sdsStyle: "minimal", onClick: item.onClick, hasInvertedStyle: hasInvertedStyle, open: open, isNarrow: isNarrow }, rest, { children: item.label }))), item.itemType === "dropdown" && !isNarrow && (jsxs(Fragment, { children: [jsxs(StyledTextItem, { sdsStyle: "minimal", ref: buttonRef, onClick: function (event) { return setAnchorEl(event.currentTarget); }, hasInvertedStyle: hasInvertedStyle, open: open, isNarrow: isNarrow, children: [jsx("span", { children: item.label }), jsx(Icon, { sdsIcon: open ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] }), jsx(Menu, { anchorEl: anchorEl, open: open, onClose: onClose, children: item.items.map(function (subItem) {
|
|
14623
|
+
var label = subItem.label, onClick = subItem.onClick, subItemRest = __rest(subItem, ["label", "onClick"]);
|
|
14624
|
+
return (jsx(MenuItem, __assign({ onClick: function () {
|
|
14625
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14626
|
+
onClose();
|
|
14627
|
+
} }, subItemRest, { children: label }), label));
|
|
14628
|
+
}) })] })), item.itemType === "dropdown" && isNarrow && (jsxs(StyledAccordion, { id: "".concat(item.label, "-dropdown"), hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, children: [jsx(AccordionHeader, { children: item.label }), jsx(AccordionDetails, { children: item.items.map(function (subItem) {
|
|
14629
|
+
var label = subItem.label, onClick = subItem.onClick, accordionSubItemRest = __rest(subItem, ["label", "onClick"]);
|
|
14630
|
+
return (jsx(StyledSubItem, __assign({ onClick: function () {
|
|
14631
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14632
|
+
onClose();
|
|
14633
|
+
}, sx: { width: menuWidth } }, accordionSubItemRest, { children: label }), label));
|
|
14634
|
+
}) })] }))] }, item.label));
|
|
14606
14635
|
}
|
|
14607
14636
|
function NavigationHeaderSecondaryNav(_a) {
|
|
14608
14637
|
var items = _a.items, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow;
|
|
14609
|
-
return (jsx(StyledSection, { gap: "l", isNarrow: isNarrow, children: items.map(function (item) {
|
|
14638
|
+
return (jsx(StyledSection, { gap: "l", isNarrow: isNarrow, children: items.map(function (item) {
|
|
14639
|
+
var itemType = item.itemType, label = item.label, rest = __rest(item, ["itemType", "label"]);
|
|
14640
|
+
return (jsx(SecondaryNavItem, __assign({ item: item, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow }, rest), "".concat(label, "-").concat(itemType)));
|
|
14641
|
+
}) }));
|
|
14610
14642
|
}
|
|
14611
14643
|
|
|
14612
14644
|
var NavigationHeader = forwardRef(function (props, ref) {
|
|
14613
|
-
var activePrimaryNavKey = props.activePrimaryNavKey, buttons = props.buttons, hasInvertedStyle = props.hasInvertedStyle, logo = props.logo, logoUrl = props.logoUrl, primaryNavItems = props.primaryNavItems,
|
|
14645
|
+
var activePrimaryNavKey = props.activePrimaryNavKey, buttons = props.buttons, hasInvertedStyle = props.hasInvertedStyle, logo = props.logo, logoUrl = props.logoUrl, _a = props.logoLinkComponent, logoLinkComponent = _a === void 0 ? "a" : _a, logoLinkProps = props.logoLinkProps, primaryNavItems = props.primaryNavItems, _b = props.primaryNavPosition, primaryNavPosition = _b === void 0 ? "left" : _b, searchProps = props.searchProps, secondaryNavItems = props.secondaryNavItems, setActivePrimaryNavKey = props.setActivePrimaryNavKey, _c = props.showSearch, showSearch = _c === void 0 ? true : _c, tag = props.tag, tagColor = props.tagColor, title = props.title, rest = __rest(props, ["activePrimaryNavKey", "buttons", "hasInvertedStyle", "logo", "logoUrl", "logoLinkComponent", "logoLinkProps", "primaryNavItems", "primaryNavPosition", "searchProps", "secondaryNavItems", "setActivePrimaryNavKey", "showSearch", "tag", "tagColor", "title"]);
|
|
14614
14646
|
var navRef = useRef(null);
|
|
14615
14647
|
var theme = useTheme();
|
|
14616
14648
|
var isMdScreen = useMediaQuery(theme.breakpoints.down("md"));
|
|
14617
14649
|
useEffect(function () {
|
|
14618
14650
|
setIsNarrow(isMdScreen);
|
|
14619
14651
|
}, [isMdScreen]);
|
|
14620
|
-
var
|
|
14621
|
-
var
|
|
14622
|
-
var
|
|
14652
|
+
var _d = useState(true), drawerOpen = _d[0], setDrawerOpen = _d[1];
|
|
14653
|
+
var _e = useState(isMdScreen), isNarrow = _e[0], setIsNarrow = _e[1];
|
|
14654
|
+
var _f = useState(0), breakpoint = _f[0], setBreakpoint = _f[1];
|
|
14623
14655
|
var checkScrollable = useCallback(function () {
|
|
14624
14656
|
if (!navRef.current)
|
|
14625
14657
|
return;
|
|
@@ -14644,8 +14676,8 @@ var NavigationHeader = forwardRef(function (props, ref) {
|
|
|
14644
14676
|
};
|
|
14645
14677
|
var renderLogoNode = function () {
|
|
14646
14678
|
var logoNode = (jsxs(StyledTitleContainer, { hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, children: [jsx(StyledLogoWrapper, { children: logo }), jsx("p", { children: title }), tag && jsx(StyledTag, { color: tagColor, label: tag, hover: false })] }));
|
|
14647
|
-
if (logoUrl) {
|
|
14648
|
-
logoNode = (jsx(StyledLogoLinkWrapper, { href: logoUrl, isNarrow: isNarrow, children: logoNode }));
|
|
14679
|
+
if (logoLinkComponent || logoUrl) {
|
|
14680
|
+
logoNode = (jsx(StyledLogoLinkWrapper, __assign({ component: logoLinkComponent, href: logoUrl }, logoLinkProps, { isNarrow: isNarrow, children: logoNode })));
|
|
14649
14681
|
}
|
|
14650
14682
|
return logoNode;
|
|
14651
14683
|
};
|