@superdispatch/ui-lab 0.46.0 → 0.47.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { SvgIcon } from '@material-ui/core';
3
+ import { Color } from '@superdispatch/ui';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export function CloseIcon(props) {
6
+ return /*#__PURE__*/_jsx(SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
7
+ viewBox: "0 0 6 6",
8
+ style: {
9
+ width: '6px',
10
+ height: '6px'
11
+ },
12
+ children: /*#__PURE__*/_jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M3.72278 2.99999L5.91671 0.806074L5.19396 0.0833282L3.00004 2.27725L0.80612 0.0833282L0.083374 0.806076L2.27729 2.99999L0.083374 5.19391L0.80612 5.91666L3.00004 3.72274L5.19396 5.91666L5.91671 5.19392L3.72278 2.99999Z",
16
+ fill: Color.Dark100
17
+ })
18
+ }));
19
+ }
@@ -0,0 +1,86 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["value", "onChange", "TextFieldProps"];
4
+ import { IconButton, TextField } from '@material-ui/core';
5
+ import { Autocomplete } from '@material-ui/lab';
6
+ import { Inline, Tag } from '@superdispatch/ui';
7
+ import { TextBox } from '@superdispatch/ui-lab';
8
+ import { forwardRef } from 'react';
9
+ import styled from 'styled-components';
10
+ import { CloseIcon } from "./CloseIcon.js";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ var MultipleFieldText = /*#__PURE__*/styled(TextField).withConfig({
13
+ displayName: "EmailAutocomplete__MultipleFieldText",
14
+ componentId: "SD__sc-126rmmq-0"
15
+ })(["&{width:100%;margin-top:8px;overflow:hidden;}&& .MuiAutocomplete-inputRoot{flex-direction:column;align-items:flex-start;width:100%;gap:8px;& .MuiAutocomplete-input{width:100%;}}"]);
16
+ export var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
17
+ var {
18
+ value,
19
+ onChange: _onChange,
20
+ TextFieldProps
21
+ } = _ref,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ function handleDelete(index) {
24
+ var filteredOrders = value === null || value === void 0 ? void 0 : value.filter((_item, fieldIndex) => fieldIndex !== index);
25
+ void (_onChange === null || _onChange === void 0 ? void 0 : _onChange(filteredOrders, 'remove-option'));
26
+ }
27
+ return /*#__PURE__*/_jsx(Autocomplete, _objectSpread(_objectSpread({}, props), {}, {
28
+ ref: ref,
29
+ multiple: true,
30
+ freeSolo: true,
31
+ value: value,
32
+ disableClearable: true,
33
+ filterSelectedOptions: true,
34
+ filterOptions: _filterOptions => {
35
+ return _filterOptions.filter(option => option !== '');
36
+ },
37
+ onChange: (_event, selectedValue, reason) => {
38
+ var emails = selectedValue.flatMap(item => item.split(',')).map(item => item.trim());
39
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, reason);
40
+ },
41
+ renderTags: items => {
42
+ return /*#__PURE__*/_jsx(Inline, {
43
+ space: "xxsmall",
44
+ children: items.map((option, index) => {
45
+ return /*#__PURE__*/_jsx(Tag, {
46
+ color: "grey",
47
+ variant: "subtle",
48
+ children: /*#__PURE__*/_jsxs(Inline, {
49
+ space: "xxsmall",
50
+ children: [/*#__PURE__*/_jsx(TextBox, {
51
+ wrapOverflow: true,
52
+ color: "primary",
53
+ children: option
54
+ }), /*#__PURE__*/_jsx(IconButton, {
55
+ size: "small",
56
+ onClick: () => {
57
+ handleDelete(index);
58
+ },
59
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
60
+ })]
61
+ })
62
+ }, index);
63
+ })
64
+ });
65
+ },
66
+ renderInput: params => /*#__PURE__*/_jsx(MultipleFieldText, _objectSpread(_objectSpread(_objectSpread({}, params), TextFieldProps), {}, {
67
+ multiline: true,
68
+ minRows: 2,
69
+ variant: "outlined",
70
+ fullWidth: true,
71
+ InputProps: _objectSpread(_objectSpread(_objectSpread({}, TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.InputProps), params.InputProps), {}, {
72
+ startAdornment: params.InputProps.startAdornment
73
+ }),
74
+ placeholder: "Enter individual emails on each line or separate them with comma (,)",
75
+ onChange: event => {
76
+ var text = event.target.value.replace(/,/g, '');
77
+ var hasCommaOrSpace = /,|\s/.test(event.target.value);
78
+ if (hasCommaOrSpace && text.trim() !== '') {
79
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), text.trim()], 'select-option');
80
+ }
81
+ }
82
+ }))
83
+ }));
84
+ });
85
+ if (process.env.NODE_ENV !== "production") EmailAutocomplete.displayName = "EmailAutocomplete";
86
+ EmailAutocomplete.displayName = 'EmailAutocomplete';
package/dist-src/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./chat/ChatMessage.js";
8
8
  export * from "./container/Container.js";
9
9
  export * from "./description-item/DescriptionItem.js";
10
10
  export * from "./description-line-item/DescriptionLineItem.js";
11
+ export * from "./email-autocomplate/EmailAutocomplete.js";
11
12
  export * from "./file-drop-zone/FileDropZone.js";
12
13
  export * from "./file-list-item/FileListItem.js";
13
14
  export * from "./flag-list/FlagList.js";
@@ -4,10 +4,11 @@ import { CSSTransition } from 'react-transition-group';
4
4
  import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
5
5
  import { SpaceProp, NegativeSpaceProp, ResponsiveProp, ColorProp } from '@superdispatch/ui';
6
6
  import { Property } from 'csstype';
7
- import { ButtonBaseProps, AvatarProps, IconButtonProps, TooltipProps } from '@material-ui/core';
7
+ import { ButtonBaseProps, StandardTextFieldProps, AvatarProps, IconButtonProps, TooltipProps } from '@material-ui/core';
8
8
  import { PrimitiveDateInput } from '@superdispatch/dates';
9
9
  import { DateTime } from 'luxon';
10
10
  import { StyledComponent, DefaultTheme } from 'styled-components';
11
+ import { AutocompleteProps, AutocompleteChangeReason } from '@material-ui/lab';
11
12
  import { FileRejection } from 'react-dropzone';
12
13
 
13
14
  declare type AlertSeverityProp = 'positive' | 'info' | 'caution' | 'critical';
@@ -167,6 +168,15 @@ interface DescriptionLineItemProps {
167
168
  }
168
169
  declare const DescriptionLineItem: ForwardRefExoticComponent<DescriptionLineItemProps & RefAttributes<HTMLDivElement>>;
169
170
 
171
+ interface EmailAutocompleteProps extends Omit<AutocompleteProps<string, true, true, true>, 'onChange' | 'renderInput' | 'renderTags'> {
172
+ options: string[];
173
+ TextFieldProps?: StandardTextFieldProps;
174
+ onAdd?: (value: string) => void;
175
+ onRemove?: (value: string) => void;
176
+ onChange?: (value: string[] | undefined, reason: AutocompleteChangeReason) => void;
177
+ }
178
+ declare const EmailAutocomplete: ForwardRefExoticComponent<Pick<EmailAutocompleteProps, "className" | "style" | "classes" | "innerRef" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "value" | "fullWidth" | "size" | "open" | "onClose" | "autoComplete" | "loading" | "multiple" | "disabledItemsFocusable" | "disableListWrap" | "disablePortal" | "options" | "onOpen" | "PopperComponent" | "closeText" | "disableCloseOnSelect" | "inputValue" | "filterOptions" | "freeSolo" | "includeInputInList" | "getOptionLabel" | "onInputChange" | "ChipProps" | "closeIcon" | "clearText" | "forcePopupIcon" | "getLimitTagsText" | "ListboxComponent" | "ListboxProps" | "loadingText" | "limitTags" | "noOptionsText" | "openText" | "PaperComponent" | "popupIcon" | "renderGroup" | "renderOption" | "autoHighlight" | "autoSelect" | "blurOnSelect" | "clearOnBlur" | "clearOnEscape" | "componentName" | "debug" | "disableClearable" | "filterSelectedOptions" | "getOptionDisabled" | "getOptionSelected" | "groupBy" | "handleHomeEndKeys" | "onHighlightChange" | "openOnFocus" | "selectOnFocus" | "TextFieldProps" | "onAdd" | "onRemove"> & RefAttributes<unknown>>;
179
+
170
180
  declare function toBytes(input: number, unit: 'kb' | 'mb' | 'gb'): number;
171
181
  declare function formatBytes(bytes: number): string;
172
182
  interface FileDropZoneProps {
@@ -419,4 +429,4 @@ interface TextBoxProps {
419
429
  }
420
430
  declare const TextBox: ForwardRefExoticComponent<TextBoxProps & RefAttributes<HTMLElement>>;
421
431
 
422
- export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Chat, ChatMessage, Container, ContainerProps, DescriptionItem, DescriptionItemProps, DescriptionLineItem, DottedLine, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, FlagList, FlagListItem, LinkComponentProps, LinkedText, LinkedTextProps, MarginProp, MultilineText, MultilineTextProps, Navbar, NavbarAccordionOptions, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarBackButton, SidebarContainer, SidebarContainerProps, SidebarContent, SidebarContentProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext, useSidebarContext };
432
+ export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Chat, ChatMessage, Container, ContainerProps, DescriptionItem, DescriptionItemProps, DescriptionLineItem, DottedLine, EmailAutocomplete, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, FlagList, FlagListItem, LinkComponentProps, LinkedText, LinkedTextProps, MarginProp, MultilineText, MultilineTextProps, Navbar, NavbarAccordionOptions, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarBackButton, SidebarContainer, SidebarContainerProps, SidebarContent, SidebarContentProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext, useSidebarContext };
package/dist-web/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { CheckCircle, Info, Error as Error$1, WarningRounded, Image, Refresh, Delete, Warning, Flag, Help, Menu, ExpandMore, MenuOpen, ArrowBack, OpenInNew } from '@material-ui/icons';
2
- import { Alert as Alert$1 } from '@material-ui/lab';
3
- import { ColorDynamic, parseResponsiveProp, isColorDynamicProp, parseSpaceProp, Stack, Color, Inline, mergeRefs, useUID, isEmptyReactNode, Columns, Column, CardButton, useResponsiveValue, ColorDark, useCollapseBreakpoint } from '@superdispatch/ui';
2
+ import { Alert as Alert$1, Autocomplete } from '@material-ui/lab';
3
+ import { ColorDynamic, parseResponsiveProp, isColorDynamicProp, parseSpaceProp, Stack, Color, Inline, mergeRefs, useUID, isEmptyReactNode, Columns, Column, Tag, CardButton, useResponsiveValue, ColorDark, useCollapseBreakpoint } from '@superdispatch/ui';
4
4
  import { forwardRef, useState, useEffect, Children, useRef, useLayoutEffect, Suspense, memo, useContext, createContext, useMemo, createElement } from 'react';
5
5
  import styled, { css, keyframes } from 'styled-components';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
8
8
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
9
9
  import { CSSTransition } from 'react-transition-group';
10
- import { ButtonBase, Typography, CircularProgress, SvgIcon, Link, Tooltip, IconButton, BottomNavigation, BottomNavigationAction, alpha, Accordion, AccordionSummary, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Toolbar, AppBar, Divider as Divider$1, Checkbox } from '@material-ui/core';
10
+ import { ButtonBase, Typography, CircularProgress, SvgIcon, IconButton, TextField, Link, Tooltip, BottomNavigation, BottomNavigationAction, alpha, Accordion, AccordionSummary, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Toolbar, AppBar, Divider as Divider$1, Checkbox } from '@material-ui/core';
11
11
  import { formatDate } from '@superdispatch/dates';
12
- import { Box as Box$1 } from '@superdispatch/ui-lab';
12
+ import { Box as Box$1, TextBox as TextBox$1 } from '@superdispatch/ui-lab';
13
13
  import { mdiUpload, mdiFilePdfBox, mdiTextBox } from '@mdi/js';
14
14
  import Dropzone from 'react-dropzone';
15
15
  import { Anchorme } from 'react-anchorme';
@@ -860,7 +860,100 @@ var DescriptionLineItem = /*#__PURE__*/forwardRef((_ref, ref) => {
860
860
  if (process.env.NODE_ENV !== "production") DescriptionLineItem.displayName = "DescriptionLineItem";
861
861
  DescriptionLineItem.displayName = 'DescriptionLineItem';
862
862
 
863
- var _excluded$5 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
863
+ function CloseIcon(props) {
864
+ return /*#__PURE__*/jsx(SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
865
+ viewBox: "0 0 6 6",
866
+ style: {
867
+ width: '6px',
868
+ height: '6px'
869
+ },
870
+ children: /*#__PURE__*/jsx("path", {
871
+ fillRule: "evenodd",
872
+ clipRule: "evenodd",
873
+ d: "M3.72278 2.99999L5.91671 0.806074L5.19396 0.0833282L3.00004 2.27725L0.80612 0.0833282L0.083374 0.806076L2.27729 2.99999L0.083374 5.19391L0.80612 5.91666L3.00004 3.72274L5.19396 5.91666L5.91671 5.19392L3.72278 2.99999Z",
874
+ fill: Color.Dark100
875
+ })
876
+ }));
877
+ }
878
+
879
+ var _excluded$5 = ["value", "onChange", "TextFieldProps"];
880
+ var MultipleFieldText = /*#__PURE__*/styled(TextField).withConfig({
881
+ displayName: "EmailAutocomplete__MultipleFieldText",
882
+ componentId: "SD__sc-126rmmq-0"
883
+ })(["&{width:100%;margin-top:8px;overflow:hidden;}&& .MuiAutocomplete-inputRoot{flex-direction:column;align-items:flex-start;width:100%;gap:8px;& .MuiAutocomplete-input{width:100%;}}"]);
884
+ var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
885
+ var {
886
+ value,
887
+ onChange: _onChange,
888
+ TextFieldProps
889
+ } = _ref,
890
+ props = _objectWithoutProperties(_ref, _excluded$5);
891
+ function handleDelete(index) {
892
+ var filteredOrders = value === null || value === void 0 ? void 0 : value.filter((_item, fieldIndex) => fieldIndex !== index);
893
+ void (_onChange === null || _onChange === void 0 ? void 0 : _onChange(filteredOrders, 'remove-option'));
894
+ }
895
+ return /*#__PURE__*/jsx(Autocomplete, _objectSpread(_objectSpread({}, props), {}, {
896
+ ref: ref,
897
+ multiple: true,
898
+ freeSolo: true,
899
+ value: value,
900
+ disableClearable: true,
901
+ filterSelectedOptions: true,
902
+ filterOptions: _filterOptions => {
903
+ return _filterOptions.filter(option => option !== '');
904
+ },
905
+ onChange: (_event, selectedValue, reason) => {
906
+ var emails = selectedValue.flatMap(item => item.split(',')).map(item => item.trim());
907
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, reason);
908
+ },
909
+ renderTags: items => {
910
+ return /*#__PURE__*/jsx(Inline, {
911
+ space: "xxsmall",
912
+ children: items.map((option, index) => {
913
+ return /*#__PURE__*/jsx(Tag, {
914
+ color: "grey",
915
+ variant: "subtle",
916
+ children: /*#__PURE__*/jsxs(Inline, {
917
+ space: "xxsmall",
918
+ children: [/*#__PURE__*/jsx(TextBox$1, {
919
+ wrapOverflow: true,
920
+ color: "primary",
921
+ children: option
922
+ }), /*#__PURE__*/jsx(IconButton, {
923
+ size: "small",
924
+ onClick: () => {
925
+ handleDelete(index);
926
+ },
927
+ children: /*#__PURE__*/jsx(CloseIcon, {})
928
+ })]
929
+ })
930
+ }, index);
931
+ })
932
+ });
933
+ },
934
+ renderInput: params => /*#__PURE__*/jsx(MultipleFieldText, _objectSpread(_objectSpread(_objectSpread({}, params), TextFieldProps), {}, {
935
+ multiline: true,
936
+ minRows: 2,
937
+ variant: "outlined",
938
+ fullWidth: true,
939
+ InputProps: _objectSpread(_objectSpread(_objectSpread({}, TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.InputProps), params.InputProps), {}, {
940
+ startAdornment: params.InputProps.startAdornment
941
+ }),
942
+ placeholder: "Enter individual emails on each line or separate them with comma (,)",
943
+ onChange: event => {
944
+ var text = event.target.value.replace(/,/g, '');
945
+ var hasCommaOrSpace = /,|\s/.test(event.target.value);
946
+ if (hasCommaOrSpace && text.trim() !== '') {
947
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), text.trim()], 'select-option');
948
+ }
949
+ }
950
+ }))
951
+ }));
952
+ });
953
+ if (process.env.NODE_ENV !== "production") EmailAutocomplete.displayName = "EmailAutocomplete";
954
+ EmailAutocomplete.displayName = 'EmailAutocomplete';
955
+
956
+ var _excluded$6 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
864
957
  function toBytes(input, unit) {
865
958
  if (unit === 'gb') return input * (1 << 30);
866
959
  if (unit === 'mb') return input * (1 << 20);
@@ -929,7 +1022,7 @@ var FileDropZone = /*#__PURE__*/forwardRef((props, ref) => {
929
1022
  onDropRejected: _onDropRejected,
930
1023
  onDropAccepted: _onDropAccepted
931
1024
  } = props,
932
- dropzoneProps = _objectWithoutProperties(props, _excluded$5);
1025
+ dropzoneProps = _objectWithoutProperties(props, _excluded$6);
933
1026
  return /*#__PURE__*/jsx(Suspense, {
934
1027
  fallback: fallback,
935
1028
  children: /*#__PURE__*/jsx(Dropzone, _objectSpread(_objectSpread({}, dropzoneProps), {}, {
@@ -1126,7 +1219,7 @@ var FlagList = /*#__PURE__*/forwardRef((_ref2, ref) => {
1126
1219
  });
1127
1220
  if (process.env.NODE_ENV !== "production") FlagList.displayName = "FlagList";
1128
1221
 
1129
- var _excluded$6 = ["variant", "showHelpIcon", "endAction", "children"];
1222
+ var _excluded$7 = ["variant", "showHelpIcon", "endAction", "children"];
1130
1223
  var IconContainer = /*#__PURE__*/styled.div.withConfig({
1131
1224
  displayName: "FlagListItem__IconContainer",
1132
1225
  componentId: "SD__sc-o5bqru-0"
@@ -1186,7 +1279,7 @@ var FlagListItem = /*#__PURE__*/forwardRef((_ref7, ref) => {
1186
1279
  endAction,
1187
1280
  children
1188
1281
  } = _ref7,
1189
- rest = _objectWithoutProperties(_ref7, _excluded$6);
1282
+ rest = _objectWithoutProperties(_ref7, _excluded$7);
1190
1283
  return /*#__PURE__*/jsxs(BannerListContainer, _objectSpread(_objectSpread({}, rest), {}, {
1191
1284
  ref: ref,
1192
1285
  $variant: variant,
@@ -1203,7 +1296,7 @@ var FlagListItem = /*#__PURE__*/forwardRef((_ref7, ref) => {
1203
1296
  });
1204
1297
  if (process.env.NODE_ENV !== "production") FlagListItem.displayName = "FlagListItem";
1205
1298
 
1206
- var _excluded$7 = ["color", "target", "rel"],
1299
+ var _excluded$8 = ["color", "target", "rel"],
1207
1300
  _excluded2$2 = ["children", "linkComponent"];
1208
1301
  var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
1209
1302
  var {
@@ -1211,7 +1304,7 @@ var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
1211
1304
  target = '_blank',
1212
1305
  rel = 'noreferrer noopener'
1213
1306
  } = _ref,
1214
- props = _objectWithoutProperties(_ref, _excluded$7);
1307
+ props = _objectWithoutProperties(_ref, _excluded$8);
1215
1308
  return /*#__PURE__*/jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
1216
1309
  ref: ref,
1217
1310
  rel: rel,
@@ -1257,7 +1350,7 @@ function useNavbarContext() {
1257
1350
  return useContext(NavbarContext);
1258
1351
  }
1259
1352
 
1260
- var _excluded$8 = ["active", "hasBadge"];
1353
+ var _excluded$9 = ["active", "hasBadge"];
1261
1354
  var StyledBottomNavigation = /*#__PURE__*/styled(BottomNavigation).withConfig({
1262
1355
  displayName: "NavbarBottomBar__StyledBottomNavigation",
1263
1356
  componentId: "SD__sc-9z6v3k-0"
@@ -1301,7 +1394,7 @@ function NavbarBottomBar(_ref) {
1301
1394
  active,
1302
1395
  hasBadge
1303
1396
  } = _ref2,
1304
- item = _objectWithoutProperties(_ref2, _excluded$8);
1397
+ item = _objectWithoutProperties(_ref2, _excluded$9);
1305
1398
  return /*#__PURE__*/createElement(StyledBottomNavigationAction, _objectSpread(_objectSpread({}, item), {}, {
1306
1399
  key: item.value,
1307
1400
  icon: hasBadge ? /*#__PURE__*/jsxs(IconWrapper, {
@@ -1661,7 +1754,7 @@ function Navbar(_ref) {
1661
1754
  });
1662
1755
  }
1663
1756
 
1664
- var _excluded$9 = ["title", "subtitle", "children"];
1757
+ var _excluded$a = ["title", "subtitle", "children"];
1665
1758
  var StyledTypography = /*#__PURE__*/styled(Typography).withConfig({
1666
1759
  displayName: "NavbarAvatar__StyledTypography",
1667
1760
  componentId: "SD__sc-19q2zd0-0"
@@ -1672,7 +1765,7 @@ function NavbarAvatar(_ref) {
1672
1765
  subtitle,
1673
1766
  children
1674
1767
  } = _ref,
1675
- props = _objectWithoutProperties(_ref, _excluded$9);
1768
+ props = _objectWithoutProperties(_ref, _excluded$a);
1676
1769
  var {
1677
1770
  isNavbarExpanded
1678
1771
  } = useNavbarContext();
@@ -1882,7 +1975,7 @@ var SidebarContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
1882
1975
  });
1883
1976
  if (process.env.NODE_ENV !== "production") SidebarContainer.displayName = "SidebarContainer";
1884
1977
 
1885
- var _excluded$a = ["onClick", "children"];
1978
+ var _excluded$b = ["onClick", "children"];
1886
1979
  function SidebarBackButton(_ref) {
1887
1980
  var {
1888
1981
  onClick: _onClick,
@@ -1890,7 +1983,7 @@ function SidebarBackButton(_ref) {
1890
1983
  fontSize: "small"
1891
1984
  })
1892
1985
  } = _ref,
1893
- props = _objectWithoutProperties(_ref, _excluded$a);
1986
+ props = _objectWithoutProperties(_ref, _excluded$b);
1894
1987
  var isCollapsed = useCollapseBreakpoint('sm');
1895
1988
  var {
1896
1989
  openSidebar
@@ -2256,5 +2349,5 @@ var SidebarSubheader = /*#__PURE__*/forwardRef((_ref, ref) => {
2256
2349
  });
2257
2350
  if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "SidebarSubheader";
2258
2351
 
2259
- export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Chat, ChatMessage, Container, DescriptionItem, DescriptionLineItem, DottedLine, FileDropZone, FileListItem, FlagList, FlagListItem, LinkedText, MultilineText, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarBackButton, SidebarContainer, SidebarContent, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext, useSidebarContext };
2352
+ export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Chat, ChatMessage, Container, DescriptionItem, DescriptionLineItem, DottedLine, EmailAutocomplete, FileDropZone, FileListItem, FlagList, FlagListItem, LinkedText, MultilineText, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarBackButton, SidebarContainer, SidebarContent, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext, useSidebarContext };
2260
2353
  //# sourceMappingURL=index.js.map