@czi-sds/components 23.4.0 → 23.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.d.ts +15 -2
- package/dist/index.cjs.js +142 -31
- package/dist/index.esm.d.ts +15 -2
- package/dist/index.esm.js +143 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
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, Children, isValidElement, useEffect, useRef, useState, useCallback, createElement, cloneElement, useMemo, createContext, Fragment as Fragment$1, useContext, memo } from 'react';
|
|
5
5
|
import { css as css$1 } from '@emotion/react';
|
|
6
|
-
import { createTheme, AccordionDetails as AccordionDetails$1, accordionSummaryClasses, AccordionSummary, SvgIcon, accordionClasses, accordionDetailsClasses, Accordion as Accordion$1, Alert as Alert$2, Button as Button$1, buttonClasses, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, TextField, InputAdornment, menuItemClasses, MenuItem as MenuItem$1, autocompleteClasses, Autocomplete as Autocomplete$1, Paper, useTheme, Popper, styled as styled$1, ClickAwayListener, ButtonGroup as ButtonGroup$1, buttonGroupClasses, IconButton, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, menuClasses, Menu as Menu$1, checkboxClasses, Checkbox, FormControlLabel, Link as Link$1, Chip as Chip$1, alpha, darken as darken$1, Card, CardContent, CardActions, css as css$3, CardMedia, DialogTitle as DialogTitle$1, Typography, dialogActionsClasses, DialogActions as DialogActions$1, Dialog as Dialog$1, DialogContent, radioClasses, Radio, Slider, sliderClasses, Switch, switchClasses, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Divider, useMediaQuery, AppBar, Toolbar, Drawer, useScrollTrigger, tabsClasses, Tabs as Tabs$1, Tab as Tab$1, Slide, Box, drawerClasses, toggleButtonClasses, ToggleButtonGroup, ToggleButton, TableContainer, TableCell, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
|
|
6
|
+
import { createTheme, AccordionDetails as AccordionDetails$1, accordionSummaryClasses, AccordionSummary, SvgIcon, accordionClasses, accordionDetailsClasses, Accordion as Accordion$1, Alert as Alert$2, Button as Button$1, buttonClasses, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, TextField, InputAdornment, menuItemClasses, MenuItem as MenuItem$1, autocompleteClasses, Autocomplete as Autocomplete$1, Paper, useTheme, Popper, styled as styled$1, ClickAwayListener, ButtonGroup as ButtonGroup$1, buttonGroupClasses, IconButton, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, menuClasses, Menu as Menu$1, checkboxClasses, Checkbox, FormControlLabel, Link as Link$1, Chip as Chip$1, alpha, darken as darken$1, Card, CardContent, CardActions, css as css$3, CardMedia, DialogTitle as DialogTitle$1, Typography, dialogActionsClasses, DialogActions as DialogActions$1, Dialog as Dialog$1, DialogContent, radioClasses, Radio, Slider, sliderClasses, Switch, switchClasses, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Divider, useMediaQuery, AppBar, Toolbar, Drawer, useScrollTrigger, tabsClasses, Tabs as Tabs$1, Tab as Tab$1, Slide, Box, drawerClasses, popoverClasses, Popover as Popover$1, toggleButtonClasses, ToggleButtonGroup, ToggleButton, TableContainer, TableCell, 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 from '@emotion/styled';
|
|
9
9
|
import { Remove, Clear } from '@mui/icons-material';
|
|
@@ -7373,6 +7373,9 @@ var SDSWarningTypes;
|
|
|
7373
7373
|
SDSWarningTypes["TooltipInvertStyle"] = "tooltipInvertStyle";
|
|
7374
7374
|
SDSWarningTypes["ContentCardActionsOnlyButtons"] = "contentCardActionsOnlyButtons";
|
|
7375
7375
|
SDSWarningTypes["ClickableContentCardNumberOfButtons"] = "clickableContentCardNumberOfButtons";
|
|
7376
|
+
SDSWarningTypes["SegmentedControlTooltipTextDeprecated"] = "segmentedControlTooltipTextDeprecated";
|
|
7377
|
+
SDSWarningTypes["SegmentedControlMissingIconOrLabel"] = "segmentedControlMissingIconOrLabel";
|
|
7378
|
+
SDSWarningTypes["SegmentedControlIconAndLabelConflict"] = "segmentedControlIconAndLabelConflict";
|
|
7376
7379
|
})(SDSWarningTypes || (SDSWarningTypes = {}));
|
|
7377
7380
|
const SDS_WARNINGS = {
|
|
7378
7381
|
[SDSWarningTypes.ButtonMinimalIsAllCaps]: {
|
|
@@ -7430,6 +7433,21 @@ const SDS_WARNINGS = {
|
|
|
7430
7433
|
[SDSWarningTypes.ClickableContentCardNumberOfButtons]: {
|
|
7431
7434
|
hasWarned: false,
|
|
7432
7435
|
message: "Warning: Clickable Content Cards can only have one or no buttons!"
|
|
7436
|
+
},
|
|
7437
|
+
[SDSWarningTypes.SegmentedControlTooltipTextDeprecated]: {
|
|
7438
|
+
hasWarned: false,
|
|
7439
|
+
message: 'Warning: "tooltipText" in SegmentedControl buttonDefinition is deprecated. ' +
|
|
7440
|
+
'Please use "tooltipProps" instead. Example: { tooltipProps: { title: "My tooltip" } }'
|
|
7441
|
+
},
|
|
7442
|
+
[SDSWarningTypes.SegmentedControlMissingIconOrLabel]: {
|
|
7443
|
+
hasWarned: false,
|
|
7444
|
+
message: 'Warning: Each SegmentedControl button must have either an "icon" or a "label" prop. ' +
|
|
7445
|
+
"A button was found with neither."
|
|
7446
|
+
},
|
|
7447
|
+
[SDSWarningTypes.SegmentedControlIconAndLabelConflict]: {
|
|
7448
|
+
hasWarned: false,
|
|
7449
|
+
message: 'Warning: Each SegmentedControl button should have either an "icon" or a "label", ' +
|
|
7450
|
+
"not both. Please use only one per button."
|
|
7433
7451
|
}
|
|
7434
7452
|
};
|
|
7435
7453
|
const showWarningIfFirstOccurence = (warningType) => {
|
|
@@ -7477,6 +7495,10 @@ const GeneralButtonGroupStyles = (props) => {
|
|
|
7477
7495
|
min-width: fit-content;
|
|
7478
7496
|
z-index: 1;
|
|
7479
7497
|
|
|
7498
|
+
&::before {
|
|
7499
|
+
border-radius: inherit;
|
|
7500
|
+
}
|
|
7501
|
+
|
|
7480
7502
|
&:hover,
|
|
7481
7503
|
&:active,
|
|
7482
7504
|
&:focus {
|
|
@@ -7583,10 +7605,11 @@ const LargeButtonGroupStyles = (props) => {
|
|
|
7583
7605
|
}
|
|
7584
7606
|
}
|
|
7585
7607
|
|
|
7586
|
-
/* Icon-only buttons: has svg but no startIcon/endIcon slots */
|
|
7608
|
+
/* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
|
|
7587
7609
|
.${buttonGroupClasses.grouped}:has(svg):not(
|
|
7588
7610
|
:has(.${buttonClasses.startIcon})
|
|
7589
|
-
):not(:has(.${buttonClasses.endIcon}))
|
|
7611
|
+
):not(:has(.${buttonClasses.endIcon})),
|
|
7612
|
+
.${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
|
|
7590
7613
|
padding: ${iconOnlyPaddingWide};
|
|
7591
7614
|
|
|
7592
7615
|
${theme?.breakpoints?.down("md")} {
|
|
@@ -7594,8 +7617,10 @@ const LargeButtonGroupStyles = (props) => {
|
|
|
7594
7617
|
}
|
|
7595
7618
|
}
|
|
7596
7619
|
|
|
7597
|
-
/* Text + icon buttons: has startIcon or endIcon */
|
|
7598
|
-
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon})
|
|
7620
|
+
/* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
|
|
7621
|
+
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
|
|
7622
|
+
:has(> .${buttonClasses.startIcon}:only-child)
|
|
7623
|
+
),
|
|
7599
7624
|
.${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
|
|
7600
7625
|
${theme?.breakpoints?.down("md")} {
|
|
7601
7626
|
padding: 0 14px;
|
|
@@ -7661,10 +7686,11 @@ const MediumButtonGroupStyles = (props) => {
|
|
|
7661
7686
|
}
|
|
7662
7687
|
}
|
|
7663
7688
|
|
|
7664
|
-
/* Icon-only buttons: has svg but no startIcon/endIcon slots */
|
|
7689
|
+
/* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
|
|
7665
7690
|
.${buttonGroupClasses.grouped}:has(svg):not(
|
|
7666
7691
|
:has(.${buttonClasses.startIcon})
|
|
7667
|
-
):not(:has(.${buttonClasses.endIcon}))
|
|
7692
|
+
):not(:has(.${buttonClasses.endIcon})),
|
|
7693
|
+
.${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
|
|
7668
7694
|
padding: ${iconOnlyPaddingWide};
|
|
7669
7695
|
|
|
7670
7696
|
${theme?.breakpoints?.down("md")} {
|
|
@@ -7672,8 +7698,10 @@ const MediumButtonGroupStyles = (props) => {
|
|
|
7672
7698
|
}
|
|
7673
7699
|
}
|
|
7674
7700
|
|
|
7675
|
-
/* Text + icon buttons: has startIcon or endIcon -
|
|
7676
|
-
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon})
|
|
7701
|
+
/* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
|
|
7702
|
+
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
|
|
7703
|
+
:has(> .${buttonClasses.startIcon}:only-child)
|
|
7704
|
+
),
|
|
7677
7705
|
.${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
|
|
7678
7706
|
padding: 0 10px;
|
|
7679
7707
|
}
|
|
@@ -7737,10 +7765,11 @@ const SmallButtonGroupStyles = (props) => {
|
|
|
7737
7765
|
}
|
|
7738
7766
|
}
|
|
7739
7767
|
|
|
7740
|
-
/* Icon-only buttons: has svg but no startIcon/endIcon slots */
|
|
7768
|
+
/* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
|
|
7741
7769
|
.${buttonGroupClasses.grouped}:has(svg):not(
|
|
7742
7770
|
:has(.${buttonClasses.startIcon})
|
|
7743
|
-
):not(:has(.${buttonClasses.endIcon}))
|
|
7771
|
+
):not(:has(.${buttonClasses.endIcon})),
|
|
7772
|
+
.${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
|
|
7744
7773
|
padding: ${iconOnlyPaddingWide};
|
|
7745
7774
|
|
|
7746
7775
|
${theme?.breakpoints?.down("md")} {
|
|
@@ -7748,8 +7777,10 @@ const SmallButtonGroupStyles = (props) => {
|
|
|
7748
7777
|
}
|
|
7749
7778
|
}
|
|
7750
7779
|
|
|
7751
|
-
/* Text + icon buttons: has startIcon or endIcon -
|
|
7752
|
-
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon})
|
|
7780
|
+
/* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
|
|
7781
|
+
.${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
|
|
7782
|
+
:has(> .${buttonClasses.startIcon}:only-child)
|
|
7783
|
+
),
|
|
7753
7784
|
.${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
|
|
7754
7785
|
padding: 0 ${spaces?.s}px;
|
|
7755
7786
|
}
|
|
@@ -7798,6 +7829,7 @@ const PrimaryButtonGroupStyles = (props) => {
|
|
|
7798
7829
|
&& .${buttonGroupClasses.grouped} {
|
|
7799
7830
|
background-color: transparent;
|
|
7800
7831
|
border: 1px solid ${defaultColor};
|
|
7832
|
+
box-shadow: none;
|
|
7801
7833
|
color: ${defaultColor};
|
|
7802
7834
|
|
|
7803
7835
|
svg {
|
|
@@ -7809,6 +7841,7 @@ const PrimaryButtonGroupStyles = (props) => {
|
|
|
7809
7841
|
color: ${hoverColor};
|
|
7810
7842
|
background-color: ${hoverBgColor};
|
|
7811
7843
|
border: 1px solid ${hoverColor};
|
|
7844
|
+
box-shadow: none;
|
|
7812
7845
|
|
|
7813
7846
|
svg {
|
|
7814
7847
|
color: ${hoverColor};
|
|
@@ -7819,6 +7852,7 @@ const PrimaryButtonGroupStyles = (props) => {
|
|
|
7819
7852
|
color: ${pressedColor};
|
|
7820
7853
|
background-color: ${hoverBgColor};
|
|
7821
7854
|
border: 1px solid ${pressedColor};
|
|
7855
|
+
box-shadow: none;
|
|
7822
7856
|
|
|
7823
7857
|
svg {
|
|
7824
7858
|
color: ${pressedColor};
|
|
@@ -7833,6 +7867,7 @@ const PrimaryButtonGroupStyles = (props) => {
|
|
|
7833
7867
|
color: ${textDisabledColor};
|
|
7834
7868
|
background-color: transparent;
|
|
7835
7869
|
border: 1px solid ${disabledColor};
|
|
7870
|
+
box-shadow: none;
|
|
7836
7871
|
|
|
7837
7872
|
svg {
|
|
7838
7873
|
color: ${ornamentDisabledColor};
|
|
@@ -7886,6 +7921,7 @@ const SecondaryButtonGroupStyles = (props) => {
|
|
|
7886
7921
|
&& .${buttonGroupClasses.grouped} {
|
|
7887
7922
|
background-color: transparent;
|
|
7888
7923
|
border: 1px solid ${defaultColor};
|
|
7924
|
+
box-shadow: none;
|
|
7889
7925
|
color: ${textColor};
|
|
7890
7926
|
|
|
7891
7927
|
svg {
|
|
@@ -7897,6 +7933,7 @@ const SecondaryButtonGroupStyles = (props) => {
|
|
|
7897
7933
|
color: ${textColor};
|
|
7898
7934
|
background-color: ${hoverBgColor};
|
|
7899
7935
|
border: 1px solid ${defaultColor};
|
|
7936
|
+
box-shadow: none;
|
|
7900
7937
|
|
|
7901
7938
|
svg {
|
|
7902
7939
|
color: ${ornamentColor};
|
|
@@ -7907,6 +7944,7 @@ const SecondaryButtonGroupStyles = (props) => {
|
|
|
7907
7944
|
color: ${textColor};
|
|
7908
7945
|
background-color: ${pressedBgColor};
|
|
7909
7946
|
border: 1px solid ${defaultColor};
|
|
7947
|
+
box-shadow: none;
|
|
7910
7948
|
|
|
7911
7949
|
svg {
|
|
7912
7950
|
color: ${ornamentColor};
|
|
@@ -7921,6 +7959,7 @@ const SecondaryButtonGroupStyles = (props) => {
|
|
|
7921
7959
|
color: ${textDisabledColor};
|
|
7922
7960
|
background-color: transparent;
|
|
7923
7961
|
border: 1px solid ${disabledColor};
|
|
7962
|
+
box-shadow: none;
|
|
7924
7963
|
|
|
7925
7964
|
svg {
|
|
7926
7965
|
color: ${ornamentDisabledColor};
|
|
@@ -8259,29 +8298,44 @@ const StageOnStyles = (props) => {
|
|
|
8259
8298
|
// So we need to apply the "on" state background to ::before as well
|
|
8260
8299
|
const isSecondary = sdsType === "secondary";
|
|
8261
8300
|
if (isSecondary) {
|
|
8301
|
+
/**
|
|
8302
|
+
* Specificity boost via Emotion's `&&&&` technique.
|
|
8303
|
+
*
|
|
8304
|
+
* Each `&` repeats the component's generated class, producing a selector
|
|
8305
|
+
* like `.css-abc123.css-abc123.css-abc123.css-abc123` — specificity (0,4,0).
|
|
8306
|
+
*
|
|
8307
|
+
* This is needed because ButtonGroup styles its children with
|
|
8308
|
+
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8309
|
+
* Without the boost, the sdsStage="on" styles would always lose
|
|
8310
|
+
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8311
|
+
*/
|
|
8262
8312
|
return css$1 `
|
|
8263
|
-
|
|
8313
|
+
&&&& {
|
|
8314
|
+
color: ${contentColor};
|
|
8264
8315
|
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8316
|
+
svg {
|
|
8317
|
+
color: ${ornamentColor};
|
|
8318
|
+
}
|
|
8268
8319
|
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8320
|
+
/* Apply "on" state background via ::before to match Button's hover pattern */
|
|
8321
|
+
&::before {
|
|
8322
|
+
background-color: ${sdsStyle === "minimal" && !backgroundOnHover
|
|
8272
8323
|
? "transparent"
|
|
8273
8324
|
: backgroundColor};
|
|
8325
|
+
}
|
|
8274
8326
|
}
|
|
8275
8327
|
`;
|
|
8276
8328
|
}
|
|
8277
8329
|
return css$1 `
|
|
8278
|
-
|
|
8330
|
+
&&&& {
|
|
8331
|
+
background-color: ${sdsStyle === "minimal" && !backgroundOnHover
|
|
8279
8332
|
? "transparent"
|
|
8280
8333
|
: backgroundColor};
|
|
8281
|
-
|
|
8334
|
+
color: ${contentColor};
|
|
8282
8335
|
|
|
8283
|
-
|
|
8284
|
-
|
|
8336
|
+
svg {
|
|
8337
|
+
color: ${ornamentColor};
|
|
8338
|
+
}
|
|
8285
8339
|
}
|
|
8286
8340
|
`;
|
|
8287
8341
|
};
|
|
@@ -18566,6 +18620,41 @@ const Panel = React__default.forwardRef((props, ref) => {
|
|
|
18566
18620
|
}, slotProps: SLOT_PROPS, hideBackdrop: !isBackdropClickEnabled, children: [isOverlayPanelProps(props) && (jsxs(StyledHeaderComponent, { children: [props?.HeaderComponent && (jsx(PanelHeader, { children: props?.HeaderComponent })), jsx(PanelHeaderClose, { onClick: props?.closeButtonOnClick, CloseButtonComponent: props?.CloseButtonComponent })] })), children] })));
|
|
18567
18621
|
});
|
|
18568
18622
|
|
|
18623
|
+
const StyledPopover = styled(Popover$1) `
|
|
18624
|
+
& .${popoverClasses.paper} {
|
|
18625
|
+
${(props) => {
|
|
18626
|
+
const corners = getCorners(props);
|
|
18627
|
+
const shadows = getShadows(props);
|
|
18628
|
+
const semanticColors = getSemanticColors(props);
|
|
18629
|
+
const borders = getBorders(props);
|
|
18630
|
+
const spaces = getSpaces(props);
|
|
18631
|
+
return `
|
|
18632
|
+
background-color: ${semanticColors?.base?.surfacePrimary};
|
|
18633
|
+
background-image: none;
|
|
18634
|
+
border-radius: ${corners?.l}px;
|
|
18635
|
+
padding: ${spaces?.xs}px ${spaces?.m}px;
|
|
18636
|
+
border: ${borders?.none};
|
|
18637
|
+
outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
|
|
18638
|
+
box-shadow: ${shadows?.m};
|
|
18639
|
+
box-sizing: border-box;
|
|
18640
|
+
z-index: ${props?.theme?.zIndex?.tooltip ?? 1400};
|
|
18641
|
+
`;
|
|
18642
|
+
}}
|
|
18643
|
+
}
|
|
18644
|
+
`;
|
|
18645
|
+
|
|
18646
|
+
/**
|
|
18647
|
+
* @see https://mui.com/material-ui/react-popover/
|
|
18648
|
+
*/
|
|
18649
|
+
const Popover = forwardRef(function Popover(props, ref) {
|
|
18650
|
+
const theme = useTheme();
|
|
18651
|
+
const spaces = getSpaces({ theme });
|
|
18652
|
+
return (jsx(StyledPopover, __assign({ ref: ref, anchorOrigin: {
|
|
18653
|
+
horizontal: "left",
|
|
18654
|
+
vertical: "bottom"
|
|
18655
|
+
}, transformOrigin: { vertical: -(spaces?.s || 8), horizontal: 0 } }, props)));
|
|
18656
|
+
});
|
|
18657
|
+
|
|
18569
18658
|
const doNotForwardProps = ["buttonDefinition"];
|
|
18570
18659
|
const StyledSegmentedControl = styled(ToggleButtonGroup, {
|
|
18571
18660
|
shouldForwardProp: (prop) => !doNotForwardProps.includes(prop)
|
|
@@ -18607,7 +18696,6 @@ const StyledSegmentedControl = styled(ToggleButtonGroup, {
|
|
|
18607
18696
|
${focusVisibleA11yStyle(props)}
|
|
18608
18697
|
background-color: transparent;
|
|
18609
18698
|
border: none;
|
|
18610
|
-
line-height: 0px;
|
|
18611
18699
|
color: ${semanticColors?.base?.ornamentSecondary};
|
|
18612
18700
|
padding: ${spaces?.xxs}px ${spaces?.m}px;
|
|
18613
18701
|
border-radius: ${corners?.m}px;
|
|
@@ -18636,6 +18724,14 @@ const StyledToggleButton = styled(ToggleButton, {
|
|
|
18636
18724
|
`;
|
|
18637
18725
|
}}
|
|
18638
18726
|
`;
|
|
18727
|
+
const StyledToggleButtonIcon = styled("div") `
|
|
18728
|
+
line-height: 0px;
|
|
18729
|
+
`;
|
|
18730
|
+
const StyledToggleButtonLabel = styled("div") `
|
|
18731
|
+
${fontBodyMediumS}
|
|
18732
|
+
white-space: nowrap;
|
|
18733
|
+
line-height: 16px !important;
|
|
18734
|
+
`;
|
|
18639
18735
|
|
|
18640
18736
|
/**
|
|
18641
18737
|
* @see https://mui.com/material-ui/react-toggle-button/
|
|
@@ -18655,13 +18751,27 @@ const SegmentedControl = (props) => {
|
|
|
18655
18751
|
onChangeProp(event, newActive);
|
|
18656
18752
|
}
|
|
18657
18753
|
};
|
|
18658
|
-
return (
|
|
18659
|
-
|
|
18660
|
-
|
|
18661
|
-
|
|
18662
|
-
|
|
18663
|
-
|
|
18664
|
-
|
|
18754
|
+
return (jsx(StyledSegmentedControl, __assign({ "aria-label": "Segmented Control", size: "small", value: value, exclusive: true, onChange: handleActive }, restProps, { children: buttonDefinition.map((button) => {
|
|
18755
|
+
const { icon, label, shouldShowTooltip = true, tooltipProps, tooltipText, value: buttonValue, disabled = false, } = button;
|
|
18756
|
+
if (tooltipText) {
|
|
18757
|
+
showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlTooltipTextDeprecated);
|
|
18758
|
+
}
|
|
18759
|
+
if (!icon && !label) {
|
|
18760
|
+
showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlMissingIconOrLabel);
|
|
18761
|
+
}
|
|
18762
|
+
if (icon && label) {
|
|
18763
|
+
showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlIconAndLabelConflict);
|
|
18764
|
+
}
|
|
18765
|
+
const iconItem = icon ? (typeof icon !== "string" ? (icon) : (jsx(Icon, { sdsIcon: icon, sdsSize: "s" }))) : null;
|
|
18766
|
+
const buttonContent = label ? (jsx(StyledToggleButtonLabel, { children: label })) : iconItem ? (jsx(StyledToggleButtonIcon, { children: iconItem })) : (jsx(StyledToggleButtonLabel, { children: buttonValue }));
|
|
18767
|
+
const toggleButton = (jsx(StyledToggleButton, { "aria-label": tooltipText ?? label ?? buttonValue, value: buttonValue, disabled: disabled, children: jsx("span", { tabIndex: -1, children: buttonContent }) }, buttonValue));
|
|
18768
|
+
// Resolve the tooltip title: tooltipText takes priority,
|
|
18769
|
+
// then tooltipProps.title, then label, then falls back to buttonValue.
|
|
18770
|
+
const resolvedTitle = tooltipText ?? tooltipProps?.title ?? label ?? buttonValue;
|
|
18771
|
+
// (masoudmanson): If the button is disabled or shouldShowTooltip
|
|
18772
|
+
// is false, we don't render the tooltip.
|
|
18773
|
+
return disabled || !shouldShowTooltip ? (toggleButton) : (createElement(Tooltip, __assign({ arrow: true }, tooltipProps, { title: resolvedTitle, key: buttonValue }), toggleButton));
|
|
18774
|
+
}) })));
|
|
18665
18775
|
};
|
|
18666
18776
|
|
|
18667
18777
|
const TabsContext = createContext({ sdsSize: "large" });
|
|
@@ -22490,4 +22600,4 @@ const generateDiscreteColors = (count, options = {}) => {
|
|
|
22490
22600
|
return isDarkMode ? colors.reverse() : colors;
|
|
22491
22601
|
};
|
|
22492
22602
|
|
|
22493
|
-
export { Accordion, AccordionDetails, AccordionHeader, Alert$1 as Alert, Autocomplete, StyledPopper$2 as AutocompleteMultiColumnStyledPopper, StyledPaper$3 as AutocompleteSingleColumnStyledPaper, Banner, Button, ButtonDropdown, ButtonDropdownLegacy, ButtonGroup, ButtonIcon, ButtonLegacy, ButtonToggle, ButtonToggleLegacy, Callout, CalloutTitle, CellBasic, CellComponent, CellHeader, Chip, ComplexFilter, InputDropdown as ComplexFilterInputDropdown, StyledPopper as ComplexFilterPopper, ContentCard, ContentCardActions, StyledContentCardBody as ContentCardBody, StyledMetadataText as ContentCardMetadata, StyledOverlineText as ContentCardOverline, StyledSubtitleText as ContentCardSubtitle, StyledTitleText as ContentCardTitle, Dialog, DialogActions, index$1 as DialogContent, DialogPaper, DialogTitle, Overline as DialogTitleOverline, Subtitle as DialogTitleSubtitle, Title as DialogTitleTitle, Dropdown, InputDropdown as DropdownInputDropdown, DropdownMenu, StyledPaper$1 as DropdownPaper, StyledPopper as DropdownPopper, Hero, Icon, InputCheckbox, InputDropdown, InputRadio, InputSearch, InputSlider, InputText, InputToggle, IntentMessage, Legend, Link, List, ListItem, ListItemLabel, ListSubheader, LoadingIndicator, MINIMUM_DROPDOWN_MENU_POPPER_WIDTH, Menu, MenuItem, MenuSelect, NavigationFooter, NavigationHeader, NavigationJumpTo, Notification, Pagination, Panel, PreComposedTable, RowHoverContext, SDSChooseTheme, SDSDarkAppTheme, SDSDarkThemeColors, SDSLightAppTheme, SDSLightThemeColors, SDSPaletteDark, SDSPaletteLight, SegmentedControl, Tab, Table, TableHeader, TableRow, Tabs, Tag, TagFilter, Theme, Tooltip, TooltipCondensed, TooltipTableContent as TooltipTable, defaultAppTheme, defaultTheme, focusVisibleA11yStyle, fontBody, fontBodyL$1 as fontBodyL, fontBodyM$1 as fontBodyM, fontBodyMediumL, fontBodyMediumM, fontBodyMediumS, fontBodyMediumXs, fontBodyMediumXxs, fontBodyMediumXxxs, fontBodyMediumXxxxs, fontBodyS$1 as fontBodyS, fontBodySemiboldL, fontBodySemiboldM, fontBodySemiboldS, fontBodySemiboldXs, fontBodySemiboldXxs, fontBodySemiboldXxxs, fontBodySemiboldXxxxs, fontBodyXs$2 as fontBodyXs, fontBodyXxs$1 as fontBodyXxs, fontBodyXxxs$1 as fontBodyXxxs, fontBodyXxxxs, fontCaps, fontCapsXxs, fontCapsXxxs, fontCapsXxxxs, fontCode, fontCodeMediumS, fontCodeMediumXs, fontCodeS, fontCodeSemiboldS, fontCodeSemiboldXs, fontCodeXs, fontHeader, fontHeaderL, fontHeaderM$1 as fontHeaderM, fontHeaderS, fontHeaderXl, fontHeaderXs, fontHeaderXxl, fontHeaderXxs, fontHeaderXxxs, fontLink, fontLinkL, fontLinkM, fontLinkMediumL, fontLinkMediumM, fontLinkMediumS, fontLinkMediumXs, fontLinkMediumXxs, fontLinkMediumXxxs, fontLinkMediumXxxxs, fontLinkS, fontLinkSemiboldL, fontLinkSemiboldM, fontLinkSemiboldS, fontLinkSemiboldXs, fontLinkSemiboldXxs, fontLinkSemiboldXxxs, fontLinkSemiboldXxxxs, fontLinkXs, fontLinkXxs, fontLinkXxxs, fontLinkXxxxs, fontTabular, fontTabularMediumS, fontTabularMediumXs, fontTabularMediumXxs, fontTabularMediumXxxs, fontTabularMediumXxxxs, fontTabularS, fontTabularSemiboldS, fontTabularSemiboldXs, fontTabularSemiboldXxs, fontTabularSemiboldXxxs, fontTabularSemiboldXxxxs, fontTabularXs, fontTabularXxs, fontTabularXxxs, fontTabularXxxxs, fontTitle, fontTitleBoldL, fontTitleBoldM, fontTitleBoldS, generateDiscreteColors, getBorders, getBreakpoints, getColors, getCorners, getFontWeights, getIconSizes, getMode, getPalette, getSemanticColors, getShadows, getSpaces, getSpacings, getTypography, isIconOnlyButton, makeSdsSemanticAppTheme, makeThemeOptions };
|
|
22603
|
+
export { Accordion, AccordionDetails, AccordionHeader, Alert$1 as Alert, Autocomplete, StyledPopper$2 as AutocompleteMultiColumnStyledPopper, StyledPaper$3 as AutocompleteSingleColumnStyledPaper, Banner, Button, ButtonDropdown, ButtonDropdownLegacy, ButtonGroup, ButtonIcon, ButtonLegacy, ButtonToggle, ButtonToggleLegacy, Callout, CalloutTitle, CellBasic, CellComponent, CellHeader, Chip, ComplexFilter, InputDropdown as ComplexFilterInputDropdown, StyledPopper as ComplexFilterPopper, ContentCard, ContentCardActions, StyledContentCardBody as ContentCardBody, StyledMetadataText as ContentCardMetadata, StyledOverlineText as ContentCardOverline, StyledSubtitleText as ContentCardSubtitle, StyledTitleText as ContentCardTitle, Dialog, DialogActions, index$1 as DialogContent, DialogPaper, DialogTitle, Overline as DialogTitleOverline, Subtitle as DialogTitleSubtitle, Title as DialogTitleTitle, Dropdown, InputDropdown as DropdownInputDropdown, DropdownMenu, StyledPaper$1 as DropdownPaper, StyledPopper as DropdownPopper, Hero, Icon, InputCheckbox, InputDropdown, InputRadio, InputSearch, InputSlider, InputText, InputToggle, IntentMessage, Legend, Link, List, ListItem, ListItemLabel, ListSubheader, LoadingIndicator, MINIMUM_DROPDOWN_MENU_POPPER_WIDTH, Menu, MenuItem, MenuSelect, NavigationFooter, NavigationHeader, NavigationJumpTo, Notification, Pagination, Panel, Popover, PreComposedTable, RowHoverContext, SDSChooseTheme, SDSDarkAppTheme, SDSDarkThemeColors, SDSLightAppTheme, SDSLightThemeColors, SDSPaletteDark, SDSPaletteLight, SegmentedControl, Tab, Table, TableHeader, TableRow, Tabs, Tag, TagFilter, Theme, Tooltip, TooltipCondensed, TooltipTableContent as TooltipTable, defaultAppTheme, defaultTheme, focusVisibleA11yStyle, fontBody, fontBodyL$1 as fontBodyL, fontBodyM$1 as fontBodyM, fontBodyMediumL, fontBodyMediumM, fontBodyMediumS, fontBodyMediumXs, fontBodyMediumXxs, fontBodyMediumXxxs, fontBodyMediumXxxxs, fontBodyS$1 as fontBodyS, fontBodySemiboldL, fontBodySemiboldM, fontBodySemiboldS, fontBodySemiboldXs, fontBodySemiboldXxs, fontBodySemiboldXxxs, fontBodySemiboldXxxxs, fontBodyXs$2 as fontBodyXs, fontBodyXxs$1 as fontBodyXxs, fontBodyXxxs$1 as fontBodyXxxs, fontBodyXxxxs, fontCaps, fontCapsXxs, fontCapsXxxs, fontCapsXxxxs, fontCode, fontCodeMediumS, fontCodeMediumXs, fontCodeS, fontCodeSemiboldS, fontCodeSemiboldXs, fontCodeXs, fontHeader, fontHeaderL, fontHeaderM$1 as fontHeaderM, fontHeaderS, fontHeaderXl, fontHeaderXs, fontHeaderXxl, fontHeaderXxs, fontHeaderXxxs, fontLink, fontLinkL, fontLinkM, fontLinkMediumL, fontLinkMediumM, fontLinkMediumS, fontLinkMediumXs, fontLinkMediumXxs, fontLinkMediumXxxs, fontLinkMediumXxxxs, fontLinkS, fontLinkSemiboldL, fontLinkSemiboldM, fontLinkSemiboldS, fontLinkSemiboldXs, fontLinkSemiboldXxs, fontLinkSemiboldXxxs, fontLinkSemiboldXxxxs, fontLinkXs, fontLinkXxs, fontLinkXxxs, fontLinkXxxxs, fontTabular, fontTabularMediumS, fontTabularMediumXs, fontTabularMediumXxs, fontTabularMediumXxxs, fontTabularMediumXxxxs, fontTabularS, fontTabularSemiboldS, fontTabularSemiboldXs, fontTabularSemiboldXxs, fontTabularSemiboldXxxs, fontTabularSemiboldXxxxs, fontTabularXs, fontTabularXxs, fontTabularXxxs, fontTabularXxxxs, fontTitle, fontTitleBoldL, fontTitleBoldM, fontTitleBoldS, generateDiscreteColors, getBorders, getBreakpoints, getColors, getCorners, getFontWeights, getIconSizes, getMode, getPalette, getSemanticColors, getShadows, getSpaces, getSpacings, getTypography, isIconOnlyButton, makeSdsSemanticAppTheme, makeThemeOptions };
|