@digital-ai/dot-components 3.26.0 → 4.1.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/index.esm.js CHANGED
@@ -3151,7 +3151,12 @@ const StyledPopper = styled(Popper)`
3151
3151
  &.${rootClassName$1a} {
3152
3152
  font-family: ${theme.typography.fontFamily};
3153
3153
  font-size: ${theme.typography.body1.fontSize}px;
3154
- z-index: ${levelSecond};
3154
+
3155
+ /* Conditionally setting popper's 'z-index' */
3156
+ ${({
3157
+ $zIndex
3158
+ }) => $zIndex === undefined ? `z-index: ${levelSecond};` : `z-index: ${$zIndex};`}
3159
+ }
3155
3160
  }
3156
3161
  &.${rootClassName$19}, &.${rootClassName$1a} {
3157
3162
  .MuiPaper-root:not(:empty) {
@@ -6669,6 +6674,7 @@ const DotAutoComplete = ({
6669
6674
  placeholder,
6670
6675
  popperClassName,
6671
6676
  popperPlacement,
6677
+ popperZIndex,
6672
6678
  preserveGroupOrder = false,
6673
6679
  readOnly = false,
6674
6680
  renderGroup,
@@ -6740,7 +6746,8 @@ const DotAutoComplete = ({
6740
6746
  if (!isActionItemDefined) return jsx(StyledPopper, Object.assign({}, props, {
6741
6747
  className: popperClasses,
6742
6748
  disablePortal: disablePortal,
6743
- "$maxHeight": maxHeight
6749
+ "$maxHeight": maxHeight,
6750
+ "$zIndex": popperZIndex
6744
6751
  }));
6745
6752
  // Disable action if customer explicitly enabled duplicate
6746
6753
  // item insertion and input text is found inside the 'options'
@@ -6763,6 +6770,7 @@ const DotAutoComplete = ({
6763
6770
  className: popperClasses,
6764
6771
  disablePortal: disablePortal,
6765
6772
  "$maxHeight": maxHeight,
6773
+ "$zIndex": popperZIndex,
6766
6774
  placement: popperPlacement,
6767
6775
  children: jsxs(Paper, Object.assign({}, paperProps, {
6768
6776
  children: [paperChildren, jsx("div", {
@@ -11313,6 +11321,9 @@ const StyledAppSelectAutoCompleteOption = styled.li`
11313
11321
  &:focus {
11314
11322
  background: ${theme.palette.grey[500]};
11315
11323
  }
11324
+ .dot-avatar {
11325
+ margin-bottom: 0px;
11326
+ }
11316
11327
  `}
11317
11328
  `;
11318
11329
 
@@ -11468,6 +11479,9 @@ function ActivePublishMessage({
11468
11479
  options: appOptions,
11469
11480
  required: true,
11470
11481
  dense: false,
11482
+ popperPlacement: "auto",
11483
+ popperZIndex: levelTop,
11484
+ disablePortal: false,
11471
11485
  size: "medium",
11472
11486
  renderOption: (props, option) => {
11473
11487
  return jsxs(StyledAppSelectAutoCompleteOption, Object.assign({}, props, {
@@ -11477,7 +11491,7 @@ function ActivePublishMessage({
11477
11491
  iconId: "file-image",
11478
11492
  type: "image",
11479
11493
  variant: "circular",
11480
- size: "large"
11494
+ size: "medium"
11481
11495
  }), jsx("div", {
11482
11496
  children: option.title
11483
11497
  })]
@@ -11771,133 +11785,92 @@ function DotDashboardOptionsMenu({
11771
11785
  const menuItems = [];
11772
11786
  if (!isEdit && onViewMode && !dashboard.is_ootb_dashboard && !dashboardLocked) {
11773
11787
  menuItems.push({
11774
- children: jsxs(DotLink, {
11788
+ children: jsx(DotButton, {
11775
11789
  ariaLabel: "Edit dashboard",
11776
- color: "inherit",
11777
- onClick: handleEditClick,
11778
- underline: "none",
11779
- children: [jsx(DotIcon, {
11790
+ type: "text",
11791
+ startIcon: jsx(DotIcon, {
11780
11792
  iconId: "edit"
11781
- }), " Edit"]
11793
+ }),
11794
+ children: "Edit"
11782
11795
  }),
11783
- key: 'edit',
11784
- onclick: handleEditClick
11796
+ key: 'edit'
11785
11797
  });
11786
11798
  }
11787
11799
  if (onStartStatusChange && !dashboard.is_ootb_dashboard && isDraft) {
11788
11800
  menuItems.push({
11789
11801
  key: 'publish',
11790
- children: jsxs(DotLink, {
11802
+ children: jsx(DotButton, {
11791
11803
  ariaLabel: "Publish dashboard",
11792
- color: "inherit",
11804
+ type: "text",
11793
11805
  "data-testid": `publish-dashboard-button-${dashboard.id}`,
11794
- onClick: () => {
11795
- handleMenuClose();
11796
- onStartStatusChange(dashboard, DashboardView.lifecycle_state.PUBLISHED);
11797
- },
11798
- underline: "none",
11799
- children: [jsx(DotIcon, {
11806
+ startIcon: jsx(DotIcon, {
11800
11807
  iconId: "send-airplane"
11801
- }), " ", 'Publish']
11802
- }),
11803
- onclick: () => {
11804
- handleMenuClose();
11805
- onStartStatusChange(dashboard, DashboardView.lifecycle_state.PUBLISHED);
11806
- }
11808
+ }),
11809
+ children: "Publish"
11810
+ })
11807
11811
  });
11808
11812
  }
11809
11813
  if (onStartDuplicate) {
11810
- const handleDuplicateClick = () => {
11811
- handleMenuClose();
11812
- onStartDuplicate(dashboard);
11813
- };
11814
11814
  menuItems.push({
11815
- children: jsxs(DotLink, {
11815
+ children: jsx(DotButton, {
11816
11816
  ariaLabel: "Duplicate dashboard",
11817
- color: "inherit",
11818
- onClick: handleDuplicateClick,
11819
- underline: "none",
11820
- children: [jsx(DotIcon, {
11817
+ type: "text",
11818
+ startIcon: jsx(DotIcon, {
11821
11819
  iconId: "duplicate"
11822
- }), " Duplicate"]
11820
+ }),
11821
+ children: "Duplicate"
11823
11822
  }),
11824
- key: 'duplicate',
11825
- onclick: handleDuplicateClick
11823
+ key: 'duplicate'
11826
11824
  });
11827
11825
  }
11828
11826
  if (onStartDelete && !dashboard.is_ootb_dashboard && !dashboardLocked) {
11829
- const handleDeleteClick = () => {
11830
- handleMenuClose();
11831
- onStartDelete(dashboard);
11832
- };
11833
11827
  menuItems.push({
11834
- children: jsxs(DotLink, {
11828
+ children: jsx(DotButton, {
11835
11829
  ariaLabel: "Delete dashboard",
11836
- color: "inherit",
11837
- onClick: handleDeleteClick,
11838
- underline: "none",
11839
- children: [jsx(DotIcon, {
11830
+ type: "text",
11831
+ startIcon: jsx(DotIcon, {
11840
11832
  iconId: "delete"
11841
- }), " Delete"]
11833
+ }),
11834
+ children: "Delete"
11842
11835
  }),
11843
- key: 'delete',
11844
- onclick: handleDeleteClick
11836
+ key: 'delete'
11845
11837
  });
11846
11838
  }
11847
11839
  // If this is a published dashboard, with in-progress changes, and the user is the author of the changes,
11848
11840
  // show the republish, revert, and view original options.
11849
11841
  if (isPublished && currentUser && dashboard.is_being_modified && dashboard.modified_author_id === currentUser.id) {
11850
- const handlePublishChangesClick = () => {
11851
- handleMenuClose();
11852
- onStartStatusChange && onStartStatusChange(dashboard, DashboardView.lifecycle_state.PUBLISHED);
11853
- };
11854
- const handleRevertChangesClick = () => {
11855
- handleMenuClose();
11856
- onStartRevert && onStartRevert(dashboard);
11857
- };
11858
- const handleViewOriginalClick = () => {
11859
- handleMenuClose();
11860
- // Move to view mode and display the original dashboard without the changes
11861
- onViewOriginal && onViewOriginal(dashboard);
11862
- };
11863
11842
  menuItems.push({
11864
- children: jsxs(DotLink, {
11843
+ children: jsx(DotButton, {
11865
11844
  ariaLabel: "Publish changes",
11866
- color: "inherit",
11867
- onClick: handlePublishChangesClick,
11868
- underline: "none",
11869
- children: [jsx(DotIcon, {
11845
+ type: "text",
11846
+ startIcon: jsx(DotIcon, {
11870
11847
  iconId: "send-airplane"
11871
- }), " Publish changes"]
11848
+ }),
11849
+ children: "Publish changes"
11872
11850
  }),
11873
- key: 'republish',
11874
- onclick: handlePublishChangesClick
11851
+ key: 'republish'
11875
11852
  });
11876
11853
  menuItems.push({
11877
- children: jsxs(DotLink, {
11854
+ children: jsx(DotButton, {
11878
11855
  ariaLabel: "Revert to original",
11879
- color: "inherit",
11880
- onClick: handleRevertChangesClick,
11881
- underline: "none",
11882
- children: [jsx(DotIcon, {
11856
+ type: "text",
11857
+ startIcon: jsx(DotIcon, {
11883
11858
  iconId: "undo"
11884
- }), " Revert to original"]
11859
+ }),
11860
+ children: "Revert to original"
11885
11861
  }),
11886
- key: 'revert',
11887
- onclick: handleRevertChangesClick
11862
+ key: 'revert'
11888
11863
  });
11889
11864
  menuItems.push({
11890
- children: jsxs(DotLink, {
11865
+ children: jsx(DotButton, {
11891
11866
  ariaLabel: "Open published dashboard",
11892
- color: "inherit",
11893
- onClick: handleViewOriginalClick,
11894
- underline: "none",
11895
- children: [jsx(DotIcon, {
11867
+ type: "text",
11868
+ startIcon: jsx(DotIcon, {
11896
11869
  iconId: "visibility-on"
11897
- }), " Open published dashboard"]
11870
+ }),
11871
+ children: "Open published dashboard"
11898
11872
  }),
11899
- key: 'original',
11900
- onclick: handleViewOriginalClick
11873
+ key: 'original'
11901
11874
  });
11902
11875
  }
11903
11876
  if (onDetails) {
@@ -11911,18 +11884,16 @@ function DotDashboardOptionsMenu({
11911
11884
  });
11912
11885
  }
11913
11886
  menuItems.push({
11914
- children: jsxs(DotLink, {
11887
+ children: jsx(DotButton, {
11915
11888
  ariaLabel: "Dashboard details",
11916
- color: "inherit",
11917
- onClick: () => onDetails(dashboard),
11918
- underline: "none",
11919
- children: [jsx(DotIcon, {
11889
+ type: "text",
11890
+ startIcon: jsx(DotIcon, {
11920
11891
  iconId: "file-lines"
11921
- }), " Details"]
11892
+ }),
11893
+ children: "Details"
11922
11894
  }),
11923
11895
  classes: 'dashboard-details',
11924
- key: 'dashboard-details',
11925
- onClick: () => onDetails(dashboard)
11896
+ key: 'dashboard-details'
11926
11897
  });
11927
11898
  }
11928
11899
  // useful since most of the screen is generally an iframe
@@ -11935,6 +11906,33 @@ function DotDashboardOptionsMenu({
11935
11906
  window.removeEventListener('blur', blurHandler);
11936
11907
  };
11937
11908
  }, []);
11909
+ const handleSelectMenuItem = useCallback((event, menuId, itemKey) => {
11910
+ switch (itemKey) {
11911
+ case 'edit':
11912
+ handleEditClick();
11913
+ break;
11914
+ case 'duplicate':
11915
+ onStartDuplicate(dashboard);
11916
+ break;
11917
+ case 'delete':
11918
+ onStartDelete(dashboard);
11919
+ break;
11920
+ case 'revert':
11921
+ onStartRevert(dashboard);
11922
+ break;
11923
+ case 'original':
11924
+ onViewOriginal(dashboard);
11925
+ break;
11926
+ case 'dashboard-details':
11927
+ onDetails(dashboard);
11928
+ break;
11929
+ case 'republish':
11930
+ case 'publish':
11931
+ onStartStatusChange(dashboard, DashboardView.lifecycle_state.PUBLISHED);
11932
+ break;
11933
+ }
11934
+ handleMenuClose();
11935
+ }, [menuItems, handleMenuClose]);
11938
11936
  return menuItems.length > 0 ? jsxs(Fragment, {
11939
11937
  children: [jsx(DotIconButton, {
11940
11938
  className: "expand-button",
@@ -11951,6 +11949,7 @@ function DotDashboardOptionsMenu({
11951
11949
  menuItems: menuItems,
11952
11950
  menuPlacement: menuPlacement,
11953
11951
  open: open,
11952
+ onSelect: handleSelectMenuItem,
11954
11953
  onLeave: handleMenuClose
11955
11954
  })]
11956
11955
  }) : null;
@@ -12493,7 +12492,7 @@ const DotIllustration = ({
12493
12492
  children: jsx("img", {
12494
12493
  alt: alt || 'Illustration',
12495
12494
  "aria-label": ariaLabel || title || 'Illustration',
12496
- className: `illustration-${illustrationId}-${theme} dot-img`,
12495
+ className: `${illustrationId} ${theme} dot-img`,
12497
12496
  "data-testid": dataTestId && `${dataTestId}-img`,
12498
12497
  role: ariaRole,
12499
12498
  title: title || 'Illustration'
@@ -12545,7 +12544,7 @@ const DotEmptyFilterState = ({
12545
12544
  ariaLabel,
12546
12545
  className,
12547
12546
  'data-testid': dataTestId,
12548
- illustrationId = 'digitalai-empty',
12547
+ illustrationId = 'empty',
12549
12548
  imageAltText = 'no results found'
12550
12549
  }) => {
12551
12550
  return jsx(DotEmptyState, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "3.26.0",
3
+ "version": "4.1.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -2,5 +2,5 @@ export declare const dashboardCategoriesContainerClassName = "dashboard-categori
2
2
  export declare const InlineMessage: import("styled-components").StyledComponent<({ ariaLabel, ariaLevel, ariaRole, className, "data-testid": dataTestId, children, component, noMarginBottom, noWrap, variant, }: import("../../typography/Typography").TypographyProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
3
3
  export declare const StyledPublishConfirmDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const StyledAppSelectDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const StyledAppSelectDotAutoComplete: import("styled-components").StyledComponent<(<T extends import("../..").AutoCompleteOption>({ ListboxComponent, actionItem, ariaLabel, autoFocus, autoHighlight, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, endAdornmentTooltip, error, filterOptions, filterSelectedOptions, freesolo, checkIfOptionDisabled, group, helperText, informationToolTip, inputId, inputRef, inputValue, isOptionEqualToValue, label, loading, maxHeight, multiple, onBlur, onChange, onClose, onInputChange, onOpen, open, options, persistentLabel, placeholder, popperClassName, popperPlacement, preserveGroupOrder, readOnly, renderGroup, renderOption, renderTags, required, size, value, warning, }: import("../../auto-complete/AutoComplete").AutoCompleteProps<T>) => import("react/jsx-runtime").JSX.Element), any, {}, never>;
5
+ export declare const StyledAppSelectDotAutoComplete: import("styled-components").StyledComponent<(<T extends import("../..").AutoCompleteOption>({ ListboxComponent, actionItem, ariaLabel, autoFocus, autoHighlight, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, endAdornmentTooltip, error, filterOptions, filterSelectedOptions, freesolo, checkIfOptionDisabled, group, helperText, informationToolTip, inputId, inputRef, inputValue, isOptionEqualToValue, label, loading, maxHeight, multiple, onBlur, onChange, onClose, onInputChange, onOpen, open, options, persistentLabel, placeholder, popperClassName, popperPlacement, popperZIndex, preserveGroupOrder, readOnly, renderGroup, renderOption, renderTags, required, size, value, warning, }: import("../../auto-complete/AutoComplete").AutoCompleteProps<T>) => import("react/jsx-runtime").JSX.Element), any, {}, never>;
6
6
  export declare const StyledAppSelectAutoCompleteOption: import("styled-components").StyledComponent<"li", any, {}, never>;
@@ -79,6 +79,8 @@ export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOp
79
79
  popperClassName?: string;
80
80
  /** Placement of the popper */
81
81
  popperPlacement?: PopperPlacementType;
82
+ /** Custom Z-index of the popper */
83
+ popperZIndex?: number;
82
84
  /** If true, group order (as specified by the consumer) will be preserved. Default group sorting is used when not specified. */
83
85
  preserveGroupOrder?: boolean;
84
86
  /** If true: popper cannot be opened, TextField is in read only mode, change is not allowed */
@@ -98,4 +100,4 @@ export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOp
98
100
  /** If true, the label will be displayed in a warning state. */
99
101
  warning?: boolean;
100
102
  }
101
- export declare const DotAutoComplete: <T extends AutoCompleteOption>({ ListboxComponent, actionItem, ariaLabel, autoFocus, autoHighlight, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, endAdornmentTooltip, error, filterOptions, filterSelectedOptions, freesolo, checkIfOptionDisabled, group, helperText, informationToolTip, inputId, inputRef, inputValue, isOptionEqualToValue, label, loading, maxHeight, multiple, onBlur, onChange, onClose, onInputChange, onOpen, open, options, persistentLabel, placeholder, popperClassName, popperPlacement, preserveGroupOrder, readOnly, renderGroup, renderOption, renderTags, required, size, value, warning, }: AutoCompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
103
+ export declare const DotAutoComplete: <T extends AutoCompleteOption>({ ListboxComponent, actionItem, ariaLabel, autoFocus, autoHighlight, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, endAdornmentTooltip, error, filterOptions, filterSelectedOptions, freesolo, checkIfOptionDisabled, group, helperText, informationToolTip, inputId, inputRef, inputValue, isOptionEqualToValue, label, loading, maxHeight, multiple, onBlur, onChange, onClose, onInputChange, onOpen, open, options, persistentLabel, placeholder, popperClassName, popperPlacement, popperZIndex, preserveGroupOrder, readOnly, renderGroup, renderOption, renderTags, required, size, value, warning, }: AutoCompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -13,6 +13,7 @@ export declare const StyledPopper: import("styled-components").StyledComponent<i
13
13
  } & import("react").RefAttributes<HTMLDivElement>>, any, StyledPopperArgs, never>;
14
14
  interface StyledPopperArgs {
15
15
  $maxHeight?: number | string;
16
+ $zIndex?: number;
16
17
  }
17
18
  export declare const getListMaxHeight: (maxHeight: string | number) => string;
18
19
  export {};