@digital-ai/dot-components 2.15.1 → 2.16.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/CHANGE_LOG.md +35 -2
- package/index.esm.js +81 -33
- package/index.umd.js +120 -57
- package/lib/components/button/CopyButton.d.ts +10 -3
- package/lib/components/button/CopyButton.stories.d.ts +1 -1
- package/lib/components/button/IconButton.d.ts +5 -3
- package/lib/components/file-upload/FileListItem.styles.d.ts +1 -1
- package/lib/components/file-upload/FileUpload.d.ts +13 -1
- package/lib/components/file-upload/FileUpload.stories.d.ts +2 -1
- package/lib/components/file-upload/utils/helpers.d.ts +4 -3
- package/lib/components/file-upload/utils/models.d.ts +2 -0
- package/lib/components/list/ListItem.styles.d.ts +2 -40
- package/lib/components/tooltip/Tooltip.d.ts +3 -1
- package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/lib/components/truncate-with-tooltip/TruncateWithTooltip.d.ts +3 -1
- package/lib/components/truncate-with-tooltip/TruncateWithTooltip.stories.d.ts +1 -1
- package/package.json +1 -1
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.16.0](https://www.npmjs.com/package/@digital-ai/dot-components) (09/28/2023)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.15.2...2.16.0)
|
|
6
|
+
|
|
7
|
+
**Features:**
|
|
8
|
+
|
|
9
|
+
- S-96608: `DotFileUpload` Allow to pass props to upload button [\#1627](https://github.com/digital-ai/dot-components/pull/1627) ([angel-git](https://github.com/angel-git))
|
|
10
|
+
- S-96168: Add DotIconButton props to DotCopyButton [\#1626](https://github.com/digital-ai/dot-components/pull/1626) ([jmcnally](https://github.com/jmcnally))
|
|
11
|
+
- D-21922: Support `arrow` prop in tooltip components [\#1615](https://github.com/digital-ai/dot-components/pull/1615) ([BoraAksoy](https://github.com/BoraAksoy))
|
|
12
|
+
|
|
13
|
+
**Fixed bugs:**
|
|
14
|
+
|
|
15
|
+
- D-26820: `DotInputText` Fix double tab issue [\#1629](https://github.com/digital-ai/dot-components/pull/1629) ([dmiletic85](https://github.com/dmiletic85))
|
|
16
|
+
|
|
17
|
+
**Misc:**
|
|
18
|
+
|
|
19
|
+
- Master \> Develop [\#1624](https://github.com/digital-ai/dot-components/pull/1624) ([ryangamble](https://github.com/ryangamble))
|
|
20
|
+
|
|
21
|
+
## [2.15.2](https://www.npmjs.com/package/@digital-ai/dot-components) (09/25/2023)
|
|
22
|
+
|
|
23
|
+
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.15.1...2.15.2)
|
|
24
|
+
|
|
25
|
+
**Fixed bugs:**
|
|
26
|
+
|
|
27
|
+
- D-26652: Use ListItemButton in DotList [\#1618](https://github.com/digital-ai/dot-components/pull/1618) ([ryangamble](https://github.com/ryangamble))
|
|
28
|
+
|
|
29
|
+
**Misc:**
|
|
30
|
+
|
|
31
|
+
- Master \> Develop [\#1622](https://github.com/digital-ai/dot-components/pull/1622) ([angel-git](https://github.com/angel-git))
|
|
32
|
+
|
|
3
33
|
## [2.15.1](https://www.npmjs.com/package/@digital-ai/dot-components) (09/25/2023)
|
|
4
34
|
|
|
5
35
|
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.15.0...2.15.1)
|
|
@@ -308,7 +338,6 @@
|
|
|
308
338
|
**Misc:**
|
|
309
339
|
|
|
310
340
|
- S-91314: Remove use of deprecated `StylesProvider` [\#1457](https://github.com/digital-ai/dot-components/pull/1457) ([CWSites](https://github.com/CWSites))
|
|
311
|
-
- S-91975: `TimePicker` - Improve keyboard access [\#1455](https://github.com/digital-ai/dot-components/pull/1455) ([dmiletic85](https://github.com/dmiletic85))
|
|
312
341
|
|
|
313
342
|
## [2.7.0](https://www.npmjs.com/package/@digital-ai/dot-components) (04/14/2023)
|
|
314
343
|
|
|
@@ -323,6 +352,10 @@
|
|
|
323
352
|
|
|
324
353
|
- D-24793: `DotTimePicker` - set clock instead of calendar icon [\#1444](https://github.com/digital-ai/dot-components/pull/1444) ([dmiletic85](https://github.com/dmiletic85))
|
|
325
354
|
|
|
355
|
+
**Misc:**
|
|
356
|
+
|
|
357
|
+
- S-91975: `TimePicker` - Improve keyboard access [\#1455](https://github.com/digital-ai/dot-components/pull/1455) ([dmiletic85](https://github.com/dmiletic85))
|
|
358
|
+
|
|
326
359
|
## [2.6.1](https://www.npmjs.com/package/@digital-ai/dot-components) (04/06/2023)
|
|
327
360
|
|
|
328
361
|
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.6.0...2.6.1)
|
|
@@ -1000,7 +1033,6 @@
|
|
|
1000
1033
|
- S-81968: `ButtonToggle`: Add class prop into `ButtonToggleProps` and export relevant types and interfaces [\#993](https://github.com/digital-ai/dot-components/pull/993) ([dmiletic85](https://github.com/dmiletic85))
|
|
1001
1034
|
- S-81966: `Divider`: Create and expose `Divider` component [\#992](https://github.com/digital-ai/dot-components/pull/992) ([dmiletic85](https://github.com/dmiletic85))
|
|
1002
1035
|
- S-81656: `Popper`: Create and expose `Popper` component [\#988](https://github.com/digital-ai/dot-components/pull/988) ([dmiletic85](https://github.com/dmiletic85))
|
|
1003
|
-
- S-81802: Add 'Clear all' button to DotTable multiSelect toolbar [\#987](https://github.com/digital-ai/dot-components/pull/987) ([selsemore](https://github.com/selsemore))
|
|
1004
1036
|
- S-81693: `Menu`: add multi-level support [\#981](https://github.com/digital-ai/dot-components/pull/981) ([dmiletic85](https://github.com/dmiletic85))
|
|
1005
1037
|
|
|
1006
1038
|
**Fixed bugs:**
|
|
@@ -1028,6 +1060,7 @@
|
|
|
1028
1060
|
|
|
1029
1061
|
**Features:**
|
|
1030
1062
|
|
|
1063
|
+
- S-81802: Add 'Clear all' button to DotTable multiSelect toolbar [\#987](https://github.com/digital-ai/dot-components/pull/987) ([selsemore](https://github.com/selsemore))
|
|
1031
1064
|
- S-76952: `AutoComplete`: Add dense prop [\#976](https://github.com/digital-ai/dot-components/pull/976) ([dmiletic85](https://github.com/dmiletic85))
|
|
1032
1065
|
- S-81503: `Autocomplete` Improve functionality for adding new item [\#957](https://github.com/digital-ai/dot-components/pull/957) ([dmiletic85](https://github.com/dmiletic85))
|
|
1033
1066
|
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useEffect, useState, useRef, useMemo, useContext, createContext, forwardRef, useCallback, createElement, Fragment as Fragment$1, 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';
|
|
4
|
+
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, StyledEngineProvider, Avatar, Button, Link, List, ListItem, ListItemButton, 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';
|
|
@@ -22,6 +22,7 @@ function useStylesWithRootClass(name, className, ...args) {
|
|
|
22
22
|
const DotTooltip = ({
|
|
23
23
|
ariaLabel,
|
|
24
24
|
ariaRole: _ariaRole = 'tooltip',
|
|
25
|
+
arrow: _arrow = true,
|
|
25
26
|
children,
|
|
26
27
|
className,
|
|
27
28
|
'data-testid': dataTestId,
|
|
@@ -35,6 +36,7 @@ const DotTooltip = ({
|
|
|
35
36
|
return title ? jsx(Tooltip, Object.assign({
|
|
36
37
|
"aria-hidden": false,
|
|
37
38
|
"aria-label": ariaLabel || title.toString(),
|
|
39
|
+
arrow: _arrow,
|
|
38
40
|
className: rootClasses,
|
|
39
41
|
"data-testid": dataTestId,
|
|
40
42
|
leaveDelay: leaveDelay,
|
|
@@ -1915,12 +1917,16 @@ const getChevronIcon = (nestedListType, isOpened) => {
|
|
|
1915
1917
|
const flyoutListItemClassName = 'dot-flyout-list-item';
|
|
1916
1918
|
const flyoutItemLinkClassName = 'dot-flyout-item-link';
|
|
1917
1919
|
const listItemLinkClassName = 'dot-list-item-link';
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1920
|
+
const styledListItemElement = elementType => {
|
|
1921
|
+
return styled(elementType).withConfig({
|
|
1922
|
+
displayName: "ListItemstyles",
|
|
1923
|
+
componentId: "sc-1fawh8v-0"
|
|
1924
|
+
})(["", ""], ({
|
|
1925
|
+
theme
|
|
1926
|
+
}) => css(["&.", "{&.", "{padding:0;}.dot-tooltip{display:flex;width:100%;}p.MuiTypography-root{flex-grow:2;margin-bottom:0;}.", "{align-items:center;display:flex;flex-grow:2;}.", " .MuiIcon-root{margin-right:", ";}.dot-icon i:before{color:", ";}}"], listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary));
|
|
1927
|
+
};
|
|
1928
|
+
const StyledListItem = styledListItemElement(ListItem);
|
|
1929
|
+
const StyledListItemButton = styledListItemElement(ListItemButton);
|
|
1924
1930
|
|
|
1925
1931
|
const rootClassName$Y = 'dot-progress';
|
|
1926
1932
|
const StyledCircularProgress = styled(CircularProgress).withConfig({
|
|
@@ -2717,7 +2723,8 @@ const DotListItem = ({
|
|
|
2717
2723
|
children: startIcon
|
|
2718
2724
|
}, void 0), renderListItemText(), showEndIcon && renderListItemEndIcon()]
|
|
2719
2725
|
}), void 0);
|
|
2720
|
-
|
|
2726
|
+
const ListItem = onClick || href ? StyledListItemButton : StyledListItem;
|
|
2727
|
+
return jsx(ListItem, Object.assign({
|
|
2721
2728
|
"aria-label": ariaLabel || tooltip,
|
|
2722
2729
|
classes: {
|
|
2723
2730
|
root: rootClasses
|
|
@@ -3054,11 +3061,12 @@ const DotInputText = ({
|
|
|
3054
3061
|
shrink: _type === 'date' ? true : shrink
|
|
3055
3062
|
},
|
|
3056
3063
|
inputProps: {
|
|
3057
|
-
'data-testid': dataTestId,
|
|
3058
3064
|
className: inputClassName,
|
|
3059
|
-
|
|
3065
|
+
'data-testid': dataTestId,
|
|
3060
3066
|
max,
|
|
3061
|
-
min
|
|
3067
|
+
min,
|
|
3068
|
+
readOnly: _readOnly,
|
|
3069
|
+
tabIndex: 0
|
|
3062
3070
|
},
|
|
3063
3071
|
inputRef: inputRef,
|
|
3064
3072
|
label: persistentLabel ? null : label,
|
|
@@ -3075,7 +3083,6 @@ const DotInputText = ({
|
|
|
3075
3083
|
required: _required,
|
|
3076
3084
|
role: "textbox",
|
|
3077
3085
|
size: _size,
|
|
3078
|
-
tabIndex: 0,
|
|
3079
3086
|
type: _type,
|
|
3080
3087
|
value: inputTextValue,
|
|
3081
3088
|
variant: "outlined"
|
|
@@ -3164,13 +3171,30 @@ const StyledCopyButton = styled.span.withConfig({
|
|
|
3164
3171
|
|
|
3165
3172
|
const DotCopyButton = ({
|
|
3166
3173
|
ariaLabel: _ariaLabel = 'Copy to clipboard',
|
|
3174
|
+
ariaRole: _ariaRole = 'button',
|
|
3175
|
+
className,
|
|
3176
|
+
color: _color = 'inherit',
|
|
3167
3177
|
copiedTooltip: _copiedTooltip = 'Copied!',
|
|
3168
3178
|
copyTooltip: _copyTooltip = 'Copy to clipboard',
|
|
3169
3179
|
'data-testid': dataTestId = 'dot-copy-button',
|
|
3180
|
+
disabled: _disabled = false,
|
|
3181
|
+
disableRipple: _disableRipple = false,
|
|
3182
|
+
iconId: _iconId = 'duplicate',
|
|
3183
|
+
iconSize: _iconSize = 'small',
|
|
3184
|
+
onClick: _onClick = null,
|
|
3185
|
+
shape: _shape = 'circle',
|
|
3186
|
+
showCopiedIcon: _showCopiedIcon = true,
|
|
3187
|
+
size: _size = 'small',
|
|
3188
|
+
tooltip,
|
|
3170
3189
|
value
|
|
3171
3190
|
}) => {
|
|
3172
|
-
const [
|
|
3173
|
-
const
|
|
3191
|
+
const [timedShowCopiedIcon, setTimedShowCopiedIcon] = useState(false);
|
|
3192
|
+
const [timedDisabled, setTimedDisabled] = useState(false);
|
|
3193
|
+
// To keep backward compatibility if tooltip is not set, use copyTooltip
|
|
3194
|
+
if (!tooltip) {
|
|
3195
|
+
tooltip = _copyTooltip;
|
|
3196
|
+
}
|
|
3197
|
+
const copyToClipboard = useCallback(() => {
|
|
3174
3198
|
// The check for navigator.clipboard.writeText is because this function is
|
|
3175
3199
|
// only supported in secure contexts (https). This will always be the case in
|
|
3176
3200
|
// production but not when running locally.
|
|
@@ -3179,27 +3203,44 @@ const DotCopyButton = ({
|
|
|
3179
3203
|
} else {
|
|
3180
3204
|
navigator.clipboard.writeText(value);
|
|
3181
3205
|
}
|
|
3182
|
-
};
|
|
3183
|
-
const copy = (
|
|
3206
|
+
}, [value]);
|
|
3207
|
+
const copy = useCallback(event => {
|
|
3184
3208
|
copyToClipboard();
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3209
|
+
if (_showCopiedIcon) {
|
|
3210
|
+
setTimedShowCopiedIcon(true);
|
|
3211
|
+
setTimeout(function () {
|
|
3212
|
+
setTimedShowCopiedIcon(false);
|
|
3213
|
+
}, 3000);
|
|
3214
|
+
} else if (!_disabled) {
|
|
3215
|
+
setTimedDisabled(true);
|
|
3216
|
+
setTimeout(function () {
|
|
3217
|
+
setTimedDisabled(false);
|
|
3218
|
+
}, 3000);
|
|
3219
|
+
}
|
|
3220
|
+
if (_onClick) {
|
|
3221
|
+
return _onClick(event);
|
|
3222
|
+
}
|
|
3189
3223
|
return false;
|
|
3190
|
-
};
|
|
3224
|
+
}, [_showCopiedIcon, _disabled, _onClick]);
|
|
3191
3225
|
return jsxs(StyledCopyButton, Object.assign({
|
|
3192
3226
|
className: rootClassName$O,
|
|
3193
3227
|
"data-testid": dataTestId
|
|
3194
3228
|
}, {
|
|
3195
|
-
children: [!
|
|
3196
|
-
ariaLabel: _ariaLabel
|
|
3229
|
+
children: [!timedShowCopiedIcon && jsx(DotIconButton, {
|
|
3230
|
+
ariaLabel: _ariaLabel,
|
|
3231
|
+
ariaRole: _ariaRole,
|
|
3232
|
+
className: className,
|
|
3233
|
+
color: _color,
|
|
3197
3234
|
"data-testid": `${dataTestId}-button`,
|
|
3198
|
-
|
|
3235
|
+
disabled: _disabled || timedDisabled,
|
|
3236
|
+
disableRipple: _disableRipple,
|
|
3237
|
+
iconId: _iconId,
|
|
3238
|
+
iconSize: _iconSize,
|
|
3199
3239
|
onClick: copy,
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3240
|
+
shape: _shape,
|
|
3241
|
+
size: _size,
|
|
3242
|
+
tooltip: tooltip
|
|
3243
|
+
}, void 0), timedShowCopiedIcon && jsx(DotIcon, {
|
|
3203
3244
|
className: "copied-to-clipboard",
|
|
3204
3245
|
"data-testid": `${dataTestId}-icon`,
|
|
3205
3246
|
fontSize: "small",
|
|
@@ -3875,6 +3916,7 @@ const getTooltipLabel = (label, charactersLimit) => {
|
|
|
3875
3916
|
|
|
3876
3917
|
const DotTruncateWithTooltip = ({
|
|
3877
3918
|
ariaLabel,
|
|
3919
|
+
arrow: _arrow = true,
|
|
3878
3920
|
charactersLimit,
|
|
3879
3921
|
className,
|
|
3880
3922
|
'data-testid': dataTestId,
|
|
@@ -3884,6 +3926,7 @@ const DotTruncateWithTooltip = ({
|
|
|
3884
3926
|
const rootClasses = useStylesWithRootClass(rootClassName$L, className, charactersLimit ? 'dot-characters-limit' : '');
|
|
3885
3927
|
return jsx(StyledTruncateWithTooltip, Object.assign({
|
|
3886
3928
|
"aria-label": ariaLabel,
|
|
3929
|
+
arrow: _arrow,
|
|
3887
3930
|
className: rootClasses,
|
|
3888
3931
|
"data-testid": dataTestId,
|
|
3889
3932
|
title: getTooltipLabel(label, charactersLimit),
|
|
@@ -9330,11 +9373,11 @@ const renderMaxFilesMessage = (maxFiles, maxFilesClasses) => jsx(DotTypography,
|
|
|
9330
9373
|
}, {
|
|
9331
9374
|
children: `${maxFiles} files are the maximum number of files you can upload.`
|
|
9332
9375
|
}), void 0);
|
|
9333
|
-
const renderSelectFilesButton = (isUploadDisabled, onButtonClick) => jsx(DotButton, Object.assign({
|
|
9376
|
+
const renderSelectFilesButton = (buttonProps, isUploadDisabled, onButtonClick) => jsx(DotButton, Object.assign({}, buttonProps, {
|
|
9334
9377
|
disabled: isUploadDisabled,
|
|
9335
9378
|
onClick: onButtonClick
|
|
9336
9379
|
}, {
|
|
9337
|
-
children:
|
|
9380
|
+
children: buttonProps.label
|
|
9338
9381
|
}), void 0);
|
|
9339
9382
|
const renderActiveDragArea = () => jsxs(Fragment, {
|
|
9340
9383
|
children: [jsx(DotIcon, {
|
|
@@ -9345,25 +9388,26 @@ const renderActiveDragArea = () => jsxs(Fragment, {
|
|
|
9345
9388
|
children: "Drop the file(s) here ..."
|
|
9346
9389
|
}), void 0)]
|
|
9347
9390
|
}, void 0);
|
|
9348
|
-
const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => jsxs(Fragment, {
|
|
9391
|
+
const renderDragAndDropArea = (buttonProps, isUploadDisabled, onSelectButtonClick) => jsxs(Fragment, {
|
|
9349
9392
|
children: [jsx(DotIcon, {
|
|
9350
9393
|
iconId: "upload-file"
|
|
9351
9394
|
}, void 0), jsxs(DotTypography, Object.assign({
|
|
9352
9395
|
variant: "h3"
|
|
9353
9396
|
}, {
|
|
9354
9397
|
children: ["Drag and drop your file(s) here ", jsx("br", {}, void 0), " or"]
|
|
9355
|
-
}), void 0), renderSelectFilesButton(isUploadDisabled, onSelectButtonClick)]
|
|
9398
|
+
}), void 0), renderSelectFilesButton(buttonProps, isUploadDisabled, onSelectButtonClick)]
|
|
9356
9399
|
}, void 0);
|
|
9357
9400
|
const renderDropzoneContent = ({
|
|
9358
9401
|
buttonOnly,
|
|
9402
|
+
buttonProps,
|
|
9359
9403
|
isDragActive,
|
|
9360
9404
|
isUploadDisabled,
|
|
9361
9405
|
open
|
|
9362
9406
|
}) => {
|
|
9363
9407
|
if (buttonOnly) {
|
|
9364
|
-
return renderSelectFilesButton(isUploadDisabled, open);
|
|
9408
|
+
return renderSelectFilesButton(buttonProps, isUploadDisabled, open);
|
|
9365
9409
|
} else {
|
|
9366
|
-
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(isUploadDisabled, open);
|
|
9410
|
+
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(buttonProps, isUploadDisabled, open);
|
|
9367
9411
|
}
|
|
9368
9412
|
};
|
|
9369
9413
|
const getUploadedFilesList = ({
|
|
@@ -9426,6 +9470,9 @@ const DotFileUpload = ({
|
|
|
9426
9470
|
accept,
|
|
9427
9471
|
ariaLabel,
|
|
9428
9472
|
ariaRole: _ariaRole = 'region',
|
|
9473
|
+
buttonProps: _buttonProps = {
|
|
9474
|
+
label: 'Select file(s)'
|
|
9475
|
+
},
|
|
9429
9476
|
buttonOnly: _buttonOnly = false,
|
|
9430
9477
|
className,
|
|
9431
9478
|
'data-testid': dataTestId,
|
|
@@ -9498,6 +9545,7 @@ const DotFileUpload = ({
|
|
|
9498
9545
|
"data-testid": dataTestId
|
|
9499
9546
|
}, {
|
|
9500
9547
|
children: [jsx("input", Object.assign({}, getInputProps()), void 0), renderDropzoneContent({
|
|
9548
|
+
buttonProps: _buttonProps,
|
|
9501
9549
|
buttonOnly: _buttonOnly,
|
|
9502
9550
|
isDragActive,
|
|
9503
9551
|
isUploadDisabled,
|
package/index.umd.js
CHANGED
|
@@ -152,19 +152,22 @@
|
|
|
152
152
|
var ariaLabel = _a.ariaLabel,
|
|
153
153
|
_b = _a.ariaRole,
|
|
154
154
|
ariaRole = _b === void 0 ? 'tooltip' : _b,
|
|
155
|
+
_c = _a.arrow,
|
|
156
|
+
arrow = _c === void 0 ? true : _c,
|
|
155
157
|
children = _a.children,
|
|
156
158
|
className = _a.className,
|
|
157
159
|
dataTestId = _a["data-testid"],
|
|
158
160
|
leaveDelay = _a.leaveDelay,
|
|
159
161
|
onClose = _a.onClose,
|
|
160
162
|
open = _a.open,
|
|
161
|
-
|
|
162
|
-
placement =
|
|
163
|
+
_d = _a.placement,
|
|
164
|
+
placement = _d === void 0 ? 'bottom' : _d,
|
|
163
165
|
title = _a.title;
|
|
164
166
|
var rootClasses = useStylesWithRootClass('dot-tooltip', className);
|
|
165
167
|
return title ? jsxRuntime.jsx(material.Tooltip, __assign({
|
|
166
168
|
"aria-hidden": false,
|
|
167
169
|
"aria-label": ariaLabel || title.toString(),
|
|
170
|
+
arrow: arrow,
|
|
168
171
|
className: rootClasses,
|
|
169
172
|
"data-testid": dataTestId,
|
|
170
173
|
leaveDelay: leaveDelay,
|
|
@@ -2164,13 +2167,17 @@
|
|
|
2164
2167
|
var flyoutListItemClassName = 'dot-flyout-list-item';
|
|
2165
2168
|
var flyoutItemLinkClassName = 'dot-flyout-item-link';
|
|
2166
2169
|
var listItemLinkClassName = 'dot-list-item-link';
|
|
2167
|
-
var
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
});
|
|
2170
|
+
var styledListItemElement = function styledListItemElement(elementType) {
|
|
2171
|
+
return styled__default["default"](elementType).withConfig({
|
|
2172
|
+
displayName: "ListItemstyles",
|
|
2173
|
+
componentId: "sc-1fawh8v-0"
|
|
2174
|
+
})(templateObject_2$Z || (templateObject_2$Z = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), function (_a) {
|
|
2175
|
+
var theme = _a.theme;
|
|
2176
|
+
return styled.css(templateObject_1$11 || (templateObject_1$11 = __makeTemplateObject(["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n .dot-tooltip {\n display: flex;\n width: 100%;\n }\n\n p.MuiTypography-root {\n flex-grow: 2;\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "], ["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n .dot-tooltip {\n display: flex;\n width: 100%;\n }\n\n p.MuiTypography-root {\n flex-grow: 2;\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "])), listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary);
|
|
2177
|
+
});
|
|
2178
|
+
};
|
|
2179
|
+
var StyledListItem = styledListItemElement(material.ListItem);
|
|
2180
|
+
var StyledListItemButton = styledListItemElement(material.ListItemButton);
|
|
2174
2181
|
var templateObject_1$11, templateObject_2$Z;
|
|
2175
2182
|
|
|
2176
2183
|
var rootClassName$Y = 'dot-progress';
|
|
@@ -3043,7 +3050,8 @@
|
|
|
3043
3050
|
children: startIcon
|
|
3044
3051
|
}, void 0), renderListItemText(), showEndIcon && renderListItemEndIcon()]
|
|
3045
3052
|
}), void 0);
|
|
3046
|
-
|
|
3053
|
+
var ListItem = onClick || href ? StyledListItemButton : StyledListItem;
|
|
3054
|
+
return jsxRuntime.jsx(ListItem, __assign({
|
|
3047
3055
|
"aria-label": ariaLabel || tooltip,
|
|
3048
3056
|
classes: {
|
|
3049
3057
|
root: rootClasses
|
|
@@ -3395,11 +3403,12 @@
|
|
|
3395
3403
|
shrink: type === 'date' ? true : shrink
|
|
3396
3404
|
},
|
|
3397
3405
|
inputProps: {
|
|
3398
|
-
'data-testid': dataTestId,
|
|
3399
3406
|
className: inputClassName,
|
|
3400
|
-
|
|
3407
|
+
'data-testid': dataTestId,
|
|
3401
3408
|
max: max,
|
|
3402
|
-
min: min
|
|
3409
|
+
min: min,
|
|
3410
|
+
readOnly: readOnly,
|
|
3411
|
+
tabIndex: 0
|
|
3403
3412
|
},
|
|
3404
3413
|
inputRef: inputRef,
|
|
3405
3414
|
label: persistentLabel ? null : label,
|
|
@@ -3416,7 +3425,6 @@
|
|
|
3416
3425
|
required: required,
|
|
3417
3426
|
role: "textbox",
|
|
3418
3427
|
size: size,
|
|
3419
|
-
tabIndex: 0,
|
|
3420
3428
|
type: type,
|
|
3421
3429
|
value: inputTextValue,
|
|
3422
3430
|
variant: "outlined"
|
|
@@ -3517,17 +3525,46 @@
|
|
|
3517
3525
|
var DotCopyButton = function DotCopyButton(_a) {
|
|
3518
3526
|
var _b = _a.ariaLabel,
|
|
3519
3527
|
ariaLabel = _b === void 0 ? 'Copy to clipboard' : _b,
|
|
3520
|
-
_c = _a.
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3528
|
+
_c = _a.ariaRole,
|
|
3529
|
+
ariaRole = _c === void 0 ? 'button' : _c,
|
|
3530
|
+
className = _a.className,
|
|
3531
|
+
_d = _a.color,
|
|
3532
|
+
color = _d === void 0 ? 'inherit' : _d,
|
|
3533
|
+
_e = _a.copiedTooltip,
|
|
3534
|
+
copiedTooltip = _e === void 0 ? 'Copied!' : _e,
|
|
3535
|
+
_f = _a.copyTooltip,
|
|
3536
|
+
copyTooltip = _f === void 0 ? 'Copy to clipboard' : _f,
|
|
3537
|
+
_g = _a["data-testid"],
|
|
3538
|
+
dataTestId = _g === void 0 ? 'dot-copy-button' : _g,
|
|
3539
|
+
_h = _a.disabled,
|
|
3540
|
+
disabled = _h === void 0 ? false : _h,
|
|
3541
|
+
_j = _a.disableRipple,
|
|
3542
|
+
disableRipple = _j === void 0 ? false : _j,
|
|
3543
|
+
_k = _a.iconId,
|
|
3544
|
+
iconId = _k === void 0 ? 'duplicate' : _k,
|
|
3545
|
+
_l = _a.iconSize,
|
|
3546
|
+
iconSize = _l === void 0 ? 'small' : _l,
|
|
3547
|
+
_m = _a.onClick,
|
|
3548
|
+
onClick = _m === void 0 ? null : _m,
|
|
3549
|
+
_o = _a.shape,
|
|
3550
|
+
shape = _o === void 0 ? 'circle' : _o,
|
|
3551
|
+
_p = _a.showCopiedIcon,
|
|
3552
|
+
showCopiedIcon = _p === void 0 ? true : _p,
|
|
3553
|
+
_q = _a.size,
|
|
3554
|
+
size = _q === void 0 ? 'small' : _q,
|
|
3555
|
+
tooltip = _a.tooltip,
|
|
3526
3556
|
value = _a.value;
|
|
3527
|
-
var
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
var
|
|
3557
|
+
var _r = React.useState(false),
|
|
3558
|
+
timedShowCopiedIcon = _r[0],
|
|
3559
|
+
setTimedShowCopiedIcon = _r[1];
|
|
3560
|
+
var _s = React.useState(false),
|
|
3561
|
+
timedDisabled = _s[0],
|
|
3562
|
+
setTimedDisabled = _s[1];
|
|
3563
|
+
// To keep backward compatibility if tooltip is not set, use copyTooltip
|
|
3564
|
+
if (!tooltip) {
|
|
3565
|
+
tooltip = copyTooltip;
|
|
3566
|
+
}
|
|
3567
|
+
var copyToClipboard = React.useCallback(function () {
|
|
3531
3568
|
// The check for navigator.clipboard.writeText is because this function is
|
|
3532
3569
|
// only supported in secure contexts (https). This will always be the case in
|
|
3533
3570
|
// production but not when running locally.
|
|
@@ -3536,27 +3573,44 @@
|
|
|
3536
3573
|
} else {
|
|
3537
3574
|
navigator.clipboard.writeText(value);
|
|
3538
3575
|
}
|
|
3539
|
-
};
|
|
3540
|
-
var copy = function
|
|
3576
|
+
}, [value]);
|
|
3577
|
+
var copy = React.useCallback(function (event) {
|
|
3541
3578
|
copyToClipboard();
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3579
|
+
if (showCopiedIcon) {
|
|
3580
|
+
setTimedShowCopiedIcon(true);
|
|
3581
|
+
setTimeout(function () {
|
|
3582
|
+
setTimedShowCopiedIcon(false);
|
|
3583
|
+
}, 3000);
|
|
3584
|
+
} else if (!disabled) {
|
|
3585
|
+
setTimedDisabled(true);
|
|
3586
|
+
setTimeout(function () {
|
|
3587
|
+
setTimedDisabled(false);
|
|
3588
|
+
}, 3000);
|
|
3589
|
+
}
|
|
3590
|
+
if (onClick) {
|
|
3591
|
+
return onClick(event);
|
|
3592
|
+
}
|
|
3546
3593
|
return false;
|
|
3547
|
-
};
|
|
3594
|
+
}, [showCopiedIcon, disabled, onClick]);
|
|
3548
3595
|
return jsxRuntime.jsxs(StyledCopyButton, __assign({
|
|
3549
3596
|
className: rootClassName$O,
|
|
3550
3597
|
"data-testid": dataTestId
|
|
3551
3598
|
}, {
|
|
3552
|
-
children: [!
|
|
3553
|
-
ariaLabel: ariaLabel
|
|
3599
|
+
children: [!timedShowCopiedIcon && jsxRuntime.jsx(DotIconButton, {
|
|
3600
|
+
ariaLabel: ariaLabel,
|
|
3601
|
+
ariaRole: ariaRole,
|
|
3602
|
+
className: className,
|
|
3603
|
+
color: color,
|
|
3554
3604
|
"data-testid": dataTestId + "-button",
|
|
3555
|
-
|
|
3605
|
+
disabled: disabled || timedDisabled,
|
|
3606
|
+
disableRipple: disableRipple,
|
|
3607
|
+
iconId: iconId,
|
|
3608
|
+
iconSize: iconSize,
|
|
3556
3609
|
onClick: copy,
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3610
|
+
shape: shape,
|
|
3611
|
+
size: size,
|
|
3612
|
+
tooltip: tooltip
|
|
3613
|
+
}, void 0), timedShowCopiedIcon && jsxRuntime.jsx(DotIcon, {
|
|
3560
3614
|
className: "copied-to-clipboard",
|
|
3561
3615
|
"data-testid": dataTestId + "-icon",
|
|
3562
3616
|
fontSize: "small",
|
|
@@ -4274,6 +4328,8 @@
|
|
|
4274
4328
|
|
|
4275
4329
|
var DotTruncateWithTooltip = function DotTruncateWithTooltip(_a) {
|
|
4276
4330
|
var ariaLabel = _a.ariaLabel,
|
|
4331
|
+
_b = _a.arrow,
|
|
4332
|
+
arrow = _b === void 0 ? true : _b,
|
|
4277
4333
|
charactersLimit = _a.charactersLimit,
|
|
4278
4334
|
className = _a.className,
|
|
4279
4335
|
dataTestId = _a["data-testid"],
|
|
@@ -4282,6 +4338,7 @@
|
|
|
4282
4338
|
var rootClasses = useStylesWithRootClass(rootClassName$L, className, charactersLimit ? 'dot-characters-limit' : '');
|
|
4283
4339
|
return jsxRuntime.jsx(StyledTruncateWithTooltip, __assign({
|
|
4284
4340
|
"aria-label": ariaLabel,
|
|
4341
|
+
arrow: arrow,
|
|
4285
4342
|
className: rootClasses,
|
|
4286
4343
|
"data-testid": dataTestId,
|
|
4287
4344
|
title: getTooltipLabel(label, charactersLimit),
|
|
@@ -10153,12 +10210,12 @@
|
|
|
10153
10210
|
children: maxFiles + " files are the maximum number of files you can upload."
|
|
10154
10211
|
}), void 0);
|
|
10155
10212
|
};
|
|
10156
|
-
var renderSelectFilesButton = function renderSelectFilesButton(isUploadDisabled, onButtonClick) {
|
|
10157
|
-
return jsxRuntime.jsx(DotButton, __assign({
|
|
10213
|
+
var renderSelectFilesButton = function renderSelectFilesButton(buttonProps, isUploadDisabled, onButtonClick) {
|
|
10214
|
+
return jsxRuntime.jsx(DotButton, __assign({}, buttonProps, {
|
|
10158
10215
|
disabled: isUploadDisabled,
|
|
10159
10216
|
onClick: onButtonClick
|
|
10160
10217
|
}, {
|
|
10161
|
-
children:
|
|
10218
|
+
children: buttonProps.label
|
|
10162
10219
|
}), void 0);
|
|
10163
10220
|
};
|
|
10164
10221
|
var renderActiveDragArea = function renderActiveDragArea() {
|
|
@@ -10172,7 +10229,7 @@
|
|
|
10172
10229
|
}), void 0)]
|
|
10173
10230
|
}, void 0);
|
|
10174
10231
|
};
|
|
10175
|
-
var renderDragAndDropArea = function renderDragAndDropArea(isUploadDisabled, onSelectButtonClick) {
|
|
10232
|
+
var renderDragAndDropArea = function renderDragAndDropArea(buttonProps, isUploadDisabled, onSelectButtonClick) {
|
|
10176
10233
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10177
10234
|
children: [jsxRuntime.jsx(DotIcon, {
|
|
10178
10235
|
iconId: "upload-file"
|
|
@@ -10180,18 +10237,19 @@
|
|
|
10180
10237
|
variant: "h3"
|
|
10181
10238
|
}, {
|
|
10182
10239
|
children: ["Drag and drop your file(s) here ", jsxRuntime.jsx("br", {}, void 0), " or"]
|
|
10183
|
-
}), void 0), renderSelectFilesButton(isUploadDisabled, onSelectButtonClick)]
|
|
10240
|
+
}), void 0), renderSelectFilesButton(buttonProps, isUploadDisabled, onSelectButtonClick)]
|
|
10184
10241
|
}, void 0);
|
|
10185
10242
|
};
|
|
10186
10243
|
var renderDropzoneContent = function renderDropzoneContent(_a) {
|
|
10187
10244
|
var buttonOnly = _a.buttonOnly,
|
|
10245
|
+
buttonProps = _a.buttonProps,
|
|
10188
10246
|
isDragActive = _a.isDragActive,
|
|
10189
10247
|
isUploadDisabled = _a.isUploadDisabled,
|
|
10190
10248
|
open = _a.open;
|
|
10191
10249
|
if (buttonOnly) {
|
|
10192
|
-
return renderSelectFilesButton(isUploadDisabled, open);
|
|
10250
|
+
return renderSelectFilesButton(buttonProps, isUploadDisabled, open);
|
|
10193
10251
|
} else {
|
|
10194
|
-
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(isUploadDisabled, open);
|
|
10252
|
+
return isDragActive ? renderActiveDragArea() : renderDragAndDropArea(buttonProps, isUploadDisabled, open);
|
|
10195
10253
|
}
|
|
10196
10254
|
};
|
|
10197
10255
|
var getUploadedFilesList = function getUploadedFilesList(_a) {
|
|
@@ -10263,8 +10321,12 @@
|
|
|
10263
10321
|
ariaLabel = _a.ariaLabel,
|
|
10264
10322
|
_b = _a.ariaRole,
|
|
10265
10323
|
ariaRole = _b === void 0 ? 'region' : _b,
|
|
10266
|
-
_c = _a.
|
|
10267
|
-
|
|
10324
|
+
_c = _a.buttonProps,
|
|
10325
|
+
buttonProps = _c === void 0 ? {
|
|
10326
|
+
label: 'Select file(s)'
|
|
10327
|
+
} : _c,
|
|
10328
|
+
_d = _a.buttonOnly,
|
|
10329
|
+
buttonOnly = _d === void 0 ? false : _d,
|
|
10268
10330
|
className = _a.className,
|
|
10269
10331
|
dataTestId = _a["data-testid"],
|
|
10270
10332
|
disabled = _a.disabled,
|
|
@@ -10274,12 +10336,12 @@
|
|
|
10274
10336
|
onChange = _a.onChange,
|
|
10275
10337
|
onDragEnter = _a.onDragEnter,
|
|
10276
10338
|
onFileClick = _a.onFileClick;
|
|
10277
|
-
var
|
|
10278
|
-
uploadedFiles =
|
|
10279
|
-
setUploadedFiles =
|
|
10280
|
-
var
|
|
10281
|
-
hasMaxFilesError =
|
|
10282
|
-
setHasMaxFilesError =
|
|
10339
|
+
var _e = React.useState([]),
|
|
10340
|
+
uploadedFiles = _e[0],
|
|
10341
|
+
setUploadedFiles = _e[1];
|
|
10342
|
+
var _f = React.useState(false),
|
|
10343
|
+
hasMaxFilesError = _f[0],
|
|
10344
|
+
setHasMaxFilesError = _f[1];
|
|
10283
10345
|
var isUploadDisabled = disabled || maxFiles && uploadedFiles.length >= maxFiles;
|
|
10284
10346
|
var rootClasses = useStylesWithRootClass(rootClassName$6, className, !buttonOnly ? dropZoneClassName : '', isUploadDisabled ? 'disabled' : '');
|
|
10285
10347
|
var maxFilesClasses = useStylesWithRootClass('dot-max-files-message', hasMaxFilesError ? 'dot-max-files-reached' : '');
|
|
@@ -10304,7 +10366,7 @@
|
|
|
10304
10366
|
var onDrop = React.useCallback(function (acceptedFiles, fileRejections) {
|
|
10305
10367
|
hideFilesList ? setNewlyUploadedFiles(acceptedFiles, fileRejections) : parseFiles(acceptedFiles, fileRejections);
|
|
10306
10368
|
}, [hideFilesList, setNewlyUploadedFiles, parseFiles]);
|
|
10307
|
-
var
|
|
10369
|
+
var _g = reactDropzone.useDropzone({
|
|
10308
10370
|
accept: accept,
|
|
10309
10371
|
disabled: isUploadDisabled,
|
|
10310
10372
|
maxSize: maxSize * 1024 * 1024,
|
|
@@ -10313,10 +10375,10 @@
|
|
|
10313
10375
|
onDragEnter: onDragEnter,
|
|
10314
10376
|
onDrop: onDrop
|
|
10315
10377
|
}),
|
|
10316
|
-
getRootProps =
|
|
10317
|
-
getInputProps =
|
|
10318
|
-
isDragActive =
|
|
10319
|
-
open =
|
|
10378
|
+
getRootProps = _g.getRootProps,
|
|
10379
|
+
getInputProps = _g.getInputProps,
|
|
10380
|
+
isDragActive = _g.isDragActive,
|
|
10381
|
+
open = _g.open;
|
|
10320
10382
|
var deleteFile = function deleteFile(fileIndexToBeRemoved) {
|
|
10321
10383
|
uploadedFiles.splice(fileIndexToBeRemoved, 1);
|
|
10322
10384
|
setUploadedFiles(__spreadArray([], uploadedFiles));
|
|
@@ -10338,6 +10400,7 @@
|
|
|
10338
10400
|
"data-testid": dataTestId
|
|
10339
10401
|
}, {
|
|
10340
10402
|
children: [jsxRuntime.jsx("input", __assign({}, getInputProps()), void 0), renderDropzoneContent({
|
|
10403
|
+
buttonProps: buttonProps,
|
|
10341
10404
|
buttonOnly: buttonOnly,
|
|
10342
10405
|
isDragActive: isDragActive,
|
|
10343
10406
|
isUploadDisabled: isUploadDisabled,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface CopyButtonProps extends
|
|
1
|
+
import { CommonIconButtonProps } from '../button/IconButton';
|
|
2
|
+
export interface CopyButtonProps extends CommonIconButtonProps {
|
|
3
|
+
/** Tooltip shown briefly after the value has been copied. */
|
|
3
4
|
copiedTooltip?: string;
|
|
5
|
+
/** DEPRECATED Use tooltip instead */
|
|
4
6
|
copyTooltip?: string;
|
|
7
|
+
/** The icon to display on the button, defaults to 'duplicate' */
|
|
8
|
+
iconId?: string;
|
|
9
|
+
/** By default a check icon will briefly display after the content is copied */
|
|
10
|
+
showCopiedIcon?: boolean;
|
|
11
|
+
/** The content which will be copied to the clipboard */
|
|
5
12
|
value: string;
|
|
6
13
|
}
|
|
7
|
-
export declare const DotCopyButton: ({ ariaLabel, copiedTooltip, copyTooltip, "data-testid": dataTestId, value, }: CopyButtonProps) => JSX.Element;
|
|
14
|
+
export declare const DotCopyButton: ({ ariaLabel, ariaRole, className, color, copiedTooltip, copyTooltip, "data-testid": dataTestId, disabled, disableRipple, iconId, iconSize, onClick, shape, showCopiedIcon, size, tooltip, value, }: CopyButtonProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { CopyButtonProps } from './CopyButton';
|
|
3
|
-
declare const _default: ComponentMeta<({ ariaLabel, copiedTooltip, copyTooltip, "data-testid": dataTestId, value, }: CopyButtonProps) => JSX.Element>;
|
|
3
|
+
declare const _default: ComponentMeta<({ ariaLabel, ariaRole, className, color, copiedTooltip, copyTooltip, "data-testid": dataTestId, disabled, disableRipple, iconId, iconSize, onClick, shape, showCopiedIcon, size, tooltip, value, }: CopyButtonProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: any;
|
|
@@ -4,15 +4,13 @@ import { IconFontSize } from '../icon/Icon';
|
|
|
4
4
|
export declare type IconButtonColor = 'default' | 'inherit' | 'primary' | 'secondary';
|
|
5
5
|
export declare type IconButtonSize = 'small' | 'medium';
|
|
6
6
|
export declare type IconButtonShape = 'circle' | 'square';
|
|
7
|
-
export interface
|
|
7
|
+
export interface CommonIconButtonProps extends CommonProps {
|
|
8
8
|
/** 'default', 'inherit', 'primary', 'secondary' */
|
|
9
9
|
color?: IconButtonColor;
|
|
10
10
|
/** If true, the ripple effect is disabled. */
|
|
11
11
|
disableRipple?: boolean;
|
|
12
12
|
/** If true, the button will be disabled. */
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
/** The icon to display on the button */
|
|
15
|
-
iconId: string;
|
|
16
14
|
/** Determines the size of the icon itself and spacing around it */
|
|
17
15
|
iconSize?: IconFontSize;
|
|
18
16
|
/** Event callback */
|
|
@@ -24,4 +22,8 @@ export interface IconButtonProps extends CommonProps {
|
|
|
24
22
|
/** Help text to be displayed on icon hover */
|
|
25
23
|
tooltip?: string;
|
|
26
24
|
}
|
|
25
|
+
export interface IconButtonProps extends CommonIconButtonProps {
|
|
26
|
+
/** The icon to display on the button */
|
|
27
|
+
iconId: string;
|
|
28
|
+
}
|
|
27
29
|
export declare const DotIconButton: ({ ariaLabel, ariaRole, className, color, "data-testid": dataTestId, disabled, disableRipple, iconId, iconSize, onClick, tooltip, shape, size, }: IconButtonProps) => JSX.Element;
|
|
@@ -35,7 +35,7 @@ export declare const StyledFileListItem: ((props: {
|
|
|
35
35
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions>;
|
|
36
36
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
37
37
|
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
38
|
-
}, "button" | "style" | "className" | "
|
|
38
|
+
}, "button" | "style" | "className" | "tabIndex" | "children" | "autoFocus" | "disabled" | "action" | "selected" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "ContainerComponent" | "ContainerProps" | "dense" | "disableGutters" | "disablePadding" | "divider" | "secondaryAction" | "components" | "componentsProps" | "slotProps" | "slots">) => JSX.Element) & import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").ExtendButtonBaseTypeMap<import("@mui/material").ListItemTypeMap<{
|
|
39
39
|
button: true;
|
|
40
40
|
}, "div">>> & import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").ListItemTypeMap<{
|
|
41
41
|
button?: false;
|
|
@@ -2,11 +2,22 @@
|
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
import { MappedFile } from './utils/models';
|
|
4
4
|
import { ListItemFile } from './FileListItem';
|
|
5
|
+
import { BaseButtonProps } from '../BaseButtonProps';
|
|
6
|
+
interface OmittedButtonProps {
|
|
7
|
+
disabled: unknown;
|
|
8
|
+
isSubmit: unknown;
|
|
9
|
+
onClick: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare type FileUploadButtonProps = Omit<BaseButtonProps, keyof OmittedButtonProps> & {
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
5
14
|
export interface FileUploadProps extends CommonProps {
|
|
6
15
|
/** Unique file type specifiers <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers" target="_blank">More Info</a> */
|
|
7
16
|
accept?: Array<string>;
|
|
8
17
|
/** If true, will only display the button */
|
|
9
18
|
buttonOnly?: boolean;
|
|
19
|
+
/** the file upload button props, not all button props are available */
|
|
20
|
+
buttonProps?: FileUploadButtonProps;
|
|
10
21
|
/** If true, the upload zone will be disabled */
|
|
11
22
|
disabled?: boolean;
|
|
12
23
|
/** If true, upload file list won't be displayed. Used when consumer wants to render his own list. */
|
|
@@ -22,4 +33,5 @@ export interface FileUploadProps extends CommonProps {
|
|
|
22
33
|
/** Optional callback which gets triggered when the file (from the list) is clicked. */
|
|
23
34
|
onFileClick?: (file: ListItemFile) => void;
|
|
24
35
|
}
|
|
25
|
-
export declare const DotFileUpload: ({ accept, ariaLabel, ariaRole, buttonOnly, className, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => JSX.Element;
|
|
36
|
+
export declare const DotFileUpload: ({ accept, ariaLabel, ariaRole, buttonProps, buttonOnly, className, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { FileUploadProps } from './';
|
|
3
|
-
declare const _default: ComponentMeta<({ accept, ariaLabel, ariaRole, buttonOnly, className, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => JSX.Element>;
|
|
3
|
+
declare const _default: ComponentMeta<({ accept, ariaLabel, ariaRole, buttonProps, buttonOnly, className, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: any;
|
|
6
6
|
export declare const WithSingleFileLimit: any;
|
|
7
7
|
export declare const WithCustomFileUploadList: (args: FileUploadProps) => JSX.Element;
|
|
8
8
|
export declare const WithUploadErrors: (args: FileUploadProps) => JSX.Element;
|
|
9
|
+
export declare const WithCustomButtonProps: (args: FileUploadProps) => JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { FileRejection } from 'react-dropzone';
|
|
3
3
|
import { DropzoneContentArgs, FileUploadError, ParseListItemArgs, UploadedFilesListArgs } from './models';
|
|
4
|
+
import { FileUploadButtonProps } from '../FileUpload';
|
|
4
5
|
export declare const renderMaxSizeMessage: (maxSizeMB: number) => ReactNode;
|
|
5
6
|
export declare const renderMaxFilesMessage: (maxFiles: number, maxFilesClasses: string) => ReactNode;
|
|
6
|
-
export declare const renderSelectFilesButton: (isUploadDisabled: boolean, onButtonClick: () => void) => ReactNode;
|
|
7
|
+
export declare const renderSelectFilesButton: (buttonProps: FileUploadButtonProps, isUploadDisabled: boolean, onButtonClick: () => void) => ReactNode;
|
|
7
8
|
export declare const renderActiveDragArea: () => ReactNode;
|
|
8
|
-
export declare const renderDragAndDropArea: (isUploadDisabled: boolean, onSelectButtonClick: () => void) => ReactNode;
|
|
9
|
-
export declare const renderDropzoneContent: ({ buttonOnly, isDragActive, isUploadDisabled, open, }: DropzoneContentArgs) => React.ReactNode;
|
|
9
|
+
export declare const renderDragAndDropArea: (buttonProps: FileUploadButtonProps, isUploadDisabled: boolean, onSelectButtonClick: () => void) => ReactNode;
|
|
10
|
+
export declare const renderDropzoneContent: ({ buttonOnly, buttonProps, isDragActive, isUploadDisabled, open, }: DropzoneContentArgs) => React.ReactNode;
|
|
10
11
|
export declare const getUploadedFilesList: ({ maxSize, onFileClick, onFileDelete, uploadedFiles, }: UploadedFilesListArgs) => {
|
|
11
12
|
child: JSX.Element;
|
|
12
13
|
}[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileWithPath } from 'react-dropzone';
|
|
2
2
|
import { ListItemFile } from '../FileListItem';
|
|
3
|
+
import { FileUploadButtonProps } from '../FileUpload';
|
|
3
4
|
export interface FileUploadError {
|
|
4
5
|
code: string;
|
|
5
6
|
message: string;
|
|
@@ -14,6 +15,7 @@ export interface MappedFile {
|
|
|
14
15
|
}
|
|
15
16
|
export interface DropzoneContentArgs {
|
|
16
17
|
buttonOnly: boolean;
|
|
18
|
+
buttonProps: FileUploadButtonProps;
|
|
17
19
|
isDragActive: boolean;
|
|
18
20
|
isUploadDisabled: boolean;
|
|
19
21
|
open: () => void;
|
|
@@ -2,43 +2,5 @@
|
|
|
2
2
|
export declare const flyoutListItemClassName = "dot-flyout-list-item";
|
|
3
3
|
export declare const flyoutItemLinkClassName = "dot-flyout-item-link";
|
|
4
4
|
export declare const listItemLinkClassName = "dot-list-item-link";
|
|
5
|
-
export declare const StyledListItem: (
|
|
6
|
-
|
|
7
|
-
} & {
|
|
8
|
-
button: true;
|
|
9
|
-
} & import("@mui/material").ListItemBaseProps & {
|
|
10
|
-
components?: {
|
|
11
|
-
Root?: import("react").ElementType<any>;
|
|
12
|
-
};
|
|
13
|
-
componentsProps?: {
|
|
14
|
-
root?: import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides;
|
|
15
|
-
};
|
|
16
|
-
slotProps?: {
|
|
17
|
-
root?: import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides;
|
|
18
|
-
};
|
|
19
|
-
slots?: {
|
|
20
|
-
root?: import("react").ElementType<any>;
|
|
21
|
-
};
|
|
22
|
-
} & Omit<{
|
|
23
|
-
action?: import("react").Ref<import("@mui/material").ButtonBaseActions>;
|
|
24
|
-
centerRipple?: boolean;
|
|
25
|
-
children?: import("react").ReactNode;
|
|
26
|
-
classes?: Partial<import("@mui/material").ButtonBaseClasses>;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
disableRipple?: boolean;
|
|
29
|
-
disableTouchRipple?: boolean;
|
|
30
|
-
focusRipple?: boolean;
|
|
31
|
-
focusVisibleClassName?: string;
|
|
32
|
-
LinkComponent?: import("react").ElementType<any>;
|
|
33
|
-
onFocusVisible?: import("react").FocusEventHandler<any>;
|
|
34
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme>;
|
|
35
|
-
tabIndex?: number;
|
|
36
|
-
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps>;
|
|
37
|
-
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions>;
|
|
38
|
-
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
39
|
-
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
40
|
-
}, "button" | "style" | "className" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "ContainerComponent" | "ContainerProps" | "dense" | "disableGutters" | "disablePadding" | "divider" | "secondaryAction" | "selected" | "components" | "componentsProps" | "slotProps" | "slots">) => JSX.Element) & import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").ExtendButtonBaseTypeMap<import("@mui/material").ListItemTypeMap<{
|
|
41
|
-
button: true;
|
|
42
|
-
}, "div">>> & import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").ListItemTypeMap<{
|
|
43
|
-
button?: false;
|
|
44
|
-
}, "li">>;
|
|
5
|
+
export declare const StyledListItem: import("react").ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
6
|
+
export declare const StyledListItemButton: import("react").ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
@@ -2,6 +2,8 @@ import { ReactNode, ReactElement, ChangeEvent } from 'react';
|
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export declare type tooltipPlacement = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
4
4
|
export interface TooltipProps extends CommonProps {
|
|
5
|
+
/** If true, adds an arrow to the tooltip indicating which element it refers to. */
|
|
6
|
+
arrow?: boolean;
|
|
5
7
|
children: ReactElement;
|
|
6
8
|
leaveDelay?: number;
|
|
7
9
|
onClose?: (event: ChangeEvent) => void;
|
|
@@ -9,4 +11,4 @@ export interface TooltipProps extends CommonProps {
|
|
|
9
11
|
placement?: tooltipPlacement;
|
|
10
12
|
title?: ReactNode | string | number;
|
|
11
13
|
}
|
|
12
|
-
export declare const DotTooltip: ({ ariaLabel, ariaRole, children, className, "data-testid": dataTestId, leaveDelay, onClose, open, placement, title, }: TooltipProps) => JSX.Element;
|
|
14
|
+
export declare const DotTooltip: ({ ariaLabel, ariaRole, arrow, children, className, "data-testid": dataTestId, leaveDelay, onClose, open, placement, title, }: TooltipProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Story, ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { TooltipProps } from './Tooltip';
|
|
3
|
-
declare const _default: ComponentMeta<({ ariaLabel, ariaRole, children, className, "data-testid": dataTestId, leaveDelay, onClose, open, placement, title, }: TooltipProps) => JSX.Element>;
|
|
3
|
+
declare const _default: ComponentMeta<({ ariaLabel, ariaRole, arrow, children, className, "data-testid": dataTestId, leaveDelay, onClose, open, placement, title, }: TooltipProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: Story<TooltipProps>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CommonProps } from '../CommonProps';
|
|
2
2
|
export interface TruncateWithTooltipProps extends CommonProps {
|
|
3
|
+
/** If true, adds an arrow to the tooltip indicating which element it refers to. */
|
|
4
|
+
arrow?: boolean;
|
|
3
5
|
charactersLimit?: number;
|
|
4
6
|
label: string;
|
|
5
7
|
width?: number | string;
|
|
6
8
|
}
|
|
7
|
-
export declare const DotTruncateWithTooltip: ({ ariaLabel, charactersLimit, className, "data-testid": dataTestId, label, width, }: TruncateWithTooltipProps) => JSX.Element;
|
|
9
|
+
export declare const DotTruncateWithTooltip: ({ ariaLabel, arrow, charactersLimit, className, "data-testid": dataTestId, label, width, }: TruncateWithTooltipProps) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { TruncateWithTooltipProps } from './';
|
|
3
|
-
declare const _default: ComponentMeta<({ ariaLabel, charactersLimit, className, "data-testid": dataTestId, label, width, }: TruncateWithTooltipProps) => JSX.Element>;
|
|
3
|
+
declare const _default: ComponentMeta<({ ariaLabel, arrow, charactersLimit, className, "data-testid": dataTestId, label, width, }: TruncateWithTooltipProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: any;
|
|
6
6
|
export declare const WithAutoTruncate: any;
|