@digital-ai/dot-components 2.7.4 → 2.8.1
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/CHANGE_LOG.md +45 -9
- package/index.esm.js +106 -32
- package/index.umd.js +263 -174
- package/lib/Typography.stories.d.ts +1 -1
- package/lib/components/AccessibilityProps.d.ts +1 -0
- package/lib/components/CommonProps.d.ts +3 -0
- package/lib/components/app-switcher/AppSwitcher.styles.d.ts +1 -1
- package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
- package/lib/components/auto-complete/AutoComplete.d.ts +7 -3
- package/lib/components/auto-complete/AutoComplete.stories.d.ts +2 -1
- package/lib/components/auto-complete/AutoComplete.stories.styles.d.ts +2 -0
- package/lib/components/auto-complete/Autocomplete.stories.data.d.ts +1 -5
- package/lib/components/auto-complete/index.d.ts +1 -1
- package/lib/components/avatar/Avatar.d.ts +1 -1
- package/lib/components/avatar/Avatar.stories.d.ts +1 -1
- package/lib/components/button/IconButton.d.ts +1 -1
- package/lib/components/button/IconButton.stories.d.ts +1 -1
- package/lib/components/drawer/Drawer.d.ts +3 -1
- package/lib/components/drawer/Drawer.stories.d.ts +1 -1
- package/lib/components/drawer/DrawerBody.d.ts +1 -1
- package/lib/components/drawer/DrawerFooter.d.ts +1 -1
- package/lib/components/file-upload/FileUpload.d.ts +1 -1
- package/lib/components/file-upload/FileUpload.stories.d.ts +1 -1
- package/lib/components/icon/Icon.d.ts +1 -1
- package/lib/components/icon/Icon.stories.d.ts +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/inline-edit/InlineEdit.d.ts +1 -1
- package/lib/components/inline-edit/InlineEdit.stories.d.ts +1 -1
- package/lib/components/input-form-fields/InputFormFields.propTypes.d.ts +2 -0
- package/lib/components/input-form-fields/InputSelect.d.ts +1 -1
- package/lib/components/input-form-fields/InputSelect.stories.d.ts +1 -1
- package/lib/components/input-form-fields/InputText.d.ts +2 -1
- package/lib/components/input-form-fields/InputText.stories.d.ts +2 -1
- package/lib/components/link/Link.d.ts +1 -1
- package/lib/components/link/Link.stories.d.ts +1 -1
- package/lib/components/list/List.d.ts +2 -2
- package/lib/components/list/List.stories.d.ts +1 -1
- package/lib/components/list/NestedList.styles.d.ts +1 -1
- package/lib/components/menu/Menu.d.ts +1 -1
- package/lib/components/menu/Menu.stories.d.ts +1 -1
- package/lib/components/radio/RadioGroup.d.ts +1 -1
- package/lib/components/radio/RadioGroup.stories.d.ts +1 -1
- package/lib/components/search-input/SearchInput.d.ts +1 -1
- package/lib/components/split-button/SplitButton.styles.d.ts +1 -1
- package/lib/components/stepper/Stepper.styles.d.ts +1 -1
- package/lib/components/table/Table.styles.d.ts +1 -1
- package/lib/components/table/TableActions.styles.d.ts +1 -1
- package/lib/components/time-picker/TimePicker.d.ts +3 -1
- package/lib/components/time-picker/TimePicker.stories.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/lib/components/typography/Typography.d.ts +3 -1
- package/lib/components/typography/Typography.stories.d.ts +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, StyledEngineProvider, Avatar, Button,
|
|
3
|
+
import { useEffect, useState, useRef, useMemo, useContext, createContext, forwardRef, Fragment, useCallback, createElement, useLayoutEffect } from 'react';
|
|
4
|
+
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, StyledEngineProvider, Avatar, Button, Link, List, ListItem, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, Drawer, IconButton, ListItemIcon, Collapse, ListSubheader, Divider, ListItemText, Badge, useMediaQuery, Autocomplete, Chip, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, RadioGroup, Radio, Switch, Skeleton, Snackbar, ButtonGroup, Stepper, Step, StepLabel, StepContent, TablePagination, TableContainer, TableCell, TableRow, TableBody, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress } from '@mui/material';
|
|
5
5
|
import '@digital-ai/dot-icons';
|
|
6
6
|
import styled, { css, createGlobalStyle, ThemeProvider as ThemeProvider$1, keyframes } from 'styled-components';
|
|
7
7
|
import { createTheme, ThemeProvider, alpha, useTheme } from '@mui/material/styles';
|
|
@@ -21,6 +21,7 @@ function useStylesWithRootClass(name, className, ...args) {
|
|
|
21
21
|
|
|
22
22
|
const DotTooltip = ({
|
|
23
23
|
ariaLabel,
|
|
24
|
+
ariaRole: _ariaRole = 'tooltip',
|
|
24
25
|
children,
|
|
25
26
|
className,
|
|
26
27
|
'data-testid': dataTestId,
|
|
@@ -39,6 +40,7 @@ const DotTooltip = ({
|
|
|
39
40
|
onClose: onClose,
|
|
40
41
|
open: open,
|
|
41
42
|
placement: _placement,
|
|
43
|
+
role: _ariaRole,
|
|
42
44
|
title: title
|
|
43
45
|
}, {
|
|
44
46
|
children: jsx("span", {
|
|
@@ -55,6 +57,7 @@ const StyledIcon = styled(Icon).withConfig({
|
|
|
55
57
|
|
|
56
58
|
const DotIcon = ({
|
|
57
59
|
ariaLabel,
|
|
60
|
+
ariaRole: _ariaRole = 'img',
|
|
58
61
|
className,
|
|
59
62
|
'data-testid': dataTestId,
|
|
60
63
|
fontSize: _fontSize = 'medium',
|
|
@@ -72,11 +75,13 @@ const DotIcon = ({
|
|
|
72
75
|
root: rootClasses
|
|
73
76
|
},
|
|
74
77
|
"data-testid": dataTestId,
|
|
75
|
-
fontSize: _fontSize
|
|
78
|
+
fontSize: _fontSize,
|
|
79
|
+
role: _ariaRole
|
|
76
80
|
}, {
|
|
77
81
|
children: jsx("i", {
|
|
78
82
|
className: `icon-${iconId} dot-i`,
|
|
79
|
-
"data-testid": dataTestId && `${dataTestId}-i
|
|
83
|
+
"data-testid": dataTestId && `${dataTestId}-i`,
|
|
84
|
+
role: _ariaRole
|
|
80
85
|
}, void 0)
|
|
81
86
|
}), void 0)
|
|
82
87
|
}), void 0);
|
|
@@ -84,6 +89,8 @@ const DotIcon = ({
|
|
|
84
89
|
|
|
85
90
|
const DotTypography = ({
|
|
86
91
|
ariaLabel,
|
|
92
|
+
ariaLevel,
|
|
93
|
+
ariaRole,
|
|
87
94
|
className,
|
|
88
95
|
'data-testid': dataTestId,
|
|
89
96
|
children,
|
|
@@ -93,14 +100,21 @@ const DotTypography = ({
|
|
|
93
100
|
variant
|
|
94
101
|
}) => {
|
|
95
102
|
const rootClasses = useStylesWithRootClass('dot-typography', className);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (ariaRole === 'heading' && !ariaLevel) {
|
|
105
|
+
console.warn('please include ariaLevel when using ariaRole="heading"');
|
|
106
|
+
}
|
|
107
|
+
}, []);
|
|
96
108
|
return jsx(Typography, Object.assign({
|
|
97
109
|
"aria-label": ariaLabel,
|
|
110
|
+
"aria-level": ariaLevel,
|
|
98
111
|
classes: {
|
|
99
112
|
root: rootClasses
|
|
100
113
|
},
|
|
101
114
|
component: component,
|
|
102
115
|
"data-testid": dataTestId,
|
|
103
116
|
noWrap: noWrap,
|
|
117
|
+
role: ariaRole,
|
|
104
118
|
style: {
|
|
105
119
|
marginBottom: noMarginBottom ? 0 : undefined
|
|
106
120
|
},
|
|
@@ -220,7 +234,7 @@ const StyledTextField = styled(TextField).withConfig({
|
|
|
220
234
|
})(["", ""], ({
|
|
221
235
|
theme,
|
|
222
236
|
InputProps
|
|
223
|
-
}) => css(["&.", "{.MuiInputBase-root{margin-bottom:0;}.MuiInputBase-input{box-sizing:content-box;}.MuiOutlinedInput-input{padding:", ";}.MuiInputBase-inputSizeSmall{padding-top:10.5px;padding-bottom:10.5px;&:not(textarea){height:19px;}}.MuiInputBase-inputMultiline{padding:0;}}&.", ",&.", "{.", "{color:", "
|
|
237
|
+
}) => css(["&.", "{.MuiInputBase-root{margin-bottom:0;}.MuiInputBase-input{box-sizing:content-box;}.MuiOutlinedInput-input{padding:", ";}.MuiInputBase-inputSizeSmall{padding-top:10.5px;padding-bottom:10.5px;&:not(textarea){height:19px;}}.MuiInputBase-inputMultiline{padding:0;}}&.", " .", "{margin-right:", ";}&.", ",&.", "{.", "{color:", ";p{font-size:", "px;margin:0;}.dot-icon i{margin-top:-2px;}}.MuiInputBase-root{margin-bottom:0;}.MuiInputBase-inputSizeSmall:not(textarea){height:19px;padding-top:10.5px;padding-bottom:10.5px;}select.dot-select{padding-left:", ";}.MuiSelect-select:focus{background-color:transparent;}.MuiSelect-icon{right:", ";}&.", "{.MuiOutlinedInput-notchedOutline{border-color:", ";}.MuiFormLabel-root.Mui-focused{color:", ";}.", " .dot-icon{color:", ";}}&.", "{.MuiInputLabel-outlined.MuiInputLabel-shrink{color:", ";}.", " .dot-icon{color:", ";}}&.", "{.MuiOutlinedInput-notchedOutline{border-color:", ";}.MuiInputLabel-outlined.MuiInputLabel-shrink{color:", ";}.", " .dot-icon{color:", ";}}.MuiOutlinedInput-adornedStart{padding-left:12px;&.", " .", "{border-color:", ";}}.MuiInputLabel-outlined.MuiInputLabel-shrink{color:", ";}.MuiInputBase-inputAdornedStart{padding-left:12px;}.MuiInputBase-inputAdornedEnd{padding-right:12px;}.MuiFormHelperText-root{", ";}}"], rootClassName$13, InputProps.startAdornment ? `18px 12px 18px 0px` : `18px 12px`, rootSelectClassName, adornmentIconClassName, theme.spacing(2), rootSelectClassName, rootClassName$13, adornmentIconClassName, theme.palette.layer.n700, theme.typography.body2.fontSize, theme.spacing(1.5), InputProps.endAdornment ? `44px` : `12px`, successClassName, theme.palette.secondary.main, theme.palette.grey[700], adornmentIconClassName, theme.palette.secondary.main, errorClassName, theme.palette.error.main, adornmentIconClassName, theme.palette.error.main, warningClassName, theme.palette.warning.main, theme.palette.grey[700], adornmentIconClassName, theme.palette.warning.main, warningClassName, fieldsetClassName, theme.palette.warning[500], theme.palette.grey[700], formHelperTextRootStyles(theme)));
|
|
224
238
|
|
|
225
239
|
const rootClassName$12 = 'dot-action-toolbar';
|
|
226
240
|
const StyledToolbar = styled(Toolbar).withConfig({
|
|
@@ -1655,6 +1669,7 @@ const AvatarContent = ({
|
|
|
1655
1669
|
const DotAvatar = ({
|
|
1656
1670
|
alt,
|
|
1657
1671
|
ariaLabel,
|
|
1672
|
+
ariaRole: _ariaRole = 'img',
|
|
1658
1673
|
className,
|
|
1659
1674
|
component: _component = 'div',
|
|
1660
1675
|
color,
|
|
@@ -1691,6 +1706,7 @@ const DotAvatar = ({
|
|
|
1691
1706
|
component: onClick ? 'button' : _component,
|
|
1692
1707
|
"data-testid": dataTestId,
|
|
1693
1708
|
onClick: event => onClick ? onClick(event) : null,
|
|
1709
|
+
role: onClick ? 'button' : _ariaRole,
|
|
1694
1710
|
src: _type === 'image' ? imageSrc : null,
|
|
1695
1711
|
style: style,
|
|
1696
1712
|
tabIndex: tooltip ? _tabIndex : undefined,
|
|
@@ -1700,9 +1716,9 @@ const DotAvatar = ({
|
|
|
1700
1716
|
"data-testid": dataTestId,
|
|
1701
1717
|
iconId: iconId,
|
|
1702
1718
|
imageSrc: imageSrc,
|
|
1719
|
+
size: _size,
|
|
1703
1720
|
text: _text,
|
|
1704
|
-
type: _type
|
|
1705
|
-
size: _size
|
|
1721
|
+
type: _type
|
|
1706
1722
|
}, void 0)
|
|
1707
1723
|
}), void 0)
|
|
1708
1724
|
}), void 0);
|
|
@@ -1714,11 +1730,12 @@ const StyledButton = styled(Button).withConfig({
|
|
|
1714
1730
|
componentId: "sx99hh-0"
|
|
1715
1731
|
})(["", ""], ({
|
|
1716
1732
|
theme
|
|
1717
|
-
}) => css(["&.", "{margin:", ";min-width:auto;white-space:nowrap
|
|
1733
|
+
}) => css(["&.", "{margin:", ";padding:", ";min-width:auto;white-space:nowrap;&:hover{background-color:", ";}&:active{background-color:", ";}&.MuiButton-containedSecondary{background-color:", ";&:hover{background-color:", ";}&:active{background-color:", ";}}&.MuiButton-outlined,&.MuiButton-text{&:hover{background-color:", ";}&:active{background-color:", ";}}&.MuiButton-outlined{border-color:", ";color:", ";}&.MuiButton-text{background-color:transparent;color:", ";}&.Mui-disabled{background-color:", ";color:", ";&.MuiButton-outlined{border-color:", ";}&.MuiButton-text,&.MuiButton-containedSecondary{background-color:transparent;}}&:not(.MuiButton-sizeLarge):not(.MuiButton-sizeSmall){height:", ";}.dot-icon{display:flex;padding:0;}}"], rootClassName$$, theme.spacing(0.5), theme.spacing(0.75, 2), theme.palette.primary[800], theme.palette.primary[400], theme.palette.error[500], theme.palette.error[600], theme.palette.error[400], theme.palette.grey[50], theme.palette.grey[100], theme.palette.grey[300], theme.palette.grey[700], theme.palette.grey[700], theme.palette.grey[50], theme.palette.grey[400], theme.palette.grey[200], theme.spacing(5)));
|
|
1718
1734
|
|
|
1719
1735
|
/** This component wraps the Button component from @material-ui. */
|
|
1720
1736
|
const DotButton = /*#__PURE__*/forwardRef(({
|
|
1721
1737
|
ariaLabel,
|
|
1738
|
+
ariaRole: _ariaRole = 'button',
|
|
1722
1739
|
autoFocus: _autoFocus = false,
|
|
1723
1740
|
children,
|
|
1724
1741
|
className,
|
|
@@ -1775,6 +1792,7 @@ const DotButton = /*#__PURE__*/forwardRef(({
|
|
|
1775
1792
|
onClick: event => onClick && onClick(event),
|
|
1776
1793
|
onKeyDown: onKeyDown,
|
|
1777
1794
|
ref: ref,
|
|
1795
|
+
role: _ariaRole,
|
|
1778
1796
|
size: _size,
|
|
1779
1797
|
startIcon: startIcon,
|
|
1780
1798
|
tabIndex: tabIndex,
|
|
@@ -1794,6 +1812,7 @@ const StyledLink = styled(Link).withConfig({
|
|
|
1794
1812
|
|
|
1795
1813
|
const DotLink = ({
|
|
1796
1814
|
ariaLabel,
|
|
1815
|
+
ariaRole: _ariaRole = 'link',
|
|
1797
1816
|
children,
|
|
1798
1817
|
className,
|
|
1799
1818
|
color: _color = 'primary',
|
|
@@ -1831,6 +1850,7 @@ const DotLink = ({
|
|
|
1831
1850
|
onMouseEnter: onMouseEnter,
|
|
1832
1851
|
onPointerDown: onPointerDown,
|
|
1833
1852
|
rel: _rel,
|
|
1853
|
+
role: _ariaRole,
|
|
1834
1854
|
tabIndex: _tabIndex,
|
|
1835
1855
|
target: target,
|
|
1836
1856
|
underline: underline
|
|
@@ -2126,6 +2146,7 @@ const DotMenuList = /*#__PURE__*/forwardRef(({
|
|
|
2126
2146
|
const DotMenu = ({
|
|
2127
2147
|
anchorEl,
|
|
2128
2148
|
ariaLabel,
|
|
2149
|
+
ariaRole: _ariaRole = 'menu',
|
|
2129
2150
|
className,
|
|
2130
2151
|
'data-testid': dataTestId,
|
|
2131
2152
|
dense: _dense = true,
|
|
@@ -2223,6 +2244,7 @@ const DotMenu = ({
|
|
|
2223
2244
|
onSelect: onSelect,
|
|
2224
2245
|
selectedKey: selectedKey
|
|
2225
2246
|
}, void 0),
|
|
2247
|
+
ariaRole: _ariaRole,
|
|
2226
2248
|
selectedKey: selectedKey
|
|
2227
2249
|
}, void 0)
|
|
2228
2250
|
}), void 0)
|
|
@@ -2269,6 +2291,7 @@ const StyledIconButton = styled(IconButton).withConfig({
|
|
|
2269
2291
|
|
|
2270
2292
|
const DotIconButton = ({
|
|
2271
2293
|
ariaLabel,
|
|
2294
|
+
ariaRole: _ariaRole = 'button',
|
|
2272
2295
|
className,
|
|
2273
2296
|
color: _color = 'inherit',
|
|
2274
2297
|
'data-testid': dataTestId,
|
|
@@ -2296,6 +2319,7 @@ const DotIconButton = ({
|
|
|
2296
2319
|
disableRipple: _disableRipple,
|
|
2297
2320
|
disabled: _disabled,
|
|
2298
2321
|
onClick: event => onClick && onClick(event),
|
|
2322
|
+
role: _ariaRole,
|
|
2299
2323
|
size: _size
|
|
2300
2324
|
}, {
|
|
2301
2325
|
children: jsx(DotIcon, {
|
|
@@ -2318,8 +2342,10 @@ const DotDrawerHeader = ({
|
|
|
2318
2342
|
const rootClasses = useStylesWithRootClass(rootClassName$T, className);
|
|
2319
2343
|
return jsxs(StyleDrawerHeader, Object.assign({
|
|
2320
2344
|
"aria-label": ariaLabel,
|
|
2345
|
+
"aria-level": 2,
|
|
2321
2346
|
className: rootClasses,
|
|
2322
|
-
"data-testid": dataTestId
|
|
2347
|
+
"data-testid": dataTestId,
|
|
2348
|
+
role: "heading"
|
|
2323
2349
|
}, {
|
|
2324
2350
|
children: [children, variant !== 'permanent' && jsx(DotIconButton, {
|
|
2325
2351
|
className: "close-button",
|
|
@@ -2337,6 +2363,7 @@ const StyleDrawerBody = styled.div.withConfig({
|
|
|
2337
2363
|
|
|
2338
2364
|
const DotDrawerBody = ({
|
|
2339
2365
|
ariaLabel,
|
|
2366
|
+
ariaRole: _ariaRole = 'region',
|
|
2340
2367
|
children,
|
|
2341
2368
|
className,
|
|
2342
2369
|
'data-testid': dataTestId,
|
|
@@ -2348,7 +2375,8 @@ const DotDrawerBody = ({
|
|
|
2348
2375
|
return jsxs(StyleDrawerBody, Object.assign({
|
|
2349
2376
|
"aria-label": ariaLabel,
|
|
2350
2377
|
className: rootClasses,
|
|
2351
|
-
"data-testid": dataTestId
|
|
2378
|
+
"data-testid": dataTestId,
|
|
2379
|
+
role: _ariaRole
|
|
2352
2380
|
}, {
|
|
2353
2381
|
children: [children, !headerExists && variant !== 'permanent' && jsx(DotIconButton, {
|
|
2354
2382
|
className: "dot-drawer-close-button",
|
|
@@ -2368,6 +2396,7 @@ const StyleDrawerFooter = styled.div.withConfig({
|
|
|
2368
2396
|
|
|
2369
2397
|
const DotDrawerFooter = ({
|
|
2370
2398
|
ariaLabel,
|
|
2399
|
+
ariaRole: _ariaRole = 'region',
|
|
2371
2400
|
children,
|
|
2372
2401
|
className,
|
|
2373
2402
|
'data-testid': dataTestId
|
|
@@ -2376,7 +2405,8 @@ const DotDrawerFooter = ({
|
|
|
2376
2405
|
return jsx(StyleDrawerFooter, Object.assign({
|
|
2377
2406
|
"aria-label": ariaLabel,
|
|
2378
2407
|
className: rootClasses,
|
|
2379
|
-
"data-testid": dataTestId
|
|
2408
|
+
"data-testid": dataTestId,
|
|
2409
|
+
role: _ariaRole
|
|
2380
2410
|
}, {
|
|
2381
2411
|
children: children
|
|
2382
2412
|
}), void 0);
|
|
@@ -2385,6 +2415,7 @@ const DotDrawerFooter = ({
|
|
|
2385
2415
|
const DotDrawer = ({
|
|
2386
2416
|
anchor: _anchor = 'right',
|
|
2387
2417
|
ariaLabel,
|
|
2418
|
+
ariaRole: _ariaRole = 'presentation',
|
|
2388
2419
|
className,
|
|
2389
2420
|
children,
|
|
2390
2421
|
'data-testid': dataTestId,
|
|
@@ -2414,7 +2445,9 @@ const DotDrawer = ({
|
|
|
2414
2445
|
const bodyTestId = drawerBodyProps ? drawerBodyProps[`data-testid`] : 'drawer-body';
|
|
2415
2446
|
return jsxs(StyledDrawer, Object.assign({
|
|
2416
2447
|
ModalProps: ModalProps,
|
|
2417
|
-
PaperProps: PaperProps,
|
|
2448
|
+
PaperProps: Object.assign(Object.assign({}, PaperProps), {
|
|
2449
|
+
role: _ariaRole
|
|
2450
|
+
}),
|
|
2418
2451
|
anchor: _anchor,
|
|
2419
2452
|
"aria-label": ariaLabel,
|
|
2420
2453
|
classes: {
|
|
@@ -2425,6 +2458,7 @@ const DotDrawer = ({
|
|
|
2425
2458
|
height: height,
|
|
2426
2459
|
onClose: handleClose,
|
|
2427
2460
|
open: open,
|
|
2461
|
+
role: _ariaRole,
|
|
2428
2462
|
variant: _variant,
|
|
2429
2463
|
width: _width
|
|
2430
2464
|
}, {
|
|
@@ -2483,6 +2517,7 @@ const DotListDivider = ({
|
|
|
2483
2517
|
};
|
|
2484
2518
|
const DotList = ({
|
|
2485
2519
|
ariaLabel,
|
|
2520
|
+
ariaRole: _ariaRole = 'list',
|
|
2486
2521
|
children,
|
|
2487
2522
|
className,
|
|
2488
2523
|
component: _component = 'ul',
|
|
@@ -2512,6 +2547,7 @@ const DotList = ({
|
|
|
2512
2547
|
dense: _dense,
|
|
2513
2548
|
disablePadding: _disablePadding,
|
|
2514
2549
|
ref: listRef,
|
|
2550
|
+
role: _ariaRole,
|
|
2515
2551
|
style: {
|
|
2516
2552
|
width: listWidth
|
|
2517
2553
|
}
|
|
@@ -2568,6 +2604,7 @@ const DotList = ({
|
|
|
2568
2604
|
};
|
|
2569
2605
|
const DotListItem = ({
|
|
2570
2606
|
ariaLabel,
|
|
2607
|
+
ariaRole: _ariaRole2 = 'listitem',
|
|
2571
2608
|
className,
|
|
2572
2609
|
component: _component2 = 'li',
|
|
2573
2610
|
'data-testid': dataTestId,
|
|
@@ -2634,6 +2671,7 @@ const DotListItem = ({
|
|
|
2634
2671
|
divider: _divider,
|
|
2635
2672
|
href: onClick ? null : href,
|
|
2636
2673
|
onClick: onClick || !href ? handleClick : null,
|
|
2674
|
+
role: onClick ? 'button' : _ariaRole2,
|
|
2637
2675
|
selected: isFlyout ? isOpened : selected,
|
|
2638
2676
|
target: target
|
|
2639
2677
|
}, {
|
|
@@ -2799,6 +2837,7 @@ const EndAdornment = ({
|
|
|
2799
2837
|
error,
|
|
2800
2838
|
dataTestId,
|
|
2801
2839
|
endIcon,
|
|
2840
|
+
endText,
|
|
2802
2841
|
success,
|
|
2803
2842
|
warning
|
|
2804
2843
|
}) => {
|
|
@@ -2814,7 +2853,7 @@ const EndAdornment = ({
|
|
|
2814
2853
|
className: `${adornmentIconClassName} end`,
|
|
2815
2854
|
position: "end"
|
|
2816
2855
|
}, {
|
|
2817
|
-
children: endAdornmentIcon
|
|
2856
|
+
children: endAdornmentIcon || endText
|
|
2818
2857
|
}), void 0);
|
|
2819
2858
|
return endAdornmentTooltip ? jsx(DotTooltip, Object.assign({
|
|
2820
2859
|
title: endAdornmentTooltip
|
|
@@ -2838,6 +2877,7 @@ const DotInputText = ({
|
|
|
2838
2877
|
hasDebounce,
|
|
2839
2878
|
helperText,
|
|
2840
2879
|
endIcon,
|
|
2880
|
+
endText,
|
|
2841
2881
|
id,
|
|
2842
2882
|
inputRef,
|
|
2843
2883
|
label,
|
|
@@ -2908,13 +2948,14 @@ const DotInputText = ({
|
|
|
2908
2948
|
children: startIcon
|
|
2909
2949
|
}), void 0);
|
|
2910
2950
|
};
|
|
2911
|
-
const
|
|
2912
|
-
if (!hasEndAdornmentIcon) return null;
|
|
2951
|
+
const endAdornmentIconOrText = () => {
|
|
2952
|
+
if (!hasEndAdornmentIcon && !endText) return null;
|
|
2913
2953
|
return jsx(EndAdornment, Object.assign({}, {
|
|
2914
2954
|
endAdornmentTooltip,
|
|
2915
2955
|
error: _error,
|
|
2916
2956
|
dataTestId,
|
|
2917
2957
|
endIcon,
|
|
2958
|
+
endText,
|
|
2918
2959
|
success,
|
|
2919
2960
|
warning: _warning
|
|
2920
2961
|
}), void 0);
|
|
@@ -2932,7 +2973,7 @@ const DotInputText = ({
|
|
|
2932
2973
|
}), void 0), jsx(StyledTextField, {
|
|
2933
2974
|
InputProps: {
|
|
2934
2975
|
startAdornment: startAdornmentIcon(),
|
|
2935
|
-
endAdornment:
|
|
2976
|
+
endAdornment: endAdornmentIconOrText()
|
|
2936
2977
|
},
|
|
2937
2978
|
"aria-label": name,
|
|
2938
2979
|
autoComplete: _autoComplete,
|
|
@@ -2984,6 +3025,7 @@ const StyledSearchInput = styled.span.withConfig({
|
|
|
2984
3025
|
|
|
2985
3026
|
function SearchInput({
|
|
2986
3027
|
'data-testid': dataTestId,
|
|
3028
|
+
ariaRole = 'searchbox',
|
|
2987
3029
|
autoFocus = true,
|
|
2988
3030
|
className,
|
|
2989
3031
|
disabled = false,
|
|
@@ -3028,6 +3070,7 @@ function SearchInput({
|
|
|
3028
3070
|
title: tooltip
|
|
3029
3071
|
}, {
|
|
3030
3072
|
children: jsx(DotInputText, {
|
|
3073
|
+
ariaRole: ariaRole,
|
|
3031
3074
|
"data-testid": dataTestId,
|
|
3032
3075
|
autoFocus: autoFocus,
|
|
3033
3076
|
className: "search-text",
|
|
@@ -3504,7 +3547,8 @@ const DotAppSwitcherView = ({
|
|
|
3504
3547
|
if (selectedAppType && appTypeMap && appTypeLabels) {
|
|
3505
3548
|
const labelConfig = appTypeLabels.get(selectedAppType);
|
|
3506
3549
|
return jsxs("div", Object.assign({
|
|
3507
|
-
className: "content"
|
|
3550
|
+
className: "content",
|
|
3551
|
+
role: "contentinfo"
|
|
3508
3552
|
}, {
|
|
3509
3553
|
children: [jsx("span", {
|
|
3510
3554
|
children: jsx(DotButton, Object.assign({
|
|
@@ -3520,7 +3564,9 @@ const DotAppSwitcherView = ({
|
|
|
3520
3564
|
}, void 0)
|
|
3521
3565
|
}), void 0)
|
|
3522
3566
|
}, void 0), jsx("div", Object.assign({
|
|
3523
|
-
|
|
3567
|
+
"aria-level": 2,
|
|
3568
|
+
className: "product-heading",
|
|
3569
|
+
role: "heading"
|
|
3524
3570
|
}, {
|
|
3525
3571
|
children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
|
|
3526
3572
|
}), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= _searchInstancesThreshold && jsx("div", Object.assign({
|
|
@@ -3533,14 +3579,16 @@ const DotAppSwitcherView = ({
|
|
|
3533
3579
|
value: searchText
|
|
3534
3580
|
}, void 0)
|
|
3535
3581
|
}), void 0), jsx("div", Object.assign({
|
|
3536
|
-
className: "product-applications"
|
|
3582
|
+
className: "product-applications",
|
|
3583
|
+
role: "list"
|
|
3537
3584
|
}, {
|
|
3538
3585
|
children: filteredAppInstances()
|
|
3539
3586
|
}), void 0)]
|
|
3540
3587
|
}), void 0);
|
|
3541
3588
|
} else {
|
|
3542
3589
|
return jsxs("div", Object.assign({
|
|
3543
|
-
className: "content"
|
|
3590
|
+
className: "content",
|
|
3591
|
+
role: "contentinfo"
|
|
3544
3592
|
}, {
|
|
3545
3593
|
children: [jsx(DotList, {
|
|
3546
3594
|
items: appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(item => ({
|
|
@@ -3554,7 +3602,9 @@ const DotAppSwitcherView = ({
|
|
|
3554
3602
|
const header = {
|
|
3555
3603
|
className: 'app-switcher-header',
|
|
3556
3604
|
children: jsxs("div", Object.assign({
|
|
3605
|
+
"aria-level": 1,
|
|
3557
3606
|
className: "app-switcher-header-title",
|
|
3607
|
+
role: "heading",
|
|
3558
3608
|
style: {
|
|
3559
3609
|
marginTop: _yOffset + 'px',
|
|
3560
3610
|
width: '80%'
|
|
@@ -3566,6 +3616,8 @@ const DotAppSwitcherView = ({
|
|
|
3566
3616
|
type: "image",
|
|
3567
3617
|
variant: "circular"
|
|
3568
3618
|
}, void 0), jsx(DotTypography, Object.assign({
|
|
3619
|
+
ariaRole: "heading",
|
|
3620
|
+
ariaLevel: 1,
|
|
3569
3621
|
className: "app-switcher-label"
|
|
3570
3622
|
}, {
|
|
3571
3623
|
children: "App switcher"
|
|
@@ -4307,6 +4359,7 @@ const DotAutoComplete = ({
|
|
|
4307
4359
|
disablePortal: _disablePortal = true,
|
|
4308
4360
|
endAdornmentTooltip,
|
|
4309
4361
|
error: _error = false,
|
|
4362
|
+
filterOptions,
|
|
4310
4363
|
filterSelectedOptions: _filterSelectedOptions = true,
|
|
4311
4364
|
freesolo: _freesolo = true,
|
|
4312
4365
|
checkIfOptionDisabled,
|
|
@@ -4314,6 +4367,7 @@ const DotAutoComplete = ({
|
|
|
4314
4367
|
helperText,
|
|
4315
4368
|
inputId,
|
|
4316
4369
|
inputRef,
|
|
4370
|
+
inputValue,
|
|
4317
4371
|
label,
|
|
4318
4372
|
loading,
|
|
4319
4373
|
maxHeight,
|
|
@@ -4469,9 +4523,9 @@ const DotAutoComplete = ({
|
|
|
4469
4523
|
}
|
|
4470
4524
|
});
|
|
4471
4525
|
// Create handler only if 'onInputChange' or 'actionItem' prop is defined
|
|
4472
|
-
const handleInputChange = (onInputChange || isActionItemDefined) && ((event,
|
|
4473
|
-
isActionItemDefined && setInputText(
|
|
4474
|
-
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(event,
|
|
4526
|
+
const handleInputChange = (onInputChange || isActionItemDefined) && ((event, currentInputValue, reason) => {
|
|
4527
|
+
isActionItemDefined && setInputText(currentInputValue);
|
|
4528
|
+
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(event, currentInputValue, reason);
|
|
4475
4529
|
}) || undefined;
|
|
4476
4530
|
// Create callback when action item click event handler is defined,
|
|
4477
4531
|
// free-solo mode is NOT set and 'Enter' key has been pressed
|
|
@@ -4528,11 +4582,13 @@ const DotAutoComplete = ({
|
|
|
4528
4582
|
"data-testid": dataTestId,
|
|
4529
4583
|
defaultValue: defaultValue,
|
|
4530
4584
|
disabled: _disabled,
|
|
4585
|
+
filterOptions: filterOptions,
|
|
4531
4586
|
filterSelectedOptions: _filterSelectedOptions,
|
|
4532
4587
|
freeSolo: _freesolo,
|
|
4533
4588
|
getOptionLabel: option => parseAutoCompleteValue(option),
|
|
4534
4589
|
getOptionDisabled: checkIfOptionDisabled,
|
|
4535
4590
|
groupBy: _group ? option => option.group : undefined,
|
|
4591
|
+
inputValue: inputValue,
|
|
4536
4592
|
ListboxComponent: ListboxComponent,
|
|
4537
4593
|
loading: loading,
|
|
4538
4594
|
multiple: _multiple,
|
|
@@ -4565,7 +4621,7 @@ const DotAutoComplete = ({
|
|
|
4565
4621
|
// passed to renderInput includes inputProps and InputProps properties
|
|
4566
4622
|
// that must be passed to TextField in order for Autocomplete to work
|
|
4567
4623
|
// correctly. We decided that at this time exposing those props in
|
|
4568
|
-
// DotInputText would not be a worthwhile tradeoff. Instead we are
|
|
4624
|
+
// DotInputText would not be a worthwhile tradeoff. Instead, we are
|
|
4569
4625
|
// using the StyledTextField used by DotInputText so that we will
|
|
4570
4626
|
// at least pick up any styling that is used there. Should additional
|
|
4571
4627
|
// functionality be added to DotInputText we will have to make a
|
|
@@ -4969,7 +5025,9 @@ const DotBreadcrumbs = ({
|
|
|
4969
5025
|
itemsAfterCollapse: itemsAfterCollapse,
|
|
4970
5026
|
maxItems: getMaxItems(adjustMaxItems, maxVisibleItems, maxItems),
|
|
4971
5027
|
ref: breadcrumbRef,
|
|
5028
|
+
role: "navigation",
|
|
4972
5029
|
separator: jsx(DotIcon, {
|
|
5030
|
+
ariaRole: "presentation",
|
|
4973
5031
|
className: "separator",
|
|
4974
5032
|
iconId: "chevron-right"
|
|
4975
5033
|
}, void 0)
|
|
@@ -6052,6 +6110,7 @@ const DotInputSelect = ({
|
|
|
6052
6110
|
defaultValue,
|
|
6053
6111
|
disabled: _disabled = false,
|
|
6054
6112
|
endIcon,
|
|
6113
|
+
endText,
|
|
6055
6114
|
error: _error = false,
|
|
6056
6115
|
fullWidth: _fullWidth = true,
|
|
6057
6116
|
helperText,
|
|
@@ -6076,6 +6135,7 @@ const DotInputSelect = ({
|
|
|
6076
6135
|
}) => {
|
|
6077
6136
|
const hasWarning = !_error && _warning && warningClassName;
|
|
6078
6137
|
const hasSuccess = !_error && !_warning && success && successClassName;
|
|
6138
|
+
const endAdornment = endIcon || endText;
|
|
6079
6139
|
const rootStyles = useStylesWithRootClass(rootSelectClassName, hasSuccess, hasWarning, _readOnly ? 'read-only' : '');
|
|
6080
6140
|
const getOption = option => {
|
|
6081
6141
|
return typeof option === 'string' ? option : option.option;
|
|
@@ -6100,11 +6160,11 @@ const DotInputSelect = ({
|
|
|
6100
6160
|
}, {
|
|
6101
6161
|
children: startIcon
|
|
6102
6162
|
}), void 0),
|
|
6103
|
-
endAdornment:
|
|
6163
|
+
endAdornment: endAdornment && jsx(StyledAdornment, Object.assign({
|
|
6104
6164
|
className: `${adornmentIconClassName} end`,
|
|
6105
6165
|
position: "end"
|
|
6106
6166
|
}, {
|
|
6107
|
-
children:
|
|
6167
|
+
children: endAdornment
|
|
6108
6168
|
}), void 0)
|
|
6109
6169
|
},
|
|
6110
6170
|
SelectProps: {
|
|
@@ -6252,6 +6312,7 @@ function DotRadioButton({
|
|
|
6252
6312
|
return jsx(StyledFormControlLabel, {
|
|
6253
6313
|
className: rootClasses,
|
|
6254
6314
|
control: radioControl,
|
|
6315
|
+
"aria-label": value,
|
|
6255
6316
|
label: label || radioControl,
|
|
6256
6317
|
labelPlacement: labelPlacement,
|
|
6257
6318
|
value: value
|
|
@@ -6260,6 +6321,7 @@ function DotRadioButton({
|
|
|
6260
6321
|
|
|
6261
6322
|
const DotRadioGroup = ({
|
|
6262
6323
|
ariaLabel,
|
|
6324
|
+
ariaRole: _ariaRole = 'radiogroup',
|
|
6263
6325
|
className,
|
|
6264
6326
|
'data-testid': dataTestId,
|
|
6265
6327
|
defaultValue,
|
|
@@ -6338,6 +6400,7 @@ const DotRadioGroup = ({
|
|
|
6338
6400
|
defaultValue: defaultValue,
|
|
6339
6401
|
name: name,
|
|
6340
6402
|
onChange: handleChange,
|
|
6403
|
+
role: _ariaRole,
|
|
6341
6404
|
row: row,
|
|
6342
6405
|
value: selectedValue
|
|
6343
6406
|
}, {
|
|
@@ -7054,6 +7117,7 @@ const checkIfEmptyValue = inputValue => inputValue.trim() === '';
|
|
|
7054
7117
|
*/
|
|
7055
7118
|
const DotInlineEdit = ({
|
|
7056
7119
|
ariaLabel,
|
|
7120
|
+
ariaRole: _ariaRole = 'combobox',
|
|
7057
7121
|
bindings,
|
|
7058
7122
|
charactersLimit,
|
|
7059
7123
|
className,
|
|
@@ -7186,7 +7250,8 @@ const DotInlineEdit = ({
|
|
|
7186
7250
|
children: viewModeChildren
|
|
7187
7251
|
}), void 0) : jsx("div", Object.assign({
|
|
7188
7252
|
className: viewModeClasses,
|
|
7189
|
-
"data-testid": dataTestId && `${dataTestId}-view-mode-wrapper
|
|
7253
|
+
"data-testid": dataTestId && `${dataTestId}-view-mode-wrapper`,
|
|
7254
|
+
role: "presentation"
|
|
7190
7255
|
}, {
|
|
7191
7256
|
children: viewModeChildren
|
|
7192
7257
|
}), void 0);
|
|
@@ -7258,6 +7323,7 @@ const DotInlineEdit = ({
|
|
|
7258
7323
|
onMouseOut: () => handleShowTooltip(false),
|
|
7259
7324
|
onKeyDown: !readOnly ? event => handleKeyPress(event) : undefined,
|
|
7260
7325
|
ref: inlineEditRef,
|
|
7326
|
+
role: _ariaRole,
|
|
7261
7327
|
tabIndex: !readOnly ? _tabIndex : undefined,
|
|
7262
7328
|
typography: _typography
|
|
7263
7329
|
}, {
|
|
@@ -7344,19 +7410,23 @@ const StyledPill = styled(Chip).withConfig({
|
|
|
7344
7410
|
componentId: "l7oxi2-0"
|
|
7345
7411
|
})(["", ""], ({
|
|
7346
7412
|
theme
|
|
7347
|
-
}) => css(["&.", "{background-color:", ";color:", ";
|
|
7413
|
+
}) => css(["&.", "{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}&.MuiChip-outlined{&.error{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.success{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.warning{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.in-progress{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}}&.MuiChip-filled{&.error{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.success{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.warning{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}&.in-progress{background-color:", ";border-color:", ";color:", ";.dot-icon{color:", ";}}}}"], rootClassName$n, ({
|
|
7348
7414
|
backgroundcolor
|
|
7349
7415
|
}) => {
|
|
7350
7416
|
return backgroundcolor || theme.palette.grey[200];
|
|
7417
|
+
}, ({
|
|
7418
|
+
bordercolor
|
|
7419
|
+
}) => {
|
|
7420
|
+
return bordercolor ? bordercolor : theme.palette.layer.n700;
|
|
7351
7421
|
}, ({
|
|
7352
7422
|
labelcolor
|
|
7353
7423
|
}) => {
|
|
7354
7424
|
return labelcolor ? labelcolor : theme.palette.layer.n700;
|
|
7355
7425
|
}, ({
|
|
7356
|
-
|
|
7426
|
+
labelcolor
|
|
7357
7427
|
}) => {
|
|
7358
|
-
return
|
|
7359
|
-
}, theme.palette.error[100], theme.palette.error.main, theme.palette.
|
|
7428
|
+
return labelcolor ? labelcolor : theme.palette.layer.n700;
|
|
7429
|
+
}, theme.palette.error[100], theme.palette.error.main, theme.palette.layer.n700, theme.palette.error.main, theme.palette.success[100], theme.palette.success.main, theme.palette.layer.n700, theme.palette.success.main, theme.palette.warning[100], theme.palette.warning.main, theme.palette.layer.n700, theme.palette.warning.main, theme.palette.primary[100], theme.palette.primary.main, theme.palette.layer.n700, theme.palette.primary.main, theme.palette.error.main, theme.palette.error.main, theme.palette.layer.n0, theme.palette.layer.n0, theme.palette.success.main, theme.palette.success.main, theme.palette.layer.n0, theme.palette.layer.n0, theme.palette.warning.main, theme.palette.warning.main, theme.palette.layer.n700, theme.palette.layer.n700, theme.palette.primary.main, theme.palette.primary.main, theme.palette.layer.n0, theme.palette.layer.n0));
|
|
7360
7430
|
|
|
7361
7431
|
const DotPill = ({
|
|
7362
7432
|
ariaLabel,
|
|
@@ -9179,6 +9249,7 @@ const joinAcceptedAndRejectedFiles = (filesAccepted, filesRejected) => mapAccept
|
|
|
9179
9249
|
const DotFileUpload = ({
|
|
9180
9250
|
accept,
|
|
9181
9251
|
ariaLabel,
|
|
9252
|
+
ariaRole: _ariaRole = 'region',
|
|
9182
9253
|
buttonOnly: _buttonOnly = false,
|
|
9183
9254
|
className,
|
|
9184
9255
|
'data-testid': dataTestId,
|
|
@@ -9242,7 +9313,8 @@ const DotFileUpload = ({
|
|
|
9242
9313
|
uploadedFiles
|
|
9243
9314
|
});
|
|
9244
9315
|
return jsxs(StyledFileUploadContainer, Object.assign({
|
|
9245
|
-
className: containerClassName$2
|
|
9316
|
+
className: containerClassName$2,
|
|
9317
|
+
role: _ariaRole
|
|
9246
9318
|
}, {
|
|
9247
9319
|
children: [jsxs(StyledFileUpload, Object.assign({}, getRootProps(), {
|
|
9248
9320
|
"aria-label": ariaLabel,
|
|
@@ -9815,6 +9887,7 @@ const DotTimePicker = ({
|
|
|
9815
9887
|
onClose,
|
|
9816
9888
|
onKeyDown,
|
|
9817
9889
|
onOpen,
|
|
9890
|
+
onPopperTimeChange,
|
|
9818
9891
|
open,
|
|
9819
9892
|
persistentLabel,
|
|
9820
9893
|
readOnly: _readOnly = false,
|
|
@@ -9874,6 +9947,7 @@ const DotTimePicker = ({
|
|
|
9874
9947
|
};
|
|
9875
9948
|
const handlePickerChange = pickedDateTime => {
|
|
9876
9949
|
setPickerTime(pickedDateTime);
|
|
9950
|
+
onPopperTimeChange && onPopperTimeChange(pickedDateTime.format(DEFAULT_TIME_FORMAT));
|
|
9877
9951
|
};
|
|
9878
9952
|
const handleInputChange = (currentValue, context) => {
|
|
9879
9953
|
const currentTimeValue = currentValue ? currentValue : null;
|