@czi-sds/components 20.5.0 → 20.7.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 +12 -1
- package/dist/index.cjs.js +239 -98
- package/dist/index.esm.d.ts +12 -1
- package/dist/index.esm.js +241 -100
- package/dist/tailwind.json +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/variables.css +3 -0
- package/dist/variables.scss +3 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { forwardRef,
|
|
3
|
+
import React__default, { forwardRef, useEffect, useRef, useState, useCallback, useMemo, createContext, useContext } from 'react';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import { colors, 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, inputAdornmentClasses, buttonBaseClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, Popper, ClickAwayListener, alertClasses, alertTitleClasses, Grow, AlertTitle, Tooltip as Tooltip$1, Chip as Chip$1, darken, 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, Tabs as Tabs$1, Tab as Tab$1, Slide, Box, ToggleButtonGroup, toggleButtonClasses, ToggleButton, useTheme as useTheme$1, TableCell, TableContainer, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
|
|
5
|
+
import { colors, 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, inputAdornmentClasses, buttonBaseClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, Popper, ClickAwayListener, alertClasses, alertTitleClasses, Grow, AlertTitle, Tooltip as Tooltip$1, Chip as Chip$1, darken, 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, Tabs as Tabs$1, tabsClasses, Tab as Tab$1, Slide, Box, ToggleButtonGroup, toggleButtonClasses, ToggleButton, useTheme as useTheme$1, TableCell, TableContainer, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
|
|
6
6
|
import { createTheme, styled, useTheme } from '@mui/material/styles';
|
|
7
7
|
import { Check, Remove, Clear } from '@mui/icons-material';
|
|
8
8
|
import { css as css$1 } from '@emotion/css';
|
|
@@ -582,6 +582,7 @@ function makeThemeOptions(appTheme) {
|
|
|
582
582
|
borderFocus: appTheme.colors.blue[400],
|
|
583
583
|
borderHover: appTheme.colors.blue[500],
|
|
584
584
|
borderOpen: appTheme.colors.blue[400],
|
|
585
|
+
borderPressed: appTheme.colors.blue[600],
|
|
585
586
|
borderSelected: appTheme.colors.blue[400],
|
|
586
587
|
fill: appTheme.colors.blue[400],
|
|
587
588
|
fillDisabled: appTheme.colors.blue[300],
|
|
@@ -595,6 +596,8 @@ function makeThemeOptions(appTheme) {
|
|
|
595
596
|
border: appTheme.colors.gray[400],
|
|
596
597
|
borderDisabled: appTheme.colors.gray[300],
|
|
597
598
|
borderHover: appTheme.colors.common.black,
|
|
599
|
+
borderPressed: appTheme.colors.common.black,
|
|
600
|
+
borderTable: appTheme.colors.gray[300],
|
|
598
601
|
divider: appTheme.colors.gray[200],
|
|
599
602
|
fill: appTheme.colors.common.white,
|
|
600
603
|
fillDisabled: appTheme.colors.gray[300],
|
|
@@ -812,7 +815,7 @@ var defaultThemeOptions = makeThemeOptions(SDSAppTheme);
|
|
|
812
815
|
var defaultTheme = createTheme(defaultThemeOptions);
|
|
813
816
|
|
|
814
817
|
function focusVisibleA11yStyle() {
|
|
815
|
-
return "\n &.Mui-focusVisible, &:focus-visible {\n outline:
|
|
818
|
+
return "\n &.Mui-focusVisible, &:focus-visible {\n outline: 2px solid black;\n outline-offset: 1px;\n }\n ";
|
|
816
819
|
}
|
|
817
820
|
|
|
818
821
|
var getSpaces = function (_a) {
|
|
@@ -820,6 +823,9 @@ var getSpaces = function (_a) {
|
|
|
820
823
|
var theme = _a.theme;
|
|
821
824
|
return ((_b = theme === null || theme === void 0 ? void 0 : theme.app) === null || _b === void 0 ? void 0 : _b.spacing) || null;
|
|
822
825
|
};
|
|
826
|
+
/**
|
|
827
|
+
* @deprecated getSpacings() is deprecated and may be removed in a future release. Please use getSpaces()
|
|
828
|
+
*/
|
|
823
829
|
var getSpacings = function (_a) {
|
|
824
830
|
var _b;
|
|
825
831
|
var theme = _a.theme;
|
|
@@ -3625,7 +3631,7 @@ var StyledAccordion = styled(Accordion$1, {
|
|
|
3625
3631
|
var typography = getTypography(props);
|
|
3626
3632
|
var borders = getBorders(props);
|
|
3627
3633
|
var spaces = getSpaces(props);
|
|
3628
|
-
return css(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n &.", " {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .", " {\n min-height: 44px;\n\n &.", " {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .", " {\n padding: 0;\n align-self: flex-start;\n margin-top: ", "px;\n }\n }\n\n .", " {\n ", "\n padding: ", "px;\n padding-top: ", "px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.", " {\n margin: 0;\n }\n\n ", "\n }\n "], ["\n &.", " {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .", " {\n min-height: 44px;\n\n &.", " {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .", " {\n padding: 0;\n align-self: flex-start;\n margin-top: ", "px;\n }\n }\n\n .", " {\n ", "\n padding: ", "px;\n padding-top: ", "px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.", " {\n margin: 0;\n }\n\n ", "\n }\n "])), accordionClasses.root, shadows === null || shadows === void 0 ? void 0 : shadows.none, (_a = typography === null || typography === void 0 ? void 0 : typography.fontFamily) === null || _a === void 0 ? void 0 : _a.body, useDivider ? (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.divider : "none", accordionSummaryClasses.root, accordionSummaryClasses.expanded, accordionSummaryClasses.expandIconWrapper, spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, accordionDetailsClasses.root, fontBodyXs$2(props), spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.xxs, accordionClasses.expanded, togglePosition === "left" && leftPosition(props));
|
|
3634
|
+
return css(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n &.", " {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .", " {\n ", "\n min-height: 44px;\n\n &.", " {\n background-color: unset;\n }\n\n &.", " {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .", " {\n padding: 0;\n align-self: flex-start;\n margin-top: ", "px;\n }\n }\n\n .", " {\n ", "\n padding: ", "px;\n padding-top: ", "px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.", " {\n margin: 0;\n }\n\n ", "\n }\n "], ["\n &.", " {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .", " {\n ", "\n min-height: 44px;\n\n &.", " {\n background-color: unset;\n }\n\n &.", " {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .", " {\n padding: 0;\n align-self: flex-start;\n margin-top: ", "px;\n }\n }\n\n .", " {\n ", "\n padding: ", "px;\n padding-top: ", "px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.", " {\n margin: 0;\n }\n\n ", "\n }\n "])), accordionClasses.root, shadows === null || shadows === void 0 ? void 0 : shadows.none, (_a = typography === null || typography === void 0 ? void 0 : typography.fontFamily) === null || _a === void 0 ? void 0 : _a.body, useDivider ? (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.divider : "none", accordionSummaryClasses.root, focusVisibleA11yStyle(), accordionSummaryClasses.focusVisible, accordionSummaryClasses.expanded, accordionSummaryClasses.expandIconWrapper, spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, accordionDetailsClasses.root, fontBodyXs$2(props), spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.xxs, accordionClasses.expanded, togglePosition === "left" && leftPosition(props));
|
|
3629
3635
|
});
|
|
3630
3636
|
var leftPosition = function (props) {
|
|
3631
3637
|
var _a, _b, _c;
|
|
@@ -3878,17 +3884,20 @@ var tertiary = function (props) {
|
|
|
3878
3884
|
var small$1 = function (props) {
|
|
3879
3885
|
var sdsType = props.sdsType;
|
|
3880
3886
|
var iconSizes = getIconSizes(props);
|
|
3881
|
-
|
|
3887
|
+
var spaces = getSpaces(props);
|
|
3888
|
+
return css(templateObject_5$e || (templateObject_5$e = __makeTemplateObject(["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "], ["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "])), iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width, sdsType !== "tertiary" ? "margin: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;") : "");
|
|
3882
3889
|
};
|
|
3883
3890
|
var medium$1 = function (props) {
|
|
3884
3891
|
var sdsType = props.sdsType;
|
|
3885
3892
|
var iconSizes = getIconSizes(props);
|
|
3886
|
-
|
|
3893
|
+
var spaces = getSpaces(props);
|
|
3894
|
+
return css(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "], ["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "])), iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.l.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.l.width, sdsType !== "tertiary" ? "margin: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;") : "");
|
|
3887
3895
|
};
|
|
3888
3896
|
var large = function (props) {
|
|
3889
3897
|
var sdsType = props.sdsType;
|
|
3890
3898
|
var iconSizes = getIconSizes(props);
|
|
3891
|
-
|
|
3899
|
+
var spaces = getSpaces(props);
|
|
3900
|
+
return css(templateObject_7$8 || (templateObject_7$8 = __makeTemplateObject(["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "], ["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "])), iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, sdsType !== "tertiary" ? "margin: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;") : "");
|
|
3892
3901
|
};
|
|
3893
3902
|
var doNotForwardProps$o = [
|
|
3894
3903
|
"on",
|
|
@@ -4030,7 +4039,7 @@ var disabledStyled$2 = function (props) {
|
|
|
4030
4039
|
var _a, _b, _c;
|
|
4031
4040
|
var colors = getColors(props);
|
|
4032
4041
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
4033
|
-
return css(templateObject_5$d || (templateObject_5$d = __makeTemplateObject(["\n .", " {\n .", " {\n border: 1px solid ", ";\n }\n\n .", " svg {\n color: ", ";\n }\n\n &:hover .", " {\n border: 1px solid ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n }\n "], ["\n .", " {\n .", " {\n border: 1px solid ", ";\n }\n\n .", " svg {\n color: ", ";\n }\n\n &:hover .", " {\n border: 1px solid ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n }\n "])), outlinedInputClasses.disabled, outlinedInputClasses.notchedOutline, (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.borderDisabled, inputAdornmentClasses.root, (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.iconDisabled, outlinedInputClasses.notchedOutline, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
4042
|
+
return css(templateObject_5$d || (templateObject_5$d = __makeTemplateObject(["\n .", " {\n .", " {\n border: 1px solid ", " !important;\n }\n\n .", " svg {\n color: ", ";\n }\n\n &:hover .", " {\n border: 1px solid ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n }\n "], ["\n .", " {\n .", " {\n border: 1px solid ", " !important;\n }\n\n .", " svg {\n color: ", ";\n }\n\n &:hover .", " {\n border: 1px solid ", ";\n }\n\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n }\n "])), outlinedInputClasses.disabled, outlinedInputClasses.notchedOutline, (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.borderDisabled, inputAdornmentClasses.root, (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.iconDisabled, outlinedInputClasses.notchedOutline, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
4034
4043
|
};
|
|
4035
4044
|
var StyledLabel$2 = styled("label")(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontBodyM$1, function (props) {
|
|
4036
4045
|
var spaces = getSpaces(props);
|
|
@@ -4042,11 +4051,11 @@ var StyledSearchBase = styled(TextField, {
|
|
|
4042
4051
|
},
|
|
4043
4052
|
})(templateObject_8$6 || (templateObject_8$6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4044
4053
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4045
|
-
var intent = props.intent, disabled = props.disabled, sdsStyle = props.sdsStyle, sdsStage = props.sdsStage
|
|
4054
|
+
var intent = props.intent, disabled = props.disabled, sdsStyle = props.sdsStyle, sdsStage = props.sdsStage;
|
|
4046
4055
|
var spaces = getSpaces(props);
|
|
4047
4056
|
var iconSizes = getIconSizes(props);
|
|
4048
4057
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
4049
|
-
return css(templateObject_7$7 || (templateObject_7$7 = __makeTemplateObject(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 120px;\n display: block;\n\n [type=\"search\"]::-webkit-search-cancel-button {\n -webkit-appearance: none;\n appearance: none;\n }\n\n & .input-search-clear-icon {\n opacity: 0;\n cursor: pointer;\n\n svg {\n height: ", "px;\n width: ", "px;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n background-color: ", ";\n\n .", " {\n border: 1px solid ", ";\n }\n\n &:hover .input-search-clear-icon,\n &:focus-within .input-search-clear-icon {\n opacity:
|
|
4058
|
+
return css(templateObject_7$7 || (templateObject_7$7 = __makeTemplateObject(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 120px;\n display: block;\n\n [type=\"search\"]::-webkit-search-cancel-button {\n -webkit-appearance: none;\n appearance: none;\n }\n\n & .input-search-clear-icon {\n opacity: 0;\n cursor: pointer;\n\n svg {\n height: ", "px;\n width: ", "px;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n background-color: ", ";\n\n .", " {\n border: 1px solid ", ";\n }\n\n &:hover .input-search-clear-icon,\n &:focus-within .input-search-clear-icon {\n opacity: 1;\n\n svg {\n color: ", " !important;\n }\n\n &:hover {\n svg {\n color: ", " !important;\n }\n }\n\n &:active {\n svg {\n color: ", " !important;\n }\n }\n }\n }\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", ":hover\n .", " {\n border: 1px solid ", ";\n }\n\n .", ".", " {\n outline: none;\n\n .", " {\n border: 1px solid ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n\n &.user-is-tabbing .", ":focus-within {\n outline: 2px solid black;\n outline-offset: 1px;\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 120px;\n display: block;\n\n [type=\"search\"]::-webkit-search-cancel-button {\n -webkit-appearance: none;\n appearance: none;\n }\n\n & .input-search-clear-icon {\n opacity: 0;\n cursor: pointer;\n\n svg {\n height: ", "px;\n width: ", "px;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n background-color: ", ";\n\n .", " {\n border: 1px solid ", ";\n }\n\n &:hover .input-search-clear-icon,\n &:focus-within .input-search-clear-icon {\n opacity: 1;\n\n svg {\n color: ", " !important;\n }\n\n &:hover {\n svg {\n color: ", " !important;\n }\n }\n\n &:active {\n svg {\n color: ", " !important;\n }\n }\n }\n }\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", ":hover\n .", " {\n border: 1px solid ", ";\n }\n\n .", ".", " {\n outline: none;\n\n .", " {\n border: 1px solid ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n\n &.user-is-tabbing .", ":focus-within {\n outline: 2px solid black;\n outline-offset: 1px;\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.xl, (_a = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _a === void 0 ? void 0 : _a.height, (_b = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _b === void 0 ? void 0 : _b.width, outlinedInputClasses.root, spaces === null || spaces === void 0 ? void 0 : spaces.m, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.surface, outlinedInputClasses.notchedOutline, (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.border, (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.icon, (_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _f === void 0 ? void 0 : _f.fillHover, (_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _g === void 0 ? void 0 : _g.fillPressed, inputBaseClasses.inputSizeSmall, fontBodyXs$2(props), spaces === null || spaces === void 0 ? void 0 : spaces.xs, spaces === null || spaces === void 0 ? void 0 : spaces.s, (_h = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _h === void 0 ? void 0 : _h.surface, outlinedInputClasses.root, outlinedInputClasses.notchedOutline, (_j = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _j === void 0 ? void 0 : _j.borderHover, outlinedInputClasses.root, outlinedInputClasses.focused, outlinedInputClasses.notchedOutline, (_k = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _k === void 0 ? void 0 : _k.border, inputAdornmentClasses.root, buttonBaseClasses.root, (_l = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _l === void 0 ? void 0 : _l.icon, outlinedInputClasses.root, sdsStyle === "rounded" && rounded$3(props), intent === "error" && error$3(props), intent === "warning" && warning$3(props), disabled && disabledStyled$2(props), sdsStage === "userInput" && userInput$2(props));
|
|
4050
4059
|
});
|
|
4051
4060
|
var StyledInputAdornment = styled(InputAdornment)(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n height: unset;\n margin: 0;\n"], ["\n position: relative;\n height: unset;\n margin: 0;\n"])));
|
|
4052
4061
|
var templateObject_1$M, templateObject_2$u, templateObject_3$m, templateObject_4$j, templateObject_5$d, templateObject_6$9, templateObject_7$7, templateObject_8$6, templateObject_9$2;
|
|
@@ -4159,11 +4168,78 @@ var MenuItem = forwardRef(function MenuItem(props, ref) {
|
|
|
4159
4168
|
return (jsxs(StyledMenuItem$1, __assign({}, originalMenuItemProps, { disabled: disabled, ref: ref, children: [isMultiSelect && selectionIcon(), jsxs(ContentWrapper, { children: [jsxs(TextWrapper, { selected: selected, className: "primary-text", disabled: disabled, children: [iconItem(), children] }), column && jsx(ColumnWrapper, { disabled: disabled, children: column })] })] })));
|
|
4160
4169
|
});
|
|
4161
4170
|
|
|
4171
|
+
/**
|
|
4172
|
+
* Adds a 'user-is-tabbing' class and a 'data-user-is-tabbing' attribute to the provided element when the user starts navigating
|
|
4173
|
+
* with the keyboard. This is useful for styling focus outlines differently when the user is using the keyboard to tab through elements.
|
|
4174
|
+
* It is particularly beneficial for input elements where the styles for :focus and :focus-visible are identical,
|
|
4175
|
+
* unlike button elements which have both :focus and :focus-visible states available to style separately.
|
|
4176
|
+
* By detecting when the user is tabbing, we can apply different styles for :focus and :focus-visible states.
|
|
4177
|
+
*
|
|
4178
|
+
* @param {HTMLElement} element - The element to which the 'user-is-tabbing' class will be added.
|
|
4179
|
+
* @returns {Function} A function to remove the 'user-is-tabbing' class and 'data-user-is-tabbing' attribute and clean up the event listeners.
|
|
4180
|
+
*/
|
|
4181
|
+
var detectUserTabbing = function (element) {
|
|
4182
|
+
if (!element)
|
|
4183
|
+
return;
|
|
4184
|
+
var removed = false;
|
|
4185
|
+
function handleFirstTab(e) {
|
|
4186
|
+
if (e.code === "Tab") {
|
|
4187
|
+
element.classList.add("user-is-tabbing");
|
|
4188
|
+
element.setAttribute("data-user-is-tabbing", "true");
|
|
4189
|
+
window.removeEventListener("keydown", handleFirstTab);
|
|
4190
|
+
window.addEventListener("mousedown", handleMouseDownOnce);
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
function handleMouseDownOnce() {
|
|
4194
|
+
element.classList.remove("user-is-tabbing");
|
|
4195
|
+
element.removeAttribute("data-user-is-tabbing");
|
|
4196
|
+
window.removeEventListener("mousedown", handleMouseDownOnce);
|
|
4197
|
+
window.addEventListener("keydown", handleFirstTab);
|
|
4198
|
+
}
|
|
4199
|
+
window.addEventListener("keydown", handleFirstTab);
|
|
4200
|
+
return function () {
|
|
4201
|
+
if (removed) {
|
|
4202
|
+
return;
|
|
4203
|
+
}
|
|
4204
|
+
removed = true;
|
|
4205
|
+
window.removeEventListener("keydown", handleFirstTab);
|
|
4206
|
+
window.removeEventListener("mousedown", handleMouseDownOnce);
|
|
4207
|
+
};
|
|
4208
|
+
};
|
|
4209
|
+
/**
|
|
4210
|
+
* Custom hook that listens for keyboard and mouse events to detect when
|
|
4211
|
+
* the user is tabbing through elements.
|
|
4212
|
+
*
|
|
4213
|
+
* @param {React.RefObject} ref - The ref to the element to which the 'user-is-tabbing' class
|
|
4214
|
+
* and 'data-user-is-tabbing' attribute will be added.
|
|
4215
|
+
*/
|
|
4216
|
+
var useDetectUserTabbing = function (ref) {
|
|
4217
|
+
useEffect(function () {
|
|
4218
|
+
if (ref.current) {
|
|
4219
|
+
var destroyListener_1 = detectUserTabbing(ref.current);
|
|
4220
|
+
return function () { return destroyListener_1 === null || destroyListener_1 === void 0 ? void 0 : destroyListener_1(); };
|
|
4221
|
+
}
|
|
4222
|
+
}, [ref]);
|
|
4223
|
+
};
|
|
4224
|
+
|
|
4162
4225
|
/**
|
|
4163
4226
|
* @see https://mui.com/material-ui/react-text-field/
|
|
4164
4227
|
*/
|
|
4165
4228
|
var InputSearch = forwardRef(function InputSearch(props, ref) {
|
|
4166
|
-
var label = props.label, id = props.id, placeholder = props.placeholder, _a = props.sdsStyle, sdsStyle = _a === void 0 ? "square" : _a, _b = props.intent, intent = _b === void 0 ? "default" : _b, handleSubmit = props.handleSubmit, onChange = props.onChange, rest = __rest(props, ["label", "id", "placeholder", "sdsStyle", "intent", "handleSubmit", "onChange"]);
|
|
4229
|
+
var label = props.label, id = props.id, placeholder = props.placeholder, _a = props.sdsStyle, sdsStyle = _a === void 0 ? "square" : _a, _b = props.intent, intent = _b === void 0 ? "default" : _b, handleSubmit = props.handleSubmit, onChange = props.onChange, disabled = props.disabled, rest = __rest(props, ["label", "id", "placeholder", "sdsStyle", "intent", "handleSubmit", "onChange", "disabled"]);
|
|
4230
|
+
/**
|
|
4231
|
+
* (masoudmanson): In case that the ref is not provided, we will create a new one.
|
|
4232
|
+
*/
|
|
4233
|
+
var inputRef = useRef(null);
|
|
4234
|
+
/**
|
|
4235
|
+
* (masoudmanson): This is a custom hook that listens for keyboard and mouse events
|
|
4236
|
+
* and adds a 'user-is-tabbing' class to the body element when the user starts
|
|
4237
|
+
* navigating with the keyboard. Unlike button elements which have both :focus
|
|
4238
|
+
* and :focus-visible states available to style separately, input elements have
|
|
4239
|
+
* identical styles for :focus and :focus-visible states. By detecting when the
|
|
4240
|
+
* user is tabbing, we can apply different styles for :focus and :focus-visible states.
|
|
4241
|
+
*/
|
|
4242
|
+
useDetectUserTabbing((ref ? ref : inputRef));
|
|
4167
4243
|
var _c = useState(false), hasValue = _c[0], setHasValue = _c[1];
|
|
4168
4244
|
var _d = useState(""), value = _d[0], setValue = _d[1];
|
|
4169
4245
|
var handleChange = function (event) {
|
|
@@ -4208,16 +4284,16 @@ var InputSearch = forwardRef(function InputSearch(props, ref) {
|
|
|
4208
4284
|
console.error("Error: @czi-sds/components component InputText requires id and label props for accessibility.");
|
|
4209
4285
|
return jsx(Fragment, {});
|
|
4210
4286
|
}
|
|
4211
|
-
return (jsxs(Fragment, { children: [jsx(StyledLabel$2, { htmlFor: id, children: label }), jsx(StyledSearchBase, __assign({ ref: ref,
|
|
4287
|
+
return (jsxs(Fragment, { children: [jsx(StyledLabel$2, { htmlFor: id, children: label }), jsx(StyledSearchBase, __assign({ id: id, ref: ref ? ref : inputRef,
|
|
4212
4288
|
// passed to mui Input
|
|
4213
4289
|
InputProps: {
|
|
4214
|
-
endAdornment: (jsx(StyledInputAdornment, { position: "end", children: jsx(Button, { "aria-label": "clear-button", className: "input-search-clear-icon", onClick: clearInput, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", sdsIconProps: {
|
|
4290
|
+
endAdornment: (jsx(StyledInputAdornment, { position: "end", children: jsx(Button, { "aria-label": "clear-button", className: "input-search-clear-icon", onClick: clearInput, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", disabled: disabled, sdsIconProps: {
|
|
4215
4291
|
sdsType: "iconButton",
|
|
4216
4292
|
}, icon: "XMarkCircle" }) })),
|
|
4217
|
-
startAdornment: (jsx(StyledInputAdornment, { position: "start", children: jsx(Button, { "aria-label": "search-button", onClick: localHandleSubmit, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", sdsIconProps: {
|
|
4293
|
+
startAdornment: (jsx(StyledInputAdornment, { position: "start", children: jsx(Button, { "aria-label": "search-button", onClick: localHandleSubmit, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", disabled: disabled, sdsIconProps: {
|
|
4218
4294
|
sdsType: "interactive",
|
|
4219
4295
|
}, icon: "Search" }) })),
|
|
4220
|
-
}, type: "search",
|
|
4296
|
+
}, type: "search", variant: "outlined", size: "small", placeholder: placeholder, value: value, sdsStyle: sdsStyle, sdsStage: hasValue ? "userInput" : "default", onChange: handleChange, onKeyDown: handleKeyPress, intent: intent, disabled: disabled,
|
|
4221
4297
|
/**
|
|
4222
4298
|
* (masoudmanson): This prevents the browser's default auto completion
|
|
4223
4299
|
* menu from being displayed for the InputSearch.
|
|
@@ -4242,7 +4318,7 @@ var StyledAutocompleteBase = styled(Autocomplete$1, {
|
|
|
4242
4318
|
var borders = getBorders(props);
|
|
4243
4319
|
var semanticTextColors = getSemanticTextColors(props);
|
|
4244
4320
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
4245
|
-
return "\n ".concat(!search && "height: 0", ";\n\n .MuiOutlinedInput-root.MuiInputBase-formControl.MuiInputBase-adornedEnd {\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n\n .MuiAutocomplete-input {\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n }\n\n & + .").concat(autocompleteClasses.popper, " > .").concat(autocompleteClasses.paper, " {\n .").concat(autocompleteClasses.listbox, " {\n max-height: 40vh;\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;\n\n .").concat(autocompleteClasses.option, " {\n min-height: unset;\n\n &.").concat(autocompleteClasses.focused, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceSecondary, ";\n }\n\n &[aria-selected=\"true\"] {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.surfacePrimary, ";\n }\n\n &[aria-disabled=\"true\"] {\n opacity: 1;\n }\n\n &[aria-selected=\"true\"].").concat(autocompleteClasses.focused, " {\n background-color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.surfaceSecondary, ";\n }\n }\n\n & > li:last-child .").concat(autocompleteClasses.groupUl, " {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n }\n }\n\n .").concat(autocompleteClasses.groupLabel, " {\n top: 0;\n color: ").concat((_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.secondary, ";\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n\n .").concat(autocompleteClasses.groupUl, " {\n position: relative;\n margin: 0 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n border-bottom: ").concat((_e = borders === null || borders === void 0 ? void 0 : borders.base) === null || _e === void 0 ? void 0 : _e.divider, ";\n padding-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;\n\n & li:last-of-type {\n position: relative;\n }\n }\n\n .").concat(autocompleteClasses.noOptions, " {\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n .").concat(autocompleteClasses.loading, " {\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;\n }\n }\n ");
|
|
4321
|
+
return "\n ".concat(!search && "height: 0", ";\n \n // (masoudmanson): We need to apply the focus styles to the input element\n // when the user is tabbing through the options. To find out more, take a\n // look at the useDetectUserTabbing hook.\n &[data-user-is-tabbing=\"true\"]:focus-within {\n border-radius: 4px;\n outline: 2px solid black;\n outline-offset: 1px;\n }\n\n .MuiFormControl-root {\n outline: none;\n }\n\n .MuiOutlinedInput-root.MuiInputBase-formControl.MuiInputBase-adornedEnd {\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n\n .MuiAutocomplete-input {\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n }\n\n & + .").concat(autocompleteClasses.popper, " > .").concat(autocompleteClasses.paper, " {\n .").concat(autocompleteClasses.listbox, " {\n max-height: 40vh;\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;\n\n .").concat(autocompleteClasses.option, " {\n min-height: unset;\n\n &.").concat(autocompleteClasses.focused, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceSecondary, ";\n }\n\n &[aria-selected=\"true\"] {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.surfacePrimary, ";\n }\n\n &[aria-disabled=\"true\"] {\n opacity: 1;\n }\n\n &[aria-selected=\"true\"].").concat(autocompleteClasses.focused, " {\n background-color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.surfaceSecondary, ";\n }\n }\n\n & > li:last-child .").concat(autocompleteClasses.groupUl, " {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n }\n }\n\n .").concat(autocompleteClasses.groupLabel, " {\n top: 0;\n color: ").concat((_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.secondary, ";\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n\n .").concat(autocompleteClasses.groupUl, " {\n position: relative;\n margin: 0 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n border-bottom: ").concat((_e = borders === null || borders === void 0 ? void 0 : borders.base) === null || _e === void 0 ? void 0 : _e.divider, ";\n padding-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;\n\n & li:last-of-type {\n position: relative;\n }\n }\n\n .").concat(autocompleteClasses.noOptions, " {\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n .").concat(autocompleteClasses.loading, " {\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;\n }\n }\n ");
|
|
4246
4322
|
});
|
|
4247
4323
|
var InputBaseWrapper$1 = styled("div", {
|
|
4248
4324
|
shouldForwardProp: function (prop) { return !doNotForwardProps$n.includes(prop); },
|
|
@@ -4252,7 +4328,7 @@ var InputBaseWrapper$1 = styled("div", {
|
|
|
4252
4328
|
// (thuang): We cannot use `display: none;` here, since
|
|
4253
4329
|
// the component needs to be in the DOM to handle backdrop
|
|
4254
4330
|
// click to close the menu
|
|
4255
|
-
return "\n border: 0;\n padding: 0;\n white-space: nowrap;\n clip-path: inset(100%);\n clip: rect(0 0 0 0);\n overflow: hidden;\n margin: 0;\n ";
|
|
4331
|
+
return "\n border: 0;\n padding: 0;\n white-space: nowrap;\n clip-path: inset(100%);\n clip: rect(0 0 0 0);\n overflow: hidden;\n margin: 0;\n speak: none;\n ";
|
|
4256
4332
|
}
|
|
4257
4333
|
});
|
|
4258
4334
|
var StyledMenuInputSearch$1 = styled(InputSearch, {
|
|
@@ -4279,10 +4355,12 @@ var StyledMenuItemText = styled("div")(templateObject_6$7 || (templateObject_6$7
|
|
|
4279
4355
|
var templateObject_1$K, templateObject_2$s, templateObject_3$k, templateObject_4$h, templateObject_5$b, templateObject_6$7;
|
|
4280
4356
|
|
|
4281
4357
|
var AutocompleteBase = function (props) {
|
|
4282
|
-
var multiple = props.multiple, _a = props.disableCloseOnSelect, disableCloseOnSelect = _a === void 0 ? multiple : _a, _b = props.getOptionLabel, getOptionLabel = _b === void 0 ? defaultGetOptionLabel : _b, _c = props.InputBaseProps, InputBaseProps = _c === void 0 ? EMPTY_OBJECT : _c, _d = props.isOptionEqualToValue, isOptionEqualToValue = _d === void 0 ? defaultIsOptionEqualToValue : _d, _e = props.keepSearchOnSelect, keepSearchOnSelect = _e === void 0 ? false : _e, _f = props.label, label = _f === void 0 ? "Label" : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? noop : _k, _l = props.renderOption, renderOption = _l === void 0 ? defaultRenderOption : _l, _m = props.renderTags, renderTags = _m === void 0 ? defaultRenderTags : _m, _o = props.search, search = _o === void 0 ? false : _o, _p = props.clearOnBlur, clearOnBlur = _p === void 0 ? false : _p, _q = props.blurOnSelect, blurOnSelect = _q === void 0 ? !multiple : _q, onClickAway = props.onClickAway, onClick = props.onClick, onOpen = props.onOpen, onClose = props.onClose;
|
|
4358
|
+
var multiple = props.multiple, _a = props.disableCloseOnSelect, disableCloseOnSelect = _a === void 0 ? multiple : _a, _b = props.getOptionLabel, getOptionLabel = _b === void 0 ? defaultGetOptionLabel : _b, _c = props.InputBaseProps, InputBaseProps = _c === void 0 ? EMPTY_OBJECT : _c, _d = props.isOptionEqualToValue, isOptionEqualToValue = _d === void 0 ? defaultIsOptionEqualToValue : _d, _e = props.keepSearchOnSelect, keepSearchOnSelect = _e === void 0 ? false : _e, _f = props.label, label = _f === void 0 ? "Label" : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? noop : _k, _l = props.renderOption, renderOption = _l === void 0 ? defaultRenderOption : _l, _m = props.renderTags, renderTags = _m === void 0 ? defaultRenderTags : _m, _o = props.search, search = _o === void 0 ? false : _o, _p = props.clearOnBlur, clearOnBlur = _p === void 0 ? false : _p, _q = props.blurOnSelect, blurOnSelect = _q === void 0 ? !multiple : _q, onClickAway = props.onClickAway, onClick = props.onClick, onOpen = props.onOpen, onClose = props.onClose, disabled = props.disabled;
|
|
4283
4359
|
var theme = useTheme();
|
|
4360
|
+
var ref = useRef(null);
|
|
4284
4361
|
var _r = useState(""), inputValue = _r[0], setInputValue = _r[1];
|
|
4285
|
-
|
|
4362
|
+
useDetectUserTabbing(ref);
|
|
4363
|
+
return (jsx(StyledAutocompleteBase, __assign({ ref: ref, clearOnBlur: clearOnBlur, disableCloseOnSelect: disableCloseOnSelect, disablePortal: true, renderTags: renderTags, loading: loading, loadingText: loadingText, noOptionsText: noOptionsText, PaperComponent: StyledPaper$3, PopperComponent: useDefaultPopperComponent(), renderOption: renderOption, getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, inputValue: inputValue, renderInput: defaultRenderInput, multiple: multiple,
|
|
4286
4364
|
/**
|
|
4287
4365
|
* (masoudmanson): Overrides the onOpen and onClose handlers to ensure that
|
|
4288
4366
|
* the onClick and onClickAway handlers are triggered when a controlled dropdown
|
|
@@ -4310,7 +4388,7 @@ var AutocompleteBase = function (props) {
|
|
|
4310
4388
|
* the provided onInputChange from props is called at the end to emit the input changes
|
|
4311
4389
|
* to the user.
|
|
4312
4390
|
*/
|
|
4313
|
-
onInputChange: defaultOnInputChange })));
|
|
4391
|
+
onInputChange: defaultOnInputChange, disabled: disabled || !search })));
|
|
4314
4392
|
/**
|
|
4315
4393
|
* (masoudmanson): Using a custom Popper or Paper with the Autocomplete
|
|
4316
4394
|
* without a useCallback results in scroll jumps while selecting an option!
|
|
@@ -4330,20 +4408,32 @@ var AutocompleteBase = function (props) {
|
|
|
4330
4408
|
}, []);
|
|
4331
4409
|
}
|
|
4332
4410
|
function defaultRenderInput(params) {
|
|
4333
|
-
return (jsx(InputBaseWrapper$1, { search: search, children: jsx(StyledMenuInputSearch$1, __assign({ id: "location-search", label:
|
|
4411
|
+
return (jsx(InputBaseWrapper$1, { search: search, children: jsx(StyledMenuInputSearch$1, __assign({ id: "location-search", "aria-label": "Search Input",
|
|
4412
|
+
// (masoudmanson): This is to ensure that the input field won't be focusable
|
|
4413
|
+
// when the search prop is set to false.
|
|
4414
|
+
tabIndex: search ? 0 : -1, "aria-hidden": !search, label: label, placeholder: label, ref: params.InputProps.ref, search: search,
|
|
4334
4415
|
// (masoudmanson): This prevents Backspace from deselecting selected dropdown options.
|
|
4335
4416
|
onKeyDown: function (event) {
|
|
4336
4417
|
if (event.key === "Backspace") {
|
|
4337
4418
|
event.stopPropagation();
|
|
4338
4419
|
}
|
|
4339
|
-
}, InputProps: __assign(__assign({
|
|
4420
|
+
}, InputProps: __assign(__assign({}, params.InputProps.ref), { "aria-hidden": !search, endAdornment: (jsx(StyledInputAdornment, { position: "end", children: inputValue && (jsx(Button
|
|
4421
|
+
// (masoudmanson): This is to ensure that the clear button won't be focusable
|
|
4422
|
+
// when the search prop is set to false.
|
|
4423
|
+
, {
|
|
4424
|
+
// (masoudmanson): This is to ensure that the clear button won't be focusable
|
|
4425
|
+
// when the search prop is set to false.
|
|
4426
|
+
tabIndex: search ? 0 : -1, "aria-hidden": !search, disabled: !search, "aria-label": "Clear Button", className: "input-search-clear-icon", onClick: clearInput, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", sdsIconProps: {
|
|
4427
|
+
sdsType: "iconButton",
|
|
4428
|
+
}, icon: "XMarkCircle" })) })),
|
|
4340
4429
|
/**
|
|
4341
4430
|
* (thuang): Works with css caret-color: "transparent" to hide
|
|
4342
4431
|
* mobile keyboard
|
|
4343
4432
|
*/
|
|
4344
|
-
inputMode: search ? "text" : "none"
|
|
4345
|
-
|
|
4346
|
-
|
|
4433
|
+
inputMode: search ? "text" : "none", inputProps: params.inputProps, startAdornment: (jsx(StyledInputAdornment, { position: "start", children: jsx(Button, { "aria-label": "Search Button",
|
|
4434
|
+
// (masoudmanson): This is to ensure that the search button won't be focusable
|
|
4435
|
+
// when the search prop is set to false.
|
|
4436
|
+
tabIndex: search ? 0 : -1, "aria-hidden": !search, disabled: !search, onClick: clearInput, sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", sdsIconProps: {
|
|
4347
4437
|
sdsType: "interactive",
|
|
4348
4438
|
}, icon: "Search" }) })) }) }, InputBaseProps)) }));
|
|
4349
4439
|
}
|
|
@@ -4547,6 +4637,7 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4547
4637
|
}, [isOpenControlled, open]);
|
|
4548
4638
|
var anchorRef = useRef(null);
|
|
4549
4639
|
var _h = React__default.useState(null), anchorEl = _h[0], setAnchorEl = _h[1];
|
|
4640
|
+
useDetectUserTabbing(anchorRef);
|
|
4550
4641
|
useEffect(function () {
|
|
4551
4642
|
setAnchorEl(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
4552
4643
|
}, [anchorRef]);
|
|
@@ -4588,7 +4679,7 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4588
4679
|
* inner autocompletes should remain hidden and unfocused when the parent
|
|
4589
4680
|
* input is focused. This prevents blurring of the main search input.
|
|
4590
4681
|
*/
|
|
4591
|
-
InputBaseProps: __assign(__assign({}, InputBaseProps), { autoFocus: false }), popperOpen: popperOpen, inputValue: inputValue, PaperComponent: StyledPaper$2 }, rest), autocompleteOptions.name)); }) }) })))] }) })));
|
|
4682
|
+
InputBaseProps: __assign(__assign({}, InputBaseProps), { autoFocus: false, tabIndex: -1 }), popperOpen: popperOpen, inputValue: inputValue, PaperComponent: StyledPaper$2 }, rest), autocompleteOptions.name)); }) }) })))] }) })));
|
|
4592
4683
|
function clearInput() {
|
|
4593
4684
|
setInputValue("");
|
|
4594
4685
|
/**
|
|
@@ -4685,6 +4776,11 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4685
4776
|
}
|
|
4686
4777
|
setPopperOpen(false);
|
|
4687
4778
|
}
|
|
4779
|
+
else {
|
|
4780
|
+
// (masoudmanson): This is to open the dropdown when the user types in the search input.
|
|
4781
|
+
// especially when the user is tabbing through the input.
|
|
4782
|
+
setPopperOpen(true);
|
|
4783
|
+
}
|
|
4688
4784
|
}
|
|
4689
4785
|
}
|
|
4690
4786
|
};
|
|
@@ -5002,11 +5098,14 @@ var Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
|
5002
5098
|
return jsx(Fragment, { children: children });
|
|
5003
5099
|
var content = (jsxs(Fragment, { children: [title, sdsStyle === "dark" && subtitle && jsx(Subtitle$1, { children: subtitle })] }));
|
|
5004
5100
|
var leaveDelay = inverted || sdsStyle === "dark" ? 0 : 500;
|
|
5005
|
-
return (jsx(Tooltip$1, __assign({ classes: { arrow: arrow, tooltip: tooltip }, leaveDelay: leaveDelay, title: content, PopperComponent: PopperComponent,
|
|
5101
|
+
return (jsx(Tooltip$1, __assign({ classes: { arrow: arrow, tooltip: tooltip }, leaveDelay: leaveDelay, title: content, PopperComponent: PopperComponent,
|
|
5102
|
+
// (masoudmanson): Setting tabIndex to 0 makes the tooltip component
|
|
5103
|
+
// focusable and allows keyboard navigation.
|
|
5104
|
+
tabIndex: 0, ref: ref,
|
|
5006
5105
|
// (masoudmanson): SDS Tooltips should always have an arrow
|
|
5007
5106
|
// and by setting the arrow prop to true, we ensure that
|
|
5008
5107
|
// the arrow is always rendered.
|
|
5009
|
-
arrow: true })));
|
|
5108
|
+
arrow: true }, rest)));
|
|
5010
5109
|
});
|
|
5011
5110
|
function mergeClass$1(_a) {
|
|
5012
5111
|
var props = _a.props, className = _a.className, key = _a.key;
|
|
@@ -5046,10 +5145,10 @@ var verticalAlignToFlexMap = {
|
|
|
5046
5145
|
};
|
|
5047
5146
|
var StyledTableData = styled("td", {
|
|
5048
5147
|
shouldForwardProp: function (prop) { return !doNotForwardProps$j.includes(prop); },
|
|
5049
|
-
})(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyS$1, function (props) {
|
|
5148
|
+
})(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n ", "\n ", "\n\n ", "\n"], ["\n ", "\n ", "\n\n ", "\n"])), fontBodyS$1, focusVisibleA11yStyle, function (props) {
|
|
5050
5149
|
var _a = props.horizontalAlign, horizontalAlign = _a === void 0 ? "left" : _a, _b = props.verticalAlign, verticalAlign = _b === void 0 ? "top" : _b;
|
|
5051
5150
|
var spaces = getSpaces(props);
|
|
5052
|
-
return "\n padding: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n text-align: ").concat(horizontalAlign, ";\n vertical-align: ").concat(verticalAlignCSSMap[verticalAlign], ";\n
|
|
5151
|
+
return "\n padding: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n text-align: ").concat(horizontalAlign, ";\n vertical-align: ").concat(verticalAlignCSSMap[verticalAlign], ";\n overflow: hidden;\n ");
|
|
5053
5152
|
});
|
|
5054
5153
|
var ShouldWrap = function (lineCount) {
|
|
5055
5154
|
return "\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: ".concat(lineCount, ";\n -webkit-box-orient: vertical; \n ");
|
|
@@ -5125,7 +5224,7 @@ var CellBasic = forwardRef(function (props, ref) {
|
|
|
5125
5224
|
var doNotForwardProps$i = ["horizontalAlign", "verticalAlign"];
|
|
5126
5225
|
var StyledCellComponentData = styled("td", {
|
|
5127
5226
|
shouldForwardProp: function (prop) { return !doNotForwardProps$i.includes(prop); },
|
|
5128
|
-
})(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyS$1, function (props) {
|
|
5227
|
+
})(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n ", "\n ", "\n\n ", "\n"], ["\n ", "\n ", "\n\n ", "\n"])), fontBodyS$1, focusVisibleA11yStyle, function (props) {
|
|
5129
5228
|
var spaces = getSpaces(props);
|
|
5130
5229
|
var _a = props.horizontalAlign, horizontalAlign = _a === void 0 ? "left" : _a, _b = props.verticalAlign, verticalAlign = _b === void 0 ? "top" : _b;
|
|
5131
5230
|
return "\n align-items: center;\n text-align: ".concat(horizontalAlign, ";\n vertical-align: ").concat(verticalAlign, ";\n overflow: hidden;\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n ");
|
|
@@ -5161,7 +5260,7 @@ var StyledSortingIcon = styled(Icon, {
|
|
|
5161
5260
|
});
|
|
5162
5261
|
var StyledTableHeader$1 = styled("th", {
|
|
5163
5262
|
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
5164
|
-
})(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontHeaderS, function (props) {
|
|
5263
|
+
})(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n ", "\n ", "\n\n ", "\n"], ["\n ", "\n ", "\n\n ", "\n"])), fontHeaderS, focusVisibleA11yStyle, function (props) {
|
|
5165
5264
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5166
5265
|
var _j = props.active, active = _j === void 0 ? false : _j, _k = props.horizontalAlign, horizontalAlign = _k === void 0 ? "left" : _k;
|
|
5167
5266
|
var spaces = getSpaces(props);
|
|
@@ -5333,7 +5432,7 @@ var StyledPaper$1 = styled(Paper, {
|
|
|
5333
5432
|
var spaces = getSpaces(props);
|
|
5334
5433
|
var borders = getBorders(props);
|
|
5335
5434
|
var shadows = getShadows(props);
|
|
5336
|
-
return "\n box-shadow: ".concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, " !important;\n border: ").concat(borders === null || borders === void 0 ? void 0 : borders.none, ";\n margin: 0;\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n\n .MuiFormControl-root.MuiTextField-root {\n margin-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n }\n ");
|
|
5435
|
+
return "\n box-shadow: ".concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, " !important;\n border: ").concat(borders === null || borders === void 0 ? void 0 : borders.none, ";\n margin: 0;\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n\n .MuiAutocomplete-root,\n .MuiFormControl-root.MuiTextField-root {\n margin-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n }\n\n // (masoudmanson): Remove margin-right and margin-bottom for the single column autocomplete\n // as it has been added to the parent container\n .MuiAutocomplete-root .MuiFormControl-root.MuiTextField-root {\n margin-right: 0;\n margin-bottom: 0; \n }\n ");
|
|
5337
5436
|
});
|
|
5338
5437
|
var templateObject_1$z, templateObject_2$k, templateObject_3$c, templateObject_4$b;
|
|
5339
5438
|
|
|
@@ -5344,9 +5443,9 @@ var DEFAULT_POPPER_BASE_PROPS = {
|
|
|
5344
5443
|
disablePortal: true,
|
|
5345
5444
|
};
|
|
5346
5445
|
var DropdownMenu = function (props) {
|
|
5347
|
-
var _a;
|
|
5446
|
+
var _a, _b;
|
|
5348
5447
|
var theme = useTheme();
|
|
5349
|
-
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps,
|
|
5448
|
+
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _c = props.open, open = _c === void 0 ? false : _c, _d = props.PopperComponent, PopperComponent = _d === void 0 ? StyledPopper : _d, _e = props.PaperComponent, PaperComponent = _e === void 0 ? StyledPaper$1 : _e, _f = props.PopperPlacement, PopperPlacement = _f === void 0 ? "bottom-start" : _f, _g = props.PopperBaseProps, PopperBaseProps = _g === void 0 ? {} : _g, _h = props.search, search = _h === void 0 ? false : _h, title = props.title, _j = props.label, label = _j === void 0 ? "Search" : _j, children = props.children, options = props.options, _k = props.onClickAway, onClickAway = _k === void 0 ? noop : _k, ClickAwayListenerProps = props.ClickAwayListenerProps, _l = props.width, width = _l === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _l, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "search", "title", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width"]);
|
|
5350
5449
|
var isMultiColumn = "options" in ((options === null || options === void 0 ? void 0 : options[0]) || EMPTY_OBJECT);
|
|
5351
5450
|
// (masoudmanson): The DropdownMenu's Popper component should have a minimum
|
|
5352
5451
|
// width of MINIMUM_DROPDOWN_MENU_POPPER_WIDTH pixels if the DropdownMenu is
|
|
@@ -5364,7 +5463,7 @@ var DropdownMenu = function (props) {
|
|
|
5364
5463
|
{
|
|
5365
5464
|
name: "offset",
|
|
5366
5465
|
options: {
|
|
5367
|
-
offset: [0, (_a = theme.app) === null || _a === void 0 ? void 0 : _a.spacing.s],
|
|
5466
|
+
offset: [0, (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.app) === null || _a === void 0 ? void 0 : _a.spacing) === null || _b === void 0 ? void 0 : _b.s],
|
|
5368
5467
|
},
|
|
5369
5468
|
},
|
|
5370
5469
|
], open: open, anchorEl: anchorEl, placement: PopperPlacement }, PopperBaseProps, {
|
|
@@ -5391,20 +5490,20 @@ var inputDropdownStyles = function (props) {
|
|
|
5391
5490
|
var spaces = getSpaces(props);
|
|
5392
5491
|
var borders = getBorders(props);
|
|
5393
5492
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5394
|
-
var
|
|
5493
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5395
5494
|
/**
|
|
5396
5495
|
* (masoudmanson)
|
|
5397
5496
|
* The top/bottom padding is set to 1px less than the actual value to account for the border.
|
|
5398
5497
|
*/
|
|
5399
5498
|
var padding = "".concat(((_a = spaces === null || spaces === void 0 ? void 0 : spaces.xs) !== null && _a !== void 0 ? _a : 6) - 1, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px");
|
|
5400
|
-
return css(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n ", "\n\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", ";\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: ", ";\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "], ["\n ", "\n\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", ";\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: ", ";\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "])), labelStyle(props), (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.default, (_c = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _c === void 0 ? void 0 : _c.primary, padding, (_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.primary, spaces === null || spaces === void 0 ? void 0 : spaces.s, spaces === null || spaces === void 0 ? void 0 : spaces.s, spaces === null || spaces === void 0 ? void 0 : spaces.l, (_e =
|
|
5499
|
+
return css(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n ", "\n\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", ";\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: ", ";\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "], ["\n ", "\n\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", ";\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: ", ";\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "])), labelStyle(props), (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.default, (_c = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _c === void 0 ? void 0 : _c.primary, padding, (_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.primary, spaces === null || spaces === void 0 ? void 0 : spaces.s, spaces === null || spaces === void 0 ? void 0 : spaces.s, spaces === null || spaces === void 0 ? void 0 : spaces.l, (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.icon, (_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, (_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _g === void 0 ? void 0 : _g.iconHover, (_h = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _h === void 0 ? void 0 : _h.primary, (_j = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _j === void 0 ? void 0 : _j.default, (_k = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _k === void 0 ? void 0 : _k.primary, (_l = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _l === void 0 ? void 0 : _l.icon);
|
|
5401
5500
|
};
|
|
5402
5501
|
var minimal$1 = function (props) {
|
|
5403
5502
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
5404
5503
|
var spaces = getSpaces(props);
|
|
5405
5504
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5406
|
-
var
|
|
5407
|
-
return css(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n ", "\n ", "\n\n /* this is needed to left align the label text */\n align-items: flex-start;\n border: none;\n flex-direction: column;\n padding: ", "px ", "px;\n\n /* Nesting to increase CSS specificity for style override */\n &.MuiButton-text {\n .styled-label {\n margin: 0;\n }\n }\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: ", ";\n border: none;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n background-color: ", ";\n border: none;\n }\n\n
|
|
5505
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5506
|
+
return css(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n ", "\n ", "\n\n /* this is needed to left align the label text */\n align-items: flex-start;\n border: none;\n flex-direction: column;\n padding: ", "px ", "px;\n\n /* Nesting to increase CSS specificity for style override */\n &.MuiButton-text {\n .styled-label {\n margin: 0;\n }\n }\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: ", ";\n border: none;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n background-color: ", ";\n border: none;\n }\n\n &.MuiButton-root.MuiButton-text > span {\n ", "\n margin-left: 0;\n }\n\n &.MuiButton-root.MuiButton-text svg {\n margin-left: ", "px;\n margin-right: 0;\n }\n "], ["\n ", "\n ", "\n\n /* this is needed to left align the label text */\n align-items: flex-start;\n border: none;\n flex-direction: column;\n padding: ", "px ", "px;\n\n /* Nesting to increase CSS specificity for style override */\n &.MuiButton-text {\n .styled-label {\n margin: 0;\n }\n }\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: ", ";\n border: none;\n color: ", ";\n\n path {\n fill: ", ";\n }\n\n .styled-label {\n color: ", ";\n }\n }\n\n &:active {\n background-color: ", ";\n border: none;\n }\n\n &.MuiButton-root.MuiButton-text > span {\n ", "\n margin-left: 0;\n }\n\n &.MuiButton-root.MuiButton-text svg {\n margin-left: ", "px;\n margin-right: 0;\n }\n "])), labelStyle(props), focusVisibleA11yStyle(), spaces === null || spaces === void 0 ? void 0 : spaces.xs, spaces === null || spaces === void 0 ? void 0 : spaces.s, (_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.secondary, (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.icon, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.fillHover, (_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.primary, (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.iconHover, (_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, (_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _g === void 0 ? void 0 : _g.fillHover, labelFontBodyS(props), spaces === null || spaces === void 0 ? void 0 : spaces.xs);
|
|
5408
5507
|
};
|
|
5409
5508
|
var square$1 = function (props) {
|
|
5410
5509
|
var corners = getCorners(props);
|
|
@@ -5415,18 +5514,22 @@ var rounded$1 = function (props) {
|
|
|
5415
5514
|
return css(templateObject_4$a || (templateObject_4$a = __makeTemplateObject(["\n border-radius: ", "px;\n min-width: 90px;\n "], ["\n border-radius: ", "px;\n min-width: 90px;\n "])), corners === null || corners === void 0 ? void 0 : corners.l);
|
|
5416
5515
|
};
|
|
5417
5516
|
var userInput$1 = function (props) {
|
|
5418
|
-
var _a, _b;
|
|
5517
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5518
|
+
var sdsStyle = props.sdsStyle;
|
|
5419
5519
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5420
|
-
|
|
5520
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5521
|
+
return css(templateObject_5$6 || (templateObject_5$6 = __makeTemplateObject(["\n & .styled-label {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n ", "\n "], ["\n & .styled-label {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n ", "\n "])), (_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.primary, (_b = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _b === void 0 ? void 0 : _b.primary, sdsStyle === "minimal"
|
|
5522
|
+
? "\n background-color: ".concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.fillHover, ";\n border: none;\n color: ").concat((_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _d === void 0 ? void 0 : _d.primary, ";\n\n path {\n fill: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.iconHover, ";\n }\n\n .styled-label {\n color: ").concat((_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, ";\n }\n ")
|
|
5523
|
+
: "");
|
|
5421
5524
|
};
|
|
5422
5525
|
var isOpen = function (props) {
|
|
5423
5526
|
var _a, _b;
|
|
5424
5527
|
var colors = getColors(props);
|
|
5425
5528
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5426
|
-
var
|
|
5529
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5427
5530
|
return css(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject(["\n ", "\n\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n\n &:hover {\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n }\n "], ["\n ", "\n\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n\n &:hover {\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n }\n "])), props.sdsStyle === "minimal"
|
|
5428
5531
|
? "& > span, &:hover > span { color: ".concat((_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.primary, "; }")
|
|
5429
|
-
: "", (_b =
|
|
5532
|
+
: "", (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _b === void 0 ? void 0 : _b.icon, colors === null || colors === void 0 ? void 0 : colors.blue[400], colors === null || colors === void 0 ? void 0 : colors.blue[400], colors === null || colors === void 0 ? void 0 : colors.blue[400]);
|
|
5430
5533
|
};
|
|
5431
5534
|
var warning$1 = function (props) {
|
|
5432
5535
|
var colors = getColors(props);
|
|
@@ -5441,8 +5544,8 @@ var error$1 = function (props) {
|
|
|
5441
5544
|
var isDisabled = function (props) {
|
|
5442
5545
|
var _a, _b, _c, _d;
|
|
5443
5546
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5444
|
-
var
|
|
5445
|
-
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "], ["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "])), (_a =
|
|
5547
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5548
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "], ["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "])), (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.borderDisabled, (_b = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _b === void 0 ? void 0 : _b.disabled, (_c = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _c === void 0 ? void 0 : _c.disabled, (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.fillDisabled);
|
|
5446
5549
|
};
|
|
5447
5550
|
/**
|
|
5448
5551
|
* (masoudmanson): `Button as React.ComponentType<InputDropdownProps>` is a
|
|
@@ -5454,7 +5557,7 @@ var isDisabled = function (props) {
|
|
|
5454
5557
|
*/
|
|
5455
5558
|
var StyledInputDropdown = styled(Button, {
|
|
5456
5559
|
shouldForwardProp: function (prop) { return !doNotForwardProps$e.includes(prop); },
|
|
5457
|
-
})(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"], ["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"])), labelFontBodyXs, function (props) {
|
|
5560
|
+
})(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n ", "\n outline-offset: 1px !important;\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"], ["\n ", "\n ", "\n outline-offset: 1px !important;\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"])), labelFontBodyXs, focusVisibleA11yStyle, function (props) {
|
|
5458
5561
|
var disabled = props.disabled, intent = props.intent, state = props.state, sdsStage = props.sdsStage, sdsStyle = props.sdsStyle;
|
|
5459
5562
|
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), inputDropdownStyles(props), sdsStyle === "minimal" && minimal$1(props), sdsStyle === "square" && square$1(props), sdsStyle === "rounded" && rounded$1(props), state === "open" && isOpen(props), sdsStage === "userInput" && userInput$1(props), intent === "warning" && warning$1(props), intent === "error" && error$1(props), disabled && isDisabled(props));
|
|
5460
5563
|
});
|
|
@@ -5484,9 +5587,9 @@ var StyledCounter = styled("span", {
|
|
|
5484
5587
|
var _a, _b;
|
|
5485
5588
|
var corners = getCorners(props);
|
|
5486
5589
|
var spaces = getSpaces(props);
|
|
5487
|
-
var
|
|
5590
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
5488
5591
|
var semanticTextColors = getSemanticTextColors(props);
|
|
5489
|
-
return "\n background-color: ".concat((_a =
|
|
5592
|
+
return "\n background-color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceTertiary, ";\n color: ").concat((_b = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _b === void 0 ? void 0 : _b.accent, ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;\n ");
|
|
5490
5593
|
});
|
|
5491
5594
|
var MinimalDetails = styled("div", {
|
|
5492
5595
|
shouldForwardProp: function (prop) { return !doNotForwardProps$e.includes(prop); },
|
|
@@ -5525,7 +5628,7 @@ var InputDropdown = function (props) {
|
|
|
5525
5628
|
var shouldRenderInlineMinimalDetails = isMinimal && sdsType === "value" && !multiple;
|
|
5526
5629
|
var shouldRenderMinimalDetails = isMinimal && sdsType === "label";
|
|
5527
5630
|
var shouldRenderCounter = multiple && counter !== undefined && counter !== "0" && !isMinimal;
|
|
5528
|
-
return (jsxs(StyledInputDropdown, __assign({}, props, { children: [jsxs(LabelWrapper, { isMinimal: isMinimal, children: [jsx(StyledLabel$1, { className: "styled-label", details: details, counter: counter, sdsType: sdsType, children: renderLabelText({
|
|
5631
|
+
return (jsxs(StyledInputDropdown, __assign({}, props, { "aria-label": "Dropdown input", children: [jsxs(LabelWrapper, { isMinimal: isMinimal, children: [jsx(StyledLabel$1, { className: "styled-label", details: details, counter: counter, sdsType: sdsType, children: renderLabelText({
|
|
5529
5632
|
counter: counter,
|
|
5530
5633
|
details: details,
|
|
5531
5634
|
isMinimal: isMinimal,
|
|
@@ -5669,7 +5772,7 @@ function createTypeCss(props, type) {
|
|
|
5669
5772
|
secondary: generateSecondaryTagColors(intent, colors, semanticColors),
|
|
5670
5773
|
};
|
|
5671
5774
|
var typeColors = typeToColors[type];
|
|
5672
|
-
return css(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject(["\n background-color: ", ";\n position: relative;\n\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n\n &:hover,\n &:active
|
|
5775
|
+
return css(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject(["\n ", "\n\n background-color: ", ";\n position: relative;\n\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n\n &:hover,\n &:active {\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n background-color: ", ";\n }x\n "], ["\n ", "\n\n background-color: ", ";\n position: relative;\n\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n\n &:hover,\n &:active {\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.Mui-focusVisible {\n background-color: ", ";\n }x\n "])), focusVisibleA11yStyle(), typeColors.background, typeColors.label, typeColors.iconColor, (_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.onFill, (_b = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _b === void 0 ? void 0 : _b.onFill, typeColors.backgroundHover, typeColors.backgroundClicked, typeColors.backgroundHover);
|
|
5673
5776
|
}
|
|
5674
5777
|
var typeToCss = {
|
|
5675
5778
|
primary: primary,
|
|
@@ -5705,10 +5808,10 @@ var Tag = function (props) {
|
|
|
5705
5808
|
};
|
|
5706
5809
|
|
|
5707
5810
|
var StyledTag = styled(Tag)(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
5708
|
-
var _a, _b;
|
|
5811
|
+
var _a, _b, _c, _d;
|
|
5709
5812
|
var spaces = getSpaces(props);
|
|
5710
5813
|
var iconSizes = getIconSizes(props);
|
|
5711
|
-
return css(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n padding: ", "px ", "px;\n\n &:after {\n display: none;\n }\n\n .MuiChip-label {\n ", "\n }\n\n .MuiChip-deleteIcon
|
|
5814
|
+
return css(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n padding: ", "px ", "px;\n\n &:after {\n display: none;\n }\n\n .MuiChip-label {\n ", "\n }\n\n .MuiChip-deleteIcon {\n margin: 0 0 0 ", "px;\n width: ", "px !important;\n height: ", "px !important;\n }\n\n .MuiSvgIcon-root {\n margin: 0;\n width: ", "px !important;\n height: ", "px !important;\n }\n\n .MuiChip-label,\n svg {\n z-index: auto;\n }\n "], ["\n padding: ", "px ", "px;\n\n &:after {\n display: none;\n }\n\n .MuiChip-label {\n ", "\n }\n\n .MuiChip-deleteIcon {\n margin: 0 0 0 ", "px;\n width: ", "px !important;\n height: ", "px !important;\n }\n\n .MuiSvgIcon-root {\n margin: 0;\n width: ", "px !important;\n height: ", "px !important;\n }\n\n .MuiChip-label,\n svg {\n z-index: auto;\n }\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.xxs, spaces === null || spaces === void 0 ? void 0 : spaces.s, fontHeaderXs(props), spaces === null || spaces === void 0 ? void 0 : spaces.s, (_a = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _a === void 0 ? void 0 : _a.width, (_b = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _b === void 0 ? void 0 : _b.height, (_c = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _c === void 0 ? void 0 : _c.width, (_d = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs) === null || _d === void 0 ? void 0 : _d.height);
|
|
5712
5815
|
});
|
|
5713
5816
|
var templateObject_1$w, templateObject_2$h;
|
|
5714
5817
|
|
|
@@ -5798,18 +5901,14 @@ var ComplexFilter = function (_a) {
|
|
|
5798
5901
|
if (multiple) {
|
|
5799
5902
|
if (isTriggerChangeOnOptionClick) {
|
|
5800
5903
|
setPendingValue(newValue);
|
|
5801
|
-
return
|
|
5904
|
+
return setValue(newValue);
|
|
5802
5905
|
}
|
|
5803
5906
|
return setPendingValue(newValue);
|
|
5804
5907
|
}
|
|
5805
|
-
|
|
5908
|
+
setValue(newValue);
|
|
5806
5909
|
if (!multiple)
|
|
5807
5910
|
setOpen(false);
|
|
5808
5911
|
}
|
|
5809
|
-
function setValueAndCallOnChange(event, newValue) {
|
|
5810
|
-
setValue(newValue);
|
|
5811
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
5812
|
-
}
|
|
5813
5912
|
function handleDelete(option) {
|
|
5814
5913
|
if (!multiple) {
|
|
5815
5914
|
return setValue(null);
|
|
@@ -6164,7 +6263,7 @@ var StyledCheckbox = styled(Checkbox)(templateObject_1$o || (templateObject_1$o
|
|
|
6164
6263
|
warning: "notice",
|
|
6165
6264
|
};
|
|
6166
6265
|
var checkboxColor = intentToColor[intent];
|
|
6167
|
-
return "\n color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors[checkboxColor]) === null || _a === void 0 ? void 0 : _a.border, ";\n\n &:hover {\n color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(checkboxClasses.disabled, " {\n color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, ";\n }\n\n &.").concat(checkboxClasses.checked, " {\n color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n\n &:hover {\n color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(checkboxClasses.disabled, " {\n color: ").concat((_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _f === void 0 ? void 0 : _f.borderDisabled, ";\n }\n }\n\n &.").concat(checkboxClasses.root, " {\n ").concat(focusVisibleA11yStyle(), "\n padding: 0;\n
|
|
6266
|
+
return "\n color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors[checkboxColor]) === null || _a === void 0 ? void 0 : _a.border, ";\n\n &:hover {\n color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(checkboxClasses.disabled, " {\n color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, ";\n }\n\n &.").concat(checkboxClasses.checked, " {\n color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n\n &:hover {\n color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(checkboxClasses.disabled, " {\n color: ").concat((_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _f === void 0 ? void 0 : _f.borderDisabled, ";\n }\n }\n\n &.").concat(checkboxClasses.root, " {\n ").concat(focusVisibleA11yStyle(), "\n padding: 0;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n border-radius: 0;\n }\n\n .MuiSvgIcon-root {\n height: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, "px;\n width: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width, "px;\n }\n ");
|
|
6168
6267
|
});
|
|
6169
6268
|
var StyledFormControlLabel$1 = styled(FormControlLabel)(templateObject_2$d || (templateObject_2$d = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6170
6269
|
var spaces = getSpaces(props);
|
|
@@ -6244,7 +6343,7 @@ var StyledRadioButton = styled(Radio)(templateObject_1$n || (templateObject_1$n
|
|
|
6244
6343
|
warning: "notice",
|
|
6245
6344
|
};
|
|
6246
6345
|
var radioColor = intentToColor[intent];
|
|
6247
|
-
return "\n color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors[radioColor]) === null || _a === void 0 ? void 0 : _a.border, ";\n\n &:hover {\n color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(radioClasses.disabled, " {\n color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, ";\n }\n\n &.").concat(radioClasses.checked, " {\n color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n\n &:hover {\n color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(radioClasses.disabled, " {\n color: ").concat((_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _f === void 0 ? void 0 : _f.borderDisabled, ";\n }\n }\n\n &.").concat(radioClasses.root, " {\n ").concat(focusVisibleA11yStyle(), "\n
|
|
6346
|
+
return "\n color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors[radioColor]) === null || _a === void 0 ? void 0 : _a.border, ";\n\n &:hover {\n color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(radioClasses.disabled, " {\n color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled, ";\n }\n\n &.").concat(radioClasses.checked, " {\n color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n\n &:hover {\n color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.borderHover, ";\n background-color: transparent;\n }\n\n &.").concat(radioClasses.disabled, " {\n color: ").concat((_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _f === void 0 ? void 0 : _f.borderDisabled, ";\n }\n }\n\n &.").concat(radioClasses.root, " {\n ").concat(focusVisibleA11yStyle(), "\n margin: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px 0 0;\n padding: 0;\n }\n\n .MuiSvgIcon-root {\n height: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, "px;\n width: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width, "px;\n }\n ");
|
|
6248
6347
|
});
|
|
6249
6348
|
var StyledFormControlLabel = styled(FormControlLabel)(templateObject_2$c || (templateObject_2$c = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6250
6349
|
var spaces = getSpaces(props);
|
|
@@ -6267,19 +6366,26 @@ var templateObject_1$n, templateObject_2$c, templateObject_3$7, templateObject_4
|
|
|
6267
6366
|
* @see https://mui.com/material-ui/react-radio-button/
|
|
6268
6367
|
*/
|
|
6269
6368
|
var InputRadio = function (props) {
|
|
6270
|
-
var
|
|
6369
|
+
var caption = props.caption, disabled = props.disabled, _a = props.intent, intent = _a === void 0 ? "default" : _a, radioProps = props.radioProps, stage = props.stage, value = props.value;
|
|
6370
|
+
// (masoudmanson): We don't need to pass the label prop to the radio component
|
|
6371
|
+
// so we are destructuring it here.
|
|
6372
|
+
var label = props.label, restProps = __rest(props, ["label"]);
|
|
6271
6373
|
var newProps;
|
|
6272
6374
|
switch (stage) {
|
|
6273
6375
|
case "checked":
|
|
6274
|
-
newProps = __assign(__assign({},
|
|
6376
|
+
newProps = __assign(__assign({}, restProps), { checked: true, color: "primary" });
|
|
6275
6377
|
break;
|
|
6276
6378
|
case "unchecked":
|
|
6277
|
-
newProps = __assign(__assign({},
|
|
6379
|
+
newProps = __assign(__assign({}, restProps), { checked: false, color: "default" });
|
|
6278
6380
|
break;
|
|
6279
6381
|
default:
|
|
6280
|
-
newProps =
|
|
6382
|
+
newProps = restProps;
|
|
6281
6383
|
}
|
|
6282
|
-
|
|
6384
|
+
// (masoudmanson): The id for the label and caption is required for accessibility.
|
|
6385
|
+
// Otherwise, the screen reader will read the label twice!
|
|
6386
|
+
var labelId = "".concat(value, "-label");
|
|
6387
|
+
var captionId = caption ? "".concat(value, "-caption") : undefined;
|
|
6388
|
+
var finalLabel = caption ? (jsxs(StyledLabelContainer, { children: [jsx(StyledRadioLabel, { id: labelId, children: label }), jsx(StyledRadioCaption, { disabled: disabled, id: captionId, children: caption })] })) : (jsx(StyledLabelContainer, { children: jsx(StyledRadioLabel, { id: labelId, children: label }) }));
|
|
6283
6389
|
return (jsx(StyledFormControlLabel, { control: jsx(StyledRadioButton, __assign({ disabled: disabled, checkedIcon: jsx(SvgIcon, { fillcontrast: "white", component: SvgIconRadioChecked, viewBox: "0 0 16 16" }), icon: jsx(SvgIcon, { fillcontrast: "white", component: SvgIconRadioUnchecked, viewBox: "0 0 16 16" }), intent: intent }, radioProps, newProps)), disabled: disabled, label: finalLabel, value: value }));
|
|
6284
6390
|
};
|
|
6285
6391
|
|
|
@@ -6290,7 +6396,7 @@ var inputSlider = function (props) {
|
|
|
6290
6396
|
var shadows = getShadows(props);
|
|
6291
6397
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6292
6398
|
var semanticTextColors = getSemanticTextColors(props);
|
|
6293
|
-
return "\n position: relative;\n\n .".concat(sliderClasses.rail, ",\n .").concat(sliderClasses.track, " {\n border-radius: 2px;\n }\n\n .").concat(sliderClasses.rail, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceTertiary, ";\n }\n \n .").concat(sliderClasses.track, " {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _b === void 0 ? void 0 : _b.fill, ";\n }\n\n .").concat(sliderClasses.thumb, " {\n height: 14px;\n width: 14px;\n background-color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _c === void 0 ? void 0 : _c.fill, ";\n\n &.").concat(sliderClasses.focusVisible, ", &:hover, &:focus, &:active {\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, ";\n }\n }\n\n .").concat(sliderClasses.thumb, "::before {\n display: none;\n }\n\n .").concat(sliderClasses.thumb, "::after {\n background-color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.surface, " !important;\n height: 6px !important;\n width: 6px !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n .").concat(sliderClasses.valueLabel, " {\n padding: 2px 4px;\n color: black;\n background-color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.surface, ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n left: unset; \n top: -3px;\n\n &::before {\n display: none;\n }\n\n & * {\n background: transparent;\n color: ").concat((_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, ";\n transform: none;\n width: unset;\n height: unset;\n }\n }\n\n .").concat(sliderClasses.mark, " {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[400], ";\n opacity: 1;\n }\n\n .").concat(sliderClasses.mark, ".").concat(sliderClasses.markActive, " {\n background-color: ").concat((_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _g === void 0 ? void 0 : _g.surface, ";\n }\n\n .").concat(sliderClasses.markLabel, " {\n ").concat((_h = fontBodyXxxs$1(props)) === null || _h === void 0 ? void 0 : _h.styles, "\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n }\n\n .").concat(sliderClasses.markLabelActive, " {\n color: ").concat((_j = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _j === void 0 ? void 0 : _j.primary, ";\n }\n ");
|
|
6399
|
+
return "\n position: relative;\n\n .".concat(sliderClasses.rail, ",\n .").concat(sliderClasses.track, " {\n border-radius: 2px;\n }\n\n .").concat(sliderClasses.rail, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceTertiary, ";\n }\n \n .").concat(sliderClasses.track, " {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _b === void 0 ? void 0 : _b.fill, ";\n }\n\n .").concat(sliderClasses.thumb, " {\n ").concat(focusVisibleA11yStyle(), "\n height: 14px;\n width: 14px;\n background-color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _c === void 0 ? void 0 : _c.fill, ";\n\n &.").concat(sliderClasses.focusVisible, ", &:hover, &:focus, &:active {\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, ";\n }\n }\n\n .").concat(sliderClasses.thumb, "::before {\n display: none;\n }\n\n .").concat(sliderClasses.thumb, "::after {\n background-color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.surface, " !important;\n height: 6px !important;\n width: 6px !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n .").concat(sliderClasses.valueLabel, " {\n padding: 2px 4px;\n color: black;\n background-color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.surface, ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n left: unset; \n top: -3px;\n\n &::before {\n display: none;\n }\n\n & * {\n background: transparent;\n color: ").concat((_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, ";\n transform: none;\n width: unset;\n height: unset;\n }\n }\n\n .").concat(sliderClasses.mark, " {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[400], ";\n opacity: 1;\n }\n\n .").concat(sliderClasses.mark, ".").concat(sliderClasses.markActive, " {\n background-color: ").concat((_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _g === void 0 ? void 0 : _g.surface, ";\n }\n\n .").concat(sliderClasses.markLabel, " {\n ").concat((_h = fontBodyXxxs$1(props)) === null || _h === void 0 ? void 0 : _h.styles, "\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n }\n\n .").concat(sliderClasses.markLabelActive, " {\n color: ").concat((_j = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _j === void 0 ? void 0 : _j.primary, ";\n }\n ");
|
|
6294
6400
|
};
|
|
6295
6401
|
var horizontal = function (props) {
|
|
6296
6402
|
var marks = props.marks;
|
|
@@ -6314,7 +6420,8 @@ var templateObject_1$m;
|
|
|
6314
6420
|
* @see https://mui.com/material-ui/react-slider/
|
|
6315
6421
|
*/
|
|
6316
6422
|
var InputSlider = forwardRef(function (props, ref) {
|
|
6317
|
-
|
|
6423
|
+
var min = props.min, max = props.max, rest = __rest(props, ["min", "max"]);
|
|
6424
|
+
return (jsx(StyledSlider, __assign({ ref: ref, min: min, max: max }, rest, { orientation: "horizontal", "aria-label": "Slider - min ".concat(min, " to max ").concat(max) })));
|
|
6318
6425
|
});
|
|
6319
6426
|
|
|
6320
6427
|
var sdsPropNames$1 = ["sdsStyle", "sdsStage", "sdsType", "intent", "hideLabel"];
|
|
@@ -6366,7 +6473,7 @@ var StyledInputBase = styled(TextField, {
|
|
|
6366
6473
|
var borders = getBorders(props);
|
|
6367
6474
|
var corners = getCorners(props);
|
|
6368
6475
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6369
|
-
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 160px;\n display: block;\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", " {\n border-radius: ", "px;\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border-color: ", ";\n }\n\n .", ".", "\n .", " {\n border: ", ";\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 160px;\n display: block;\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", " {\n border-radius: ", "px;\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border-color: ", ";\n }\n\n .", ".", "\n .", " {\n border: ", ";\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.l, spaces === null || spaces === void 0 ? void 0 : spaces.m, outlinedInputClasses.inputSizeSmall, fontBodyXs$2(props), spaces === null || spaces === void 0 ? void 0 : spaces.xs, spaces === null || spaces === void 0 ? void 0 : spaces.m, (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfacePrimary, outlinedInputClasses.notchedOutline, corners === null || corners === void 0 ? void 0 : corners.m, (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.default, outlinedInputClasses.root, outlinedInputClasses.notchedOutline, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderHover, outlinedInputClasses.root, outlinedInputClasses.focused, outlinedInputClasses.notchedOutline, (_d = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _d === void 0 ? void 0 : _d.default, sdsType === "textArea" && textArea(props), intent === "error" && error(props), intent === "warning" && warning(props), disabled && disabledStyled$1(props), sdsStage === "userInput" && userInput(props));
|
|
6476
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 160px;\n display: block;\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", " {\n border-radius: ", "px;\n border: ", ";\n }\n\n .", " {\n outline: none;\n border-radius: 4px;\n }\n\n &.user-is-tabbing .", " {\n ", "\n }\n\n .", ":hover\n .", " {\n border-color: ", ";\n }\n\n .", ".", "\n .", " {\n border: ", ";\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 160px;\n display: block;\n\n .", " {\n ", "\n padding: ", "px ", "px;\n height: unset;\n box-sizing: border-box;\n background-color: ", ";\n }\n\n .", " {\n border-radius: ", "px;\n border: ", ";\n }\n\n .", " {\n outline: none;\n border-radius: 4px;\n }\n\n &.user-is-tabbing .", " {\n ", "\n }\n\n .", ":hover\n .", " {\n border-color: ", ";\n }\n\n .", ".", "\n .", " {\n border: ", ";\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.l, spaces === null || spaces === void 0 ? void 0 : spaces.m, outlinedInputClasses.inputSizeSmall, fontBodyXs$2(props), spaces === null || spaces === void 0 ? void 0 : spaces.xs, spaces === null || spaces === void 0 ? void 0 : spaces.m, (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfacePrimary, outlinedInputClasses.notchedOutline, corners === null || corners === void 0 ? void 0 : corners.m, (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.default, outlinedInputClasses.input, outlinedInputClasses.input, focusVisibleA11yStyle(), outlinedInputClasses.root, outlinedInputClasses.notchedOutline, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderHover, outlinedInputClasses.root, outlinedInputClasses.focused, outlinedInputClasses.notchedOutline, (_d = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _d === void 0 ? void 0 : _d.default, sdsType === "textArea" && textArea(props), intent === "error" && error(props), intent === "warning" && warning(props), disabled && disabledStyled$1(props), sdsStage === "userInput" && userInput(props));
|
|
6370
6477
|
});
|
|
6371
6478
|
var templateObject_1$l, templateObject_2$b, templateObject_3$6, templateObject_4$5, templateObject_5$2, templateObject_6$1, templateObject_7, templateObject_8;
|
|
6372
6479
|
|
|
@@ -6375,6 +6482,19 @@ var templateObject_1$l, templateObject_2$b, templateObject_3$6, templateObject_4
|
|
|
6375
6482
|
*/
|
|
6376
6483
|
var InputText = forwardRef(function InputText(props, ref) {
|
|
6377
6484
|
var id = props.id, _a = props.intent, intent = _a === void 0 ? "default" : _a, label = props.label, placeholder = props.placeholder, sdsType = props.sdsType, hideLabel = props.hideLabel, rest = __rest(props, ["id", "intent", "label", "placeholder", "sdsType", "hideLabel"]);
|
|
6485
|
+
/**
|
|
6486
|
+
* (masoudmanson): In case that the ref is not provided, we will create a new one.
|
|
6487
|
+
*/
|
|
6488
|
+
var inputRef = useRef(null);
|
|
6489
|
+
/**
|
|
6490
|
+
* (masoudmanson): This is a custom hook that listens for keyboard and mouse events
|
|
6491
|
+
* and adds a 'user-is-tabbing' class to the body element when the user starts
|
|
6492
|
+
* navigating with the keyboard. Unlike button elements which have both :focus
|
|
6493
|
+
* and :focus-visible states available to style separately, input elements have
|
|
6494
|
+
* identical styles for :focus and :focus-visible states. By detecting when the
|
|
6495
|
+
* user is tabbing, we can apply different styles for :focus and :focus-visible states.
|
|
6496
|
+
*/
|
|
6497
|
+
useDetectUserTabbing((ref ? ref : inputRef));
|
|
6378
6498
|
var _b = useState(false), hasValue = _b[0], setHasValue = _b[1];
|
|
6379
6499
|
var handleChange = function (event) {
|
|
6380
6500
|
if (event.target.value) {
|
|
@@ -6393,18 +6513,17 @@ var InputText = forwardRef(function InputText(props, ref) {
|
|
|
6393
6513
|
return jsx(Fragment, {});
|
|
6394
6514
|
}
|
|
6395
6515
|
var finalLabel = typeof label === "string" ? (jsx(StyledLabel, { htmlFor: id, children: label })) : (label);
|
|
6396
|
-
return (jsxs(Fragment, { children: [!hideLabel && finalLabel, jsx(StyledInputBase, __assign({ ref: ref, inputProps: inputProps, type: "text", multiline: sdsType === "textArea", minRows: sdsType === "textArea" ? 4 : 2, id: id, intent: intent, variant: "outlined", size: "small", placeholder: placeholder, sdsStage: hasValue ? "userInput" : "default", sdsType: sdsType, onChange: handleChange }, rest))] }));
|
|
6516
|
+
return (jsxs(Fragment, { children: [!hideLabel && finalLabel, jsx(StyledInputBase, __assign({ ref: ref ? ref : inputRef, inputProps: inputProps, type: "text", multiline: sdsType === "textArea", minRows: sdsType === "textArea" ? 4 : 2, id: id, intent: intent, variant: "outlined", size: "small", placeholder: placeholder, sdsStage: hasValue ? "userInput" : "default", sdsType: sdsType, onChange: handleChange }, rest))] }));
|
|
6397
6517
|
});
|
|
6398
6518
|
|
|
6399
6519
|
var toggle = function (props) {
|
|
6400
|
-
var _a;
|
|
6401
|
-
var disabled = props.disabled;
|
|
6520
|
+
var _a, _b, _c, _d;
|
|
6521
|
+
var disabled = props.disabled, _e = props.width, width = _e === void 0 ? 62 : _e;
|
|
6402
6522
|
var corners = getCorners(props);
|
|
6403
|
-
var spaces = getSpaces(props);
|
|
6404
6523
|
var shadows = getShadows(props);
|
|
6524
|
+
var iconSizes = getIconSizes(props);
|
|
6405
6525
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6406
|
-
|
|
6407
|
-
return "\n cursor: ".concat(disabled ? "default" : "pointer", ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n height: 26px;\n width: 62px;\n line-height: 18px;\n padding: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;\n\n .").concat(switchClasses.switchBase, " {\n font: inherit;\n margin: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;\n padding: 0;\n transform: unset;\n\n &.").concat(switchClasses.checked, " {\n transform: unset;\n }\n\n &:hover {\n background-color: transparent;\n }\n }\n\n .").concat(switchClasses.thumb, " {\n height: ").concat(TOGGLE_HEIGHT, "px;\n width: ").concat(TOGGLE_HEIGHT, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, ";\n }\n\n .").concat(switchClasses.track, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfacePrimary, ";\n width: unset;\n }\n ");
|
|
6526
|
+
return "\n cursor: ".concat(disabled ? "default" : "pointer", ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n height: 24px;\n width: ").concat(width, "px;\n line-height: 18px;\n padding: 0;\n overflow: visible;\n\n .").concat(switchClasses.switchBase, " {\n ").concat(focusVisibleA11yStyle(), "\n outline-offset: 2px !important;\n width: 100%;\n height: 100%;\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n font: inherit;\n transform: unset;\n justify-content: space-between;\n\n .").concat(switchClasses.input, " {\n width: 100%;\n height: 100%;\n left: 0;\n }\n\n &.").concat(switchClasses.checked, " {\n transform: unset;\n }\n\n &:hover {\n background-color: transparent;\n }\n }\n\n .").concat(switchClasses.thumb, " {\n height: ").concat((_a = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s) === null || _a === void 0 ? void 0 : _a.height, "px;\n width: ").concat((_b = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s) === null || _b === void 0 ? void 0 : _b.width, "px;\n min-width: ").concat((_c = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s) === null || _c === void 0 ? void 0 : _c.width, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.none, ";\n }\n\n .").concat(switchClasses.track, " {\n background-color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.surfacePrimary, ";\n width: unset;\n }\n ");
|
|
6408
6527
|
};
|
|
6409
6528
|
var toggleOn = function (props) {
|
|
6410
6529
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -6414,7 +6533,7 @@ var toggleOn = function (props) {
|
|
|
6414
6533
|
var spaces = getSpaces(props);
|
|
6415
6534
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6416
6535
|
var semanticTextColors = getSemanticTextColors(props);
|
|
6417
|
-
return "\n outline: ".concat(disabled ? (_a = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _a === void 0 ? void 0 : _a.disabled : (_b = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _b === void 0 ? void 0 : _b.default, ";\n\n .").concat(switchClasses.thumb, " {\n color: ").concat(disabled ? (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _c === void 0 ? void 0 : _c.borderDisabled : (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.
|
|
6536
|
+
return "\n outline: ".concat(disabled ? (_a = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _a === void 0 ? void 0 : _a.disabled : (_b = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _b === void 0 ? void 0 : _b.default, ";\n\n .").concat(switchClasses.thumb, " {\n color: ").concat(disabled ? (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _c === void 0 ? void 0 : _c.borderDisabled : (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _d === void 0 ? void 0 : _d.border, ";\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n }\n\n .").concat(switchClasses.switchBase, " {\n left: unset;\n right: 0;\n transform: unset;\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;\n\n .MuiIconButton-label {\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n\n &:before {\n color: ").concat(disabled ? (_e = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _e === void 0 ? void 0 : _e.disabled : (_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, ";\n content: \"").concat(value, "\";\n }\n }\n\n ").concat(!disabled &&
|
|
6418
6537
|
"&:hover {\n outline: ".concat((_g = borders === null || borders === void 0 ? void 0 : borders.accent) === null || _g === void 0 ? void 0 : _g.hover, ";\n\n .").concat(switchClasses.thumb, " {\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.blue[500], ";\n }\n }"), "\n ");
|
|
6419
6538
|
};
|
|
6420
6539
|
var toggleOff = function (props) {
|
|
@@ -6426,7 +6545,7 @@ var toggleOff = function (props) {
|
|
|
6426
6545
|
var semanticTextColors = getSemanticTextColors(props);
|
|
6427
6546
|
return "\n & {\n outline: ".concat(disabled ? (_a = borders === null || borders === void 0 ? void 0 : borders.base) === null || _a === void 0 ? void 0 : _a.disabled : (_b = borders === null || borders === void 0 ? void 0 : borders.base) === null || _b === void 0 ? void 0 : _b.default, ";\n }\n\n .").concat(switchClasses.thumb, " {\n color: ").concat(disabled
|
|
6428
6547
|
? (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.borderDisabled
|
|
6429
|
-
: (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.border, ";\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.
|
|
6548
|
+
: (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.border, ";\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n }\n\n .").concat(switchClasses.switchBase, " {\n right: unset;\n left: 0;\n transform: unset;\n padding: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxs, "px;\n\n .MuiIconButton-label {\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.s, "px;\n }\n\n &:after {\n color: ").concat(disabled ? (_e = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _e === void 0 ? void 0 : _e.disabled : (_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _f === void 0 ? void 0 : _f.primary, ";\n content: \"").concat(value, "\";\n }\n }\n\n ").concat(!disabled &&
|
|
6430
6549
|
"&:hover {\n outline: ".concat((_g = borders === null || borders === void 0 ? void 0 : borders.base) === null || _g === void 0 ? void 0 : _g.black, ";\n\n .").concat(switchClasses.thumb, " {\n color: ").concat((_h = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _h === void 0 ? void 0 : _h.iconHover, ";\n }\n }"), "\n ");
|
|
6431
6550
|
};
|
|
6432
6551
|
var Toggle = styled(Switch)(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontBodyXs$2, function (props) {
|
|
@@ -6453,9 +6572,11 @@ var InputToggle = function (props) {
|
|
|
6453
6572
|
|
|
6454
6573
|
var doNotForwardProps$9 = ["sdsStyle", "sdsSize", "fontWeight"];
|
|
6455
6574
|
var defaultStyle = function (props) {
|
|
6456
|
-
var _a, _b, _c;
|
|
6575
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6576
|
+
var _h = props.sdsSize, sdsSize = _h === void 0 ? "s" : _h;
|
|
6457
6577
|
var semanticTextColors = getSemanticTextColors(props);
|
|
6458
|
-
|
|
6578
|
+
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6579
|
+
return css(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n color: ", ";\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n height: 1px;\n margin-top: ", "px;\n width: 100%;\n }\n\n &:hover {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n\n &:focus {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n "], ["\n color: ", ";\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n height: 1px;\n margin-top: ", "px;\n width: 100%;\n }\n\n &:hover {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n\n &:focus {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n "])), (_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.action) === null || _a === void 0 ? void 0 : _a.default, sdsSize === "s" ? -4 : -3, (_b = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.action) === null || _b === void 0 ? void 0 : _b.hover, (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _c === void 0 ? void 0 : _c.borderHover, (_d = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.action) === null || _d === void 0 ? void 0 : _d.hover, (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _e === void 0 ? void 0 : _e.borderHover, (_f = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.action) === null || _f === void 0 ? void 0 : _f.pressed, (_g = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _g === void 0 ? void 0 : _g.borderPressed);
|
|
6459
6580
|
};
|
|
6460
6581
|
var dashedStyle = function (props) {
|
|
6461
6582
|
var _a = props.sdsSize, sdsSize = _a === void 0 ? "s" : _a;
|
|
@@ -6471,7 +6592,7 @@ var StyledLink = styled(Link$1, {
|
|
|
6471
6592
|
shouldForwardProp: function (prop) {
|
|
6472
6593
|
return !doNotForwardProps$9.includes(prop.toString());
|
|
6473
6594
|
},
|
|
6474
|
-
})(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n all: unset;\n\n ", "\n"], ["\n all: unset;\n\n ", "\n"])), function (props) {
|
|
6595
|
+
})(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n all: unset;\n\n ", "\n\n ", "\n"], ["\n all: unset;\n\n ", "\n\n ", "\n"])), focusVisibleA11yStyle, function (props) {
|
|
6475
6596
|
var _a = props.fontWeight, fontWeight = _a === void 0 ? "normal" : _a, sdsStyle = props.sdsStyle, _b = props.sdsSize, sdsSize = _b === void 0 ? "s" : _b;
|
|
6476
6597
|
return css(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n\n font-weight: ", ";\n display: inline-block;\n cursor: pointer;\n "], ["\n ", "\n ", "\n ", "\n ", "\n\n font-weight: ", ";\n display: inline-block;\n cursor: pointer;\n "])), sdsStyle === "default" && defaultStyle(props), sdsStyle === "dashed" && dashedStyle(props), sdsSize === "s" && smallStyle(props), sdsSize === "xs" && extraSmallStyle(props), fontWeight === "normal" ? "400" : "600");
|
|
6477
6598
|
});
|
|
@@ -6620,7 +6741,7 @@ var templateObject_1$f, templateObject_2$8, templateObject_3$4, templateObject_4
|
|
|
6620
6741
|
|
|
6621
6742
|
var LoadingIndicator = function (_a) {
|
|
6622
6743
|
var ariaLabel = _a["aria-label"], sdsStyle = _a.sdsStyle;
|
|
6623
|
-
return (jsxs(StyledLoadingIndicator, { sdsStyle: sdsStyle, children: [jsx(Icon, { sdsIcon: "Loading", sdsSize: "l", sdsType: "static" }), jsx(StyledText, { "aria-label": ariaLabel, "aria-live": "polite", role: "status", children: "Loading" })] }));
|
|
6744
|
+
return (jsxs(StyledLoadingIndicator, { sdsStyle: sdsStyle, "aria-label": "Loading", children: [jsx(Icon, { sdsIcon: "Loading", sdsSize: "l", sdsType: "static" }), jsx(StyledText, { "aria-label": ariaLabel, "aria-live": "polite", role: "status", children: "Loading" })] }));
|
|
6624
6745
|
};
|
|
6625
6746
|
|
|
6626
6747
|
var StyledMenu = styled(Menu$1)(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n & {\n .", " {\n ", "\n }\n\n .MuiList-padding {\n padding: 0;\n }\n }\n"], ["\n & {\n .", " {\n ", "\n }\n\n .MuiList-padding {\n padding: 0;\n }\n }\n"])), menuClasses.paper, function (props) {
|
|
@@ -6785,7 +6906,7 @@ var StyledTabs$1 = styled(Tabs$1, {
|
|
|
6785
6906
|
var _c = props.sdsIndicatorColor, sdsIndicatorColor = _c === void 0 ? "info" : _c;
|
|
6786
6907
|
var spaces = getSpaces(props);
|
|
6787
6908
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6788
|
-
return "\n &:before {\n background-color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceTertiary, ";\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n content: \"\";\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n max-width: 180px;\n top: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;\n margin-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n position: sticky;\n .
|
|
6909
|
+
return "\n &:before {\n background-color: ".concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.surfaceTertiary, ";\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n content: \"\";\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n\n max-width: 180px;\n top: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;\n margin-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n position: sticky;\n overflow: visible;\n\n .").concat(tabsClasses.indicator, " {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors[sdsIndicatorColor]) === null || _b === void 0 ? void 0 : _b.fill, " !important;\n border-radius: 2px;\n left: 0;\n width: 2px;\n }\n\n .").concat(tabsClasses.scroller, " {\n overflow: visible !important;\n }\n ");
|
|
6789
6910
|
});
|
|
6790
6911
|
var StyledTab$1 = styled(Tab$1, {
|
|
6791
6912
|
shouldForwardProp: function (prop) { return !doNotForwardProps$4.includes(prop); },
|
|
@@ -6793,7 +6914,7 @@ var StyledTab$1 = styled(Tab$1, {
|
|
|
6793
6914
|
var _a, _b;
|
|
6794
6915
|
var spaces = getSpaces(props);
|
|
6795
6916
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
6796
|
-
return "\n box-sizing: border-box;\n max-width: 180px;\n padding-left: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n align-items: start;\n min-height: unset;\n max-height: unset;\n text-transform: none;\n &:last-child {\n margin-bottom: 0;\n }\n &:before {\n content: \"\";\n position: absolute;\n left: -").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n height: 100%;\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.border, ";\n display: none;\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &:hover {\n color: black;\n &:before {\n display: block;\n }\n }\n &.Mui-selected {\n color: black;\n font-weight: 600;\n }\n &.MuiTabs-indicator {\n backgroundColor: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.surfaceTertiary, ";\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &.MuiButtonBase-root {\n white-space: nowrap;\n padding: 0;\n overflow: visible;\n }\n ");
|
|
6917
|
+
return "\n ".concat(focusVisibleA11yStyle(), "\n box-sizing: border-box;\n max-width: 180px;\n padding-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n align-items: start;\n min-height: unset;\n max-height: unset;\n text-transform: none;\n &:last-child {\n margin-bottom: 0;\n }\n &:before {\n content: \"\";\n position: absolute;\n left: -").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n height: 100%;\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.border, ";\n display: none;\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &:hover {\n color: black;\n &:before {\n display: block;\n }\n }\n &.Mui-selected {\n color: black;\n font-weight: 600;\n }\n &.MuiTabs-indicator {\n backgroundColor: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.surfaceTertiary, ";\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &.MuiButtonBase-root {\n white-space: nowrap;\n padding: 0;\n overflow: visible;\n }\n ");
|
|
6797
6918
|
});
|
|
6798
6919
|
var templateObject_1$c, templateObject_2$6;
|
|
6799
6920
|
|
|
@@ -6934,7 +7055,7 @@ var NavigationJumpTo = forwardRef(function (props, ref) {
|
|
|
6934
7055
|
return (jsx(StyledTabs$1, __assign({ ref: ref, orientation: "vertical", variant: "fullWidth", value: firstTabIndexInview, onChange: handleChange, "aria-label": "navigation-jump-to", sdsIndicatorColor: indicatorColor }, rest, { children: items.map(function (_a, index) {
|
|
6935
7056
|
var _b;
|
|
6936
7057
|
var title = _a.title, elementRef = _a.elementRef;
|
|
6937
|
-
return (jsx(StyledTab$1, __assign({ label: title }, a11yProps(toKebabCase(title), ((_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.getAttribute("id")) ||
|
|
7058
|
+
return (jsx(StyledTab$1, __assign({ label: title, tabIndex: 0 }, a11yProps(toKebabCase(title), ((_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.getAttribute("id")) ||
|
|
6938
7059
|
"navigation-panel-".concat(index + 1))), toKebabCase(title)));
|
|
6939
7060
|
}) })));
|
|
6940
7061
|
});
|
|
@@ -7041,7 +7162,7 @@ var StyledPaginationChevronList = styled("li", {
|
|
|
7041
7162
|
var disabled = props.disabled;
|
|
7042
7163
|
var spaces = getSpaces(props);
|
|
7043
7164
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
7044
|
-
return "\n width: 32px;\n height: 32px;\n cursor: ".concat(disabled ? "auto" : "pointer", ";\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 32px;\n\n &[data-order=\"first\"] {\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n &[data-order=\"last\"] {\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n & .MuiSvgIcon-root {\n color: ").concat(disabled ? (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.iconDisabled : (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.icon, ";\n }\n\n &:hover {\n background-color: ").concat(disabled ? "transparent" : (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.fillHover, ";\n\n & .MuiSvgIcon-root {\n color: ").concat(disabled ? (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.iconDisabled : (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.iconHover, "\n }\n }\n ");
|
|
7165
|
+
return "\n width: 32px;\n height: 32px;\n cursor: ".concat(disabled ? "auto" : "pointer", ";\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 32px;\n\n &[data-order=\"first\"] {\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n &[data-order=\"last\"] {\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n }\n\n & .MuiSvgIcon-root {\n color: ").concat(disabled ? (_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.iconDisabled : (_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.icon, ";\n }\n\n &:hover {\n background-color: ").concat(disabled ? "transparent" : (_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.fillHover, ";\n\n & .MuiSvgIcon-root {\n color: ").concat(disabled ? (_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.iconDisabled : (_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.iconHover, "\n }\n }\n\n ").concat(focusVisibleA11yStyle(), "\n ");
|
|
7045
7166
|
});
|
|
7046
7167
|
var StyledPagination = styled("ul", {
|
|
7047
7168
|
shouldForwardProp: function (prop) { return !doNotForwardProps$2.includes(prop); },
|
|
@@ -7061,7 +7182,7 @@ var Page = styled("li", {
|
|
|
7061
7182
|
var corners = getCorners(props);
|
|
7062
7183
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
7063
7184
|
var semanticTextColors = getSemanticTextColors(props);
|
|
7064
|
-
return "\n color: ".concat((_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.secondary, ";\n cursor: pointer;\n list-style: none;\n width: 32px;\n height: 32px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: ").concat(sdsStyle === "round" ? corners === null || corners === void 0 ? void 0 : corners.l : corners === null || corners === void 0 ? void 0 : corners.m, "px;\n user-select: none;\n &:hover {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.fillHover, ";\n color: ").concat((_c = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _c === void 0 ? void 0 : _c.primary, ";\n }\n\n &:nth-last-of-type(-n+2) {\n margin-right: 0;\n }\n\n ").concat(selected && selectedPageStyle(props), ";\n ");
|
|
7185
|
+
return "\n color: ".concat((_a = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _a === void 0 ? void 0 : _a.secondary, ";\n cursor: pointer;\n list-style: none;\n width: 32px;\n height: 32px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: ").concat(sdsStyle === "round" ? corners === null || corners === void 0 ? void 0 : corners.l : corners === null || corners === void 0 ? void 0 : corners.m, "px;\n user-select: none;\n &:hover {\n background-color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _b === void 0 ? void 0 : _b.fillHover, ";\n color: ").concat((_c = semanticTextColors === null || semanticTextColors === void 0 ? void 0 : semanticTextColors.base) === null || _c === void 0 ? void 0 : _c.primary, ";\n }\n\n &:nth-last-of-type(-n+2) {\n margin-right: 0;\n }\n\n ").concat(selected && selectedPageStyle(props), ";\n ").concat(focusVisibleA11yStyle(), "\n ");
|
|
7065
7186
|
});
|
|
7066
7187
|
var templateObject_1$a, templateObject_2$4, templateObject_3$2, templateObject_4$1;
|
|
7067
7188
|
|
|
@@ -7140,6 +7261,22 @@ var usePagination = function (_a) {
|
|
|
7140
7261
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
7141
7262
|
};
|
|
7142
7263
|
|
|
7264
|
+
var PaginationPageList = function (paginationRange, truncateDropdown, sdsStyle, onPageChange, currentPage) {
|
|
7265
|
+
function handlePageKeyDown(event, pageNumber) {
|
|
7266
|
+
if (event.key === "Enter" || event.code === "Space") {
|
|
7267
|
+
onPageChange(pageNumber);
|
|
7268
|
+
}
|
|
7269
|
+
}
|
|
7270
|
+
return paginationRange.map(function (pageNumber) {
|
|
7271
|
+
if (Array.isArray(pageNumber)) {
|
|
7272
|
+
if (truncateDropdown) {
|
|
7273
|
+
return (jsx(PageListDropdown, { pageList: pageNumber, onPageChange: onPageChange, sdsStyle: sdsStyle }, pageNumber.join("-")));
|
|
7274
|
+
}
|
|
7275
|
+
return (jsx(Page, { sdsStyle: sdsStyle, children: jsx(StyledPaginationButton, { "aria-label": "Go to a page", disabled: true, icon: "DotsHorizontal", sdsSize: "small", sdsStyle: "icon", sdsType: "tertiary" }) }, pageNumber.join("-")));
|
|
7276
|
+
}
|
|
7277
|
+
return (jsx(Page, { onClick: function () { return onPageChange(pageNumber); }, onKeyDown: function (event) { return handlePageKeyDown(event, pageNumber); }, selected: pageNumber === currentPage, sdsStyle: sdsStyle, tabIndex: 0, children: pageNumber }, pageNumber));
|
|
7278
|
+
});
|
|
7279
|
+
};
|
|
7143
7280
|
var Pagination = forwardRef(function (props, ref) {
|
|
7144
7281
|
var _a = props.sdsStyle, sdsStyle = _a === void 0 ? "round" : _a, onPageChange = props.onPageChange, onNextPage = props.onNextPage, onPreviousPage = props.onPreviousPage, totalCount = props.totalCount, _b = props.siblingCount, siblingCount = _b === void 0 ? 1 : _b, currentPage = props.currentPage, pageSize = props.pageSize, _c = props.truncateDropdown, truncateDropdown = _c === void 0 ? true : _c;
|
|
7145
7282
|
if (pageSize < 1) {
|
|
@@ -7155,15 +7292,19 @@ var Pagination = forwardRef(function (props, ref) {
|
|
|
7155
7292
|
return null;
|
|
7156
7293
|
}
|
|
7157
7294
|
var lastPage = paginationRange[paginationRange.length - 1];
|
|
7158
|
-
return (jsxs(StyledPagination, __assign({ ref: ref }, props, { children: [jsx(StyledPaginationChevronList, { "data-order": "first", disabled: currentPage === 1, onClick: function () { return currentPage > 1 && onPreviousPage(); }, children: jsx(Icon, { "aria-label": "Previous page", sdsIcon: "ChevronLeft", sdsSize: "xs", sdsType: "button" }) }, "prevPage"), paginationRange
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7295
|
+
return (jsxs(StyledPagination, __assign({ ref: ref }, props, { children: [jsx(StyledPaginationChevronList, { "data-order": "first", disabled: currentPage === 1, onClick: function () { return currentPage > 1 && onPreviousPage(); }, onKeyDown: handleGoBackButtonKeyDown, tabIndex: 0, children: jsx(Icon, { "aria-label": "Previous page", sdsIcon: "ChevronLeft", sdsSize: "xs", sdsType: "button" }) }, "prevPage"), PaginationPageList(paginationRange, truncateDropdown, sdsStyle, onPageChange, currentPage), jsx(StyledPaginationChevronList, { "data-order": "last", disabled: currentPage === lastPage, onClick: function () { return currentPage !== lastPage && onNextPage(); }, onKeyDown: handleGoNextButtonKeyDown, tabIndex: 0, children: jsx(Icon, { "aria-label": "Next page", sdsIcon: "ChevronRight", sdsSize: "xs", sdsType: "button" }) }, "onNextPage")] })));
|
|
7296
|
+
function handleGoBackButtonKeyDown(event) {
|
|
7297
|
+
if ((event.key === "Enter" || event.code === "Space") &&
|
|
7298
|
+
currentPage > 1) {
|
|
7299
|
+
onPreviousPage();
|
|
7300
|
+
}
|
|
7301
|
+
}
|
|
7302
|
+
function handleGoNextButtonKeyDown(event) {
|
|
7303
|
+
if ((event.key === "Enter" || event.code === "Space") &&
|
|
7304
|
+
currentPage !== lastPage) {
|
|
7305
|
+
onNextPage();
|
|
7306
|
+
}
|
|
7307
|
+
}
|
|
7167
7308
|
});
|
|
7168
7309
|
|
|
7169
7310
|
var doNotForwardProps$1 = ["buttonDefinition"];
|
|
@@ -7173,7 +7314,7 @@ var StyledSegmentedControl = styled(ToggleButtonGroup, {
|
|
|
7173
7314
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7174
7315
|
var spaces = getSpaces(props);
|
|
7175
7316
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
7176
|
-
return "\n
|
|
7317
|
+
return "\n .".concat(toggleButtonClasses.root, ".").concat(toggleButtonClasses.selected, " {\n background-color: ").concat((_a = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _a === void 0 ? void 0 : _a.fillOpen, ";\n color: ").concat((_b = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.accent) === null || _b === void 0 ? void 0 : _b.icon, ";\n border-color: ").concat((_c = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _c === void 0 ? void 0 : _c.border, ";\n\n &:hover {\n background-color: ").concat((_d = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _d === void 0 ? void 0 : _d.fillHover, ";\n }\n }\n\n .").concat(toggleButtonClasses.root, " {\n ").concat(focusVisibleA11yStyle(), "\n border-color: ").concat((_e = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _e === void 0 ? void 0 : _e.border, ";\n line-height: 0px;\n color: ").concat((_f = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _f === void 0 ? void 0 : _f.iconHover, ";\n padding: ").concat(((_g = spaces === null || spaces === void 0 ? void 0 : spaces.xs) !== null && _g !== void 0 ? _g : 6) - 1, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n\n &:hover {\n border-color: ").concat((_h = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _h === void 0 ? void 0 : _h.border, ";\n background-color: ").concat((_j = semanticComponentColors === null || semanticComponentColors === void 0 ? void 0 : semanticComponentColors.base) === null || _j === void 0 ? void 0 : _j.fillHover, ";\n }\n }\n ");
|
|
7177
7318
|
});
|
|
7178
7319
|
var templateObject_1$8;
|
|
7179
7320
|
|
|
@@ -7187,7 +7328,7 @@ var SegmentedControl = function (props) {
|
|
|
7187
7328
|
setActive(newActive);
|
|
7188
7329
|
}
|
|
7189
7330
|
};
|
|
7190
|
-
return (jsxs(StyledSegmentedControl, __assign({ size: "small", value: active, exclusive: true, onChange: handleActive }, props, { children: [buttonDefinition.map(function (button) {
|
|
7331
|
+
return (jsxs(StyledSegmentedControl, __assign({ "aria-label": "Segmented Control", size: "small", value: active, exclusive: true, onChange: handleActive }, props, { children: [buttonDefinition.map(function (button) {
|
|
7191
7332
|
var icon = button.icon, tooltipText = button.tooltipText, value = button.value;
|
|
7192
7333
|
var iconItem = function () {
|
|
7193
7334
|
if (icon) {
|
|
@@ -7199,7 +7340,7 @@ var SegmentedControl = function (props) {
|
|
|
7199
7340
|
}
|
|
7200
7341
|
}
|
|
7201
7342
|
};
|
|
7202
|
-
return (jsx(
|
|
7343
|
+
return (jsx(Tooltip, { title: tooltipText !== null && tooltipText !== void 0 ? tooltipText : value, sdsStyle: "dark", arrow: true, children: jsx(ToggleButton, { "aria-label": tooltipText, value: value, children: jsx("span", { tabIndex: -1, children: iconItem() }) }) }, value));
|
|
7203
7344
|
}), ";"] })));
|
|
7204
7345
|
};
|
|
7205
7346
|
|
|
@@ -7233,7 +7374,7 @@ var hoverStyled = function (props) {
|
|
|
7233
7374
|
};
|
|
7234
7375
|
var StyledTableRow = styled("tr", {
|
|
7235
7376
|
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
7236
|
-
})(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontHeaderS, function (props) {
|
|
7377
|
+
})(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n ", "\n ", "\n\n ", "\n"], ["\n ", "\n ", "\n\n ", "\n"])), fontHeaderS, focusVisibleA11yStyle, function (props) {
|
|
7237
7378
|
var _a, _b;
|
|
7238
7379
|
var rowHeight = props.rowHeight, _c = props.useDivider, useDivider = _c === void 0 ? true : _c, _d = props.selected, selected = _d === void 0 ? false : _d, _e = props.disabled, disabled = _e === void 0 ? false : _e, _f = props.hover, hover = _f === void 0 ? true : _f;
|
|
7239
7380
|
var semanticComponentColors = getSemanticComponentColors(props);
|
|
@@ -7398,7 +7539,7 @@ var TooltipCondensed = forwardRef(function TooltipCondensed(props, ref) {
|
|
|
7398
7539
|
key: "tooltip",
|
|
7399
7540
|
props: props,
|
|
7400
7541
|
});
|
|
7401
|
-
return (jsx(Tooltip, { followCursor: true, placement: "right-end", enterDelay: 50, leaveDelay: 50, title: title, ref: ref, classes: { tooltip: tooltip }, children: children }));
|
|
7542
|
+
return (jsx(Tooltip, { followCursor: true, placement: "right-end", enterDelay: 50, leaveDelay: 50, title: title, ref: ref, classes: { tooltip: tooltip }, arrow: false, children: children }));
|
|
7402
7543
|
});
|
|
7403
7544
|
function mergeClass(_a) {
|
|
7404
7545
|
var props = _a.props, className = _a.className, key = _a.key;
|