@digital-ai/dot-components 4.5.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 React__default, { useState, useRef, useEffect, createContext, useMemo, useContext, forwardRef, useCallback, createElement, Fragment as Fragment$1, useLayoutEffect } from 'react';
4
- import { Tooltip, InputAdornment, InputLabel, TextField, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, Toolbar, Fade, StyledEngineProvider, Alert, Avatar, Button, Link, List, ListSubheader, Divider, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, Drawer, IconButton, ListItem, ListItemButton, Collapse, ListItemIcon, 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, Snackbar, RadioGroup, Radio, Switch, Skeleton, ButtonGroup, Stepper, Step, StepLabel, StepContent, TablePagination, TableContainer, TableBody, TableCell, TableRow, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress, Slide } from '@mui/material';
4
+ import { Tooltip, InputAdornment, InputLabel, TextField, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, Toolbar, Fade, StyledEngineProvider, Alert, Avatar, Button, Link, List, ListSubheader, Divider, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, Drawer, IconButton, ListItem, ListItemButton, Collapse, ListItemIcon, ListItemText, Badge, useMediaQuery, Chip, Autocomplete, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, Snackbar, RadioGroup, Radio, Switch, Skeleton, ButtonGroup, Stepper, Step, StepLabel, TablePagination, TableContainer, TableBody, TableCell, TableRow, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress, Slide } 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, useTheme } from '@mui/material/styles';
@@ -231,12 +231,22 @@ const StyledTextField = styled(TextField)`
231
231
  &.${rootClassName$1l} {
232
232
  .MuiInputBase-root {
233
233
  margin-bottom: 0;
234
+
235
+ &:not(.MuiAutocomplete-inputRoot) {
236
+ &.MuiInputBase-adornedStart {
237
+ padding-left: ${theme.spacing(1.5)};
238
+ }
239
+ &.MuiInputBase-adornedEnd {
240
+ padding-right: ${theme.spacing(1)};
241
+ }
242
+ }
234
243
  }
235
244
  .MuiInputBase-input {
236
245
  box-sizing: content-box;
237
246
  }
238
247
  .MuiOutlinedInput-input {
239
- padding: ${InputProps.startAdornment ? `18px 12px 18px 0px` : `18px 12px`};
248
+ padding: 18px ${InputProps.endAdornment ? '0px' : '12px'} 18px
249
+ ${InputProps.startAdornment ? '0px' : '12px'};
240
250
  &::placeholder {
241
251
  opacity: 1;
242
252
  color: ${theme.palette.figma.typography.gray};
@@ -280,6 +290,14 @@ const StyledTextField = styled(TextField)`
280
290
  .MuiInputBase-adornedEnd .clear-icon-button.hidden {
281
291
  visibility: hidden;
282
292
  }
293
+
294
+ .${adornmentIconClassName}.MuiInputAdornment-positionStart {
295
+ margin-right: ${theme.spacing(0.5)};
296
+ }
297
+
298
+ .${adornmentIconClassName}.MuiInputAdornment-positionEnd {
299
+ margin: ${theme.spacing(0)};
300
+ }
283
301
  }
284
302
 
285
303
  .dot-select,
@@ -377,12 +395,6 @@ const StyledTextField = styled(TextField)`
377
395
  }
378
396
  }
379
397
 
380
- .MuiInputBase-inputAdornedStart {
381
- padding-left: 12px;
382
- }
383
- .MuiInputBase-inputAdornedEnd {
384
- padding-right: 12px;
385
- }
386
398
  .MuiFormHelperText-root {
387
399
  ${formHelperTextRootStyles(theme)};
388
400
  }
@@ -6297,6 +6309,15 @@ const DotAppToolbar = ({
6297
6309
  }, index)
6298
6310
  }, index);
6299
6311
  });
6312
+ const getLogoLinkComponent = (accessibilityLabel, customClass, dataTestid, linkHref, component) => {
6313
+ return linkHref ? jsx(DotLink, {
6314
+ ariaLabel: accessibilityLabel,
6315
+ className: customClass,
6316
+ "data-testid": dataTestid,
6317
+ href: linkHref,
6318
+ children: component
6319
+ }) : component;
6320
+ };
6300
6321
  const appToolbar = jsxs(StyledAppToolbar, {
6301
6322
  "aria-label": ariaLabel,
6302
6323
  className: rootClasses,
@@ -6339,27 +6360,34 @@ const DotAppToolbar = ({
6339
6360
  })]
6340
6361
  }), jsxs("div", {
6341
6362
  className: "dot-branding",
6342
- children: [jsx(DotLink, {
6343
- ariaLabel: "Digital.ai Logo",
6344
- className: "primary-logo",
6345
- "data-testid": "primary-logo",
6346
- href: primaryLogoHref,
6347
- children: customLogo ? customLogo : jsx(DotTooltip, {
6348
- "data-testid": "logo-tooltip",
6349
- title: "digital.ai",
6350
- children: jsx(ForwardRef, {})
6351
- })
6352
- }), displayAppLogo && jsx(DotLink, {
6353
- ariaLabel: "Application Logo",
6354
- href: appLogoHref,
6355
- "data-testid": "app-logo",
6356
- children: jsx(DotAppLogo, {
6357
- appLogo: appLogo,
6358
- appLogoSmall: appLogoSmall,
6359
- className: "dot-app-logo",
6360
- smallOnly: !targetBreakpoint
6363
+ children: [getLogoLinkComponent('Digital.ai Logo',
6364
+ // aria-label
6365
+ 'primary-logo',
6366
+ // class name
6367
+ 'primary-logo',
6368
+ // data-testid
6369
+ primaryLogoHref,
6370
+ // href
6371
+ customLogo ? customLogo : jsx(DotTooltip, {
6372
+ "data-testid": "logo-tooltip",
6373
+ title: primaryLogoHref ? 'digital.ai' : '',
6374
+ children: jsx(ForwardRef, {
6375
+ className: !primaryLogoHref ? 'primary-logo' : ''
6361
6376
  })
6362
- })]
6377
+ })), displayAppLogo && getLogoLinkComponent('Application Logo',
6378
+ // aria-label
6379
+ '',
6380
+ // class name
6381
+ 'app-logo',
6382
+ // data-testid
6383
+ appLogoHref,
6384
+ // href
6385
+ jsx(DotAppLogo, {
6386
+ appLogo: appLogo,
6387
+ appLogoSmall: appLogoSmall,
6388
+ className: "dot-app-logo",
6389
+ smallOnly: !targetBreakpoint
6390
+ }))]
6363
6391
  }), children, jsxs("div", {
6364
6392
  className: "dot-right-side",
6365
6393
  children: [navItems.length > 0 && jsx("nav", {
@@ -6386,56 +6414,12 @@ const DotAppToolbar = ({
6386
6414
  }) : appToolbar;
6387
6415
  };
6388
6416
 
6389
- const rootClassName$Y = 'dot-autocomplete';
6390
- const inputRootClassName = 'dot-input-root';
6391
- const inputMediumClassName = 'dot-input-medium';
6392
- const StyledAutocomplete = styled(Autocomplete)`
6393
- ${({
6394
- theme
6395
- }) => css`
6396
- &.${rootClassName$Y} {
6397
- &.${inputMediumClassName} .dot-text-field .${inputRootClassName} {
6398
- height: 56px;
6399
- padding-left: ${theme.spacing(2)};
6400
- }
6401
-
6402
- .MuiInputBase-root.Mui-disabled,
6403
- .${readOnlyClassName$1} .MuiInputBase-root {
6404
- ${readOnlyStyles(theme)};
6405
- }
6406
-
6407
- .${inputRootClassName} {
6408
- /* Override only top/bottom, but preserve left/right padding */
6409
- padding-top: ${theme.spacing(1)};
6410
- padding-bottom: ${theme.spacing(1)};
6411
- }
6412
-
6413
- .dot-chip:first-child {
6414
- margin-left: ${theme.spacing(0)};
6415
- }
6416
-
6417
- .dot-text-field {
6418
- .${inputRootClassName} {
6419
- min-height: ${theme.spacing(5)};
6420
- }
6421
-
6422
- .warning-icon {
6423
- color: ${theme.palette.warning.main};
6424
- }
6425
- .error-icon {
6426
- color: ${theme.palette.error.main};
6427
- }
6428
- }
6429
- }
6430
- `}
6431
- `;
6432
-
6433
- const rootClassName$X = 'dot-chip';
6417
+ const rootClassName$Y = 'dot-chip';
6434
6418
  const StyledChip = styled(Chip)`
6435
6419
  ${({
6436
6420
  theme
6437
6421
  }) => css`
6438
- &.${rootClassName$X} {
6422
+ &.${rootClassName$Y} {
6439
6423
  background: ${theme.palette.figma.neutral.normal};
6440
6424
  border-color: ${theme.palette.figma.border.darker};
6441
6425
  color: ${theme.palette.figma.typography.black};
@@ -6541,7 +6525,7 @@ const DotChip = ({
6541
6525
  charactersLimit = DEFAULT_CHARACTERS_LIMIT,
6542
6526
  children,
6543
6527
  className,
6544
- 'data-pendoid': dataPendoId = rootClassName$X,
6528
+ 'data-pendoid': dataPendoId = rootClassName$Y,
6545
6529
  'data-testid': dataTestId,
6546
6530
  disabled = false,
6547
6531
  error = false,
@@ -6554,7 +6538,7 @@ const DotChip = ({
6554
6538
  tabIndex
6555
6539
  }) => {
6556
6540
  const errorClass = error ? 'Mui-error' : '';
6557
- const rootClasses = useStylesWithRootClass(rootClassName$X, className, errorClass);
6541
+ const rootClasses = useStylesWithRootClass(rootClassName$Y, className, errorClass);
6558
6542
  const getChipLabel = () => {
6559
6543
  if (charactersLimit <= 0 || children.length < charactersLimit) return children;
6560
6544
  const label = `${children.substring(0, charactersLimit)}...`;
@@ -6586,6 +6570,50 @@ const DotChip = ({
6586
6570
  });
6587
6571
  };
6588
6572
 
6573
+ const rootClassName$X = 'dot-autocomplete';
6574
+ const inputRootClassName = 'dot-input-root';
6575
+ const inputMediumClassName = 'dot-input-medium';
6576
+ const StyledAutocomplete = styled(Autocomplete)`
6577
+ ${({
6578
+ theme
6579
+ }) => css`
6580
+ &.${rootClassName$X} {
6581
+ &.${inputMediumClassName} .dot-text-field .${inputRootClassName} {
6582
+ height: 56px;
6583
+ padding-left: ${theme.spacing(2)};
6584
+ }
6585
+
6586
+ .MuiInputBase-root.Mui-disabled,
6587
+ .${readOnlyClassName$1} .MuiInputBase-root {
6588
+ ${readOnlyStyles(theme)};
6589
+ }
6590
+
6591
+ .${inputRootClassName} {
6592
+ /* Override only top/bottom, but preserve left/right padding */
6593
+ padding-top: ${theme.spacing(1)};
6594
+ padding-bottom: ${theme.spacing(1)};
6595
+ }
6596
+
6597
+ .dot-chip:first-child {
6598
+ margin-left: ${theme.spacing(0)};
6599
+ }
6600
+
6601
+ .dot-text-field {
6602
+ .${inputRootClassName} {
6603
+ min-height: ${theme.spacing(5)};
6604
+ }
6605
+
6606
+ .warning-icon {
6607
+ color: ${theme.palette.warning.main};
6608
+ }
6609
+ .error-icon {
6610
+ color: ${theme.palette.error.main};
6611
+ }
6612
+ }
6613
+ }
6614
+ `}
6615
+ `;
6616
+
6589
6617
  // takes multiple types of data from autocomplete selection
6590
6618
  // parses value and returns a string which is saved to state
6591
6619
  const parseAutoCompleteValue = value => {
@@ -6642,6 +6670,11 @@ const isEmptyValue = value => {
6642
6670
  return !value;
6643
6671
  }
6644
6672
  };
6673
+ const getRootClassNames = (className, size) => useStylesWithRootClass(rootClassName$X, size === 'medium' && inputMediumClassName, className);
6674
+ const getTextFieldRootClassNames = (textFieldWarningClassName, isReadOnly) => useStylesWithRootClass(rootClassName$1l, isReadOnly && readOnlyClassName$1, textFieldWarningClassName);
6675
+ const getInputRootClassNames = isDense => useStylesWithRootClass(inputRootClassName, !isDense && inputMediumClassName);
6676
+ const getDefaultAutoCompleteValue = (hasMultiple, defaultValue) => hasMultiple && isString$2(defaultValue) ? [defaultValue] : defaultValue;
6677
+ const getAutoCompleteGroupBy = group => group ? option => option.group : undefined;
6645
6678
 
6646
6679
  function ariaLabelOrAlternates(ariaLabel, label, placeholder) {
6647
6680
  return ariaLabel || label || placeholder;
@@ -6654,7 +6687,7 @@ const DotAutoComplete = ({
6654
6687
  autoFocus,
6655
6688
  autoHighlight,
6656
6689
  className,
6657
- 'data-pendoid': dataPendoId = rootClassName$Y,
6690
+ 'data-pendoid': dataPendoId = rootClassName$X,
6658
6691
  'data-testid': dataTestId,
6659
6692
  defaultValue,
6660
6693
  dense = true,
@@ -6696,12 +6729,18 @@ const DotAutoComplete = ({
6696
6729
  renderTags,
6697
6730
  required = false,
6698
6731
  size = 'small',
6732
+ trimLongOptions = false,
6699
6733
  value,
6700
6734
  warning = false
6701
6735
  }) => {
6702
6736
  const [showPlaceholder, setShowPlaceholder] = useState(isEmptyValue(value) && isEmptyValue(defaultValue));
6703
6737
  const [isOpened, setIsOpened] = useState(false);
6704
6738
  const [inputText, setInputText] = useState('');
6739
+ useEffect(() => {
6740
+ if (trimLongOptions && renderOption) {
6741
+ console.warn('Please use `trimLongOptions` or `renderOption`. If both are used, `trimLongOptions` is ignored.');
6742
+ }
6743
+ }, []);
6705
6744
  // Used for focus management while popper is opened
6706
6745
  const actionItemRef = useRef();
6707
6746
  const onActionItemClick = actionItem === null || actionItem === void 0 ? void 0 : actionItem.onClick;
@@ -6710,9 +6749,9 @@ const DotAutoComplete = ({
6710
6749
  const popperOpen = !readOnly && (open || isOpened);
6711
6750
  const preventDuplicateInsertion = actionItem === null || actionItem === void 0 ? void 0 : actionItem.preventDuplicateInsertion;
6712
6751
  const textFieldWarningClassName = !error && warning && warningClassName;
6713
- const rootClasses = useStylesWithRootClass(rootClassName$Y, size === 'medium' && inputMediumClassName, className);
6714
- const textFieldRootClasses = useStylesWithRootClass(rootClassName$1l, readOnly && readOnlyClassName$1, textFieldWarningClassName);
6715
- const inputRootClasses = useStylesWithRootClass(inputRootClassName, !dense && inputMediumClassName);
6752
+ const rootClasses = getRootClassNames(className, size);
6753
+ const textFieldRootClasses = getTextFieldRootClassNames(textFieldWarningClassName, readOnly);
6754
+ const inputRootClasses = getInputRootClassNames(dense);
6716
6755
  const popperClasses = useStylesWithRootClass(rootClassName$1b, popperClassName);
6717
6756
  let highlightedOption = null;
6718
6757
  let textFieldInput;
@@ -6881,6 +6920,24 @@ const DotAutoComplete = ({
6881
6920
  }), getInputAdornment(), nativeEndAdornment]
6882
6921
  });
6883
6922
  };
6923
+ const renderTrimmedLongOptions = (props, option) => {
6924
+ const key = 'id' in option ? option.id : option.title;
6925
+ return jsx(DotTooltip, {
6926
+ "data-testid": dataTestId && `${dataTestId}-option-tooltip-${key}`,
6927
+ hoverVisibility: "overflow",
6928
+ title: option.title,
6929
+ children: jsx("li", Object.assign({}, props, {
6930
+ children: jsx(DotTypography, {
6931
+ noWrap: true,
6932
+ variant: "body1",
6933
+ children: option.title
6934
+ })
6935
+ }))
6936
+ }, key);
6937
+ };
6938
+ const handleRenderOption = (props, option, state) => {
6939
+ return renderOption ? renderOption(props, option, state) : renderTrimmedLongOptions(props, option);
6940
+ };
6884
6941
  return jsx(StyledAutocomplete, {
6885
6942
  PopperComponent: DotPopper,
6886
6943
  "aria-label": ariaLabel,
@@ -6891,14 +6948,14 @@ const DotAutoComplete = ({
6891
6948
  },
6892
6949
  "data-pendoid": dataPendoId,
6893
6950
  "data-testid": dataTestId,
6894
- defaultValue: multiple && isString$2(defaultValue) ? [defaultValue] : defaultValue,
6951
+ defaultValue: getDefaultAutoCompleteValue(multiple, defaultValue),
6895
6952
  disabled: disabled,
6896
6953
  filterOptions: filterOptions,
6897
6954
  filterSelectedOptions: filterSelectedOptions,
6898
6955
  freeSolo: freesolo,
6899
6956
  getOptionLabel: option => parseAutoCompleteValue(option),
6900
6957
  getOptionDisabled: checkIfOptionDisabled,
6901
- groupBy: group ? option => option.group : undefined,
6958
+ groupBy: getAutoCompleteGroupBy(group),
6902
6959
  id: inputId,
6903
6960
  inputValue: inputValue,
6904
6961
  isOptionEqualToValue: isOptionEqualToValue,
@@ -6989,7 +7046,7 @@ const DotAutoComplete = ({
6989
7046
  );
6990
7047
  },
6991
7048
  renderGroup: group ? renderGroup : undefined,
6992
- renderOption: renderOption,
7049
+ renderOption: renderOption || trimLongOptions ? handleRenderOption : undefined,
6993
7050
  renderTags: handleTagsRender(),
6994
7051
  size: size,
6995
7052
  value: value
@@ -8504,14 +8561,26 @@ const defaultColumns = {
8504
8561
  xl: 12,
8505
8562
  xxl: 12
8506
8563
  };
8564
+ // Ensures that the children returned is a list of children
8565
+ const ensureChildrenList = children => {
8566
+ if (children instanceof Array) {
8567
+ return children;
8568
+ }
8569
+ return [children];
8570
+ };
8507
8571
  const Grid = ({
8508
8572
  className,
8509
- children
8573
+ children,
8574
+ isLoading
8510
8575
  }) => {
8511
8576
  const rootClasses = useStylesWithRootClass(rootClassName$I, className);
8512
- return jsx("div", {
8577
+ return jsxs("div", {
8513
8578
  className: rootClasses,
8514
- children: children
8579
+ children: [children, isLoading && jsx(DotProgress, {
8580
+ className: "loading-more-data",
8581
+ color: "inherit",
8582
+ size: 20
8583
+ })]
8515
8584
  });
8516
8585
  };
8517
8586
  const StyledGrid = styled(Grid)`
@@ -8535,10 +8604,75 @@ const StyledGrid = styled(Grid)`
8535
8604
  ${gap && `grid-gap: ${gap};`}
8536
8605
  ${width && `width: ${width};`}
8537
8606
  ${height && `height: ${height};`}
8607
+ .loading-more-data {
8608
+ margin: auto;
8609
+ }
8538
8610
  `}
8539
8611
  `;
8540
- const CssGrid = props => {
8541
- return jsx(StyledGrid, Object.assign({}, props));
8612
+ const CssGrid = _a => {
8613
+ var {
8614
+ children,
8615
+ loadMoreData,
8616
+ onError
8617
+ } = _a,
8618
+ gridArgs = __rest(_a, ["children", "loadMoreData", "onError"]);
8619
+ const [page, setPage] = useState(0);
8620
+ const [isLoading, setIsLoading] = useState(false);
8621
+ const [isDone, setIsDone] = useState(false);
8622
+ const [gridItems, setGridItems] = useState(ensureChildrenList(children));
8623
+ const [lastElement, setLastElement] = useState(null);
8624
+ useEffect(() => {
8625
+ setGridItems(ensureChildrenList(children));
8626
+ }, [children]);
8627
+ const fetchData = useCallback(nextPage => __awaiter(void 0, void 0, void 0, function* () {
8628
+ setIsLoading(true);
8629
+ try {
8630
+ const newItems = yield loadMoreData(nextPage);
8631
+ if (newItems && newItems.length > 0) {
8632
+ setGridItems(prevItems => [...prevItems, ...newItems]);
8633
+ } else {
8634
+ setIsDone(true);
8635
+ }
8636
+ } catch (error) {
8637
+ if (onError) {
8638
+ onError(error);
8639
+ }
8640
+ } finally {
8641
+ setIsLoading(false);
8642
+ }
8643
+ }), [loadMoreData, onError]);
8644
+ const observer = useRef(new IntersectionObserver(entries => {
8645
+ const first = entries[0];
8646
+ if (first.isIntersecting) {
8647
+ setPage(prevNum => prevNum + 1);
8648
+ }
8649
+ }));
8650
+ useEffect(() => {
8651
+ if (loadMoreData && !isDone && page) {
8652
+ fetchData(page);
8653
+ }
8654
+ }, [page, loadMoreData, isDone]);
8655
+ useEffect(() => {
8656
+ const currentElement = lastElement;
8657
+ const currentObserver = observer.current;
8658
+ if (currentElement) {
8659
+ currentObserver.observe(currentElement);
8660
+ }
8661
+ return () => {
8662
+ if (currentElement) {
8663
+ currentObserver.unobserve(currentElement);
8664
+ }
8665
+ };
8666
+ }, [lastElement]);
8667
+ // Adds the lastElement ref to the last Element of the grid
8668
+ const gridItemsWithLastElement = useMemo(() => [...gridItems.slice(0, -1), jsx("div", {
8669
+ ref: setLastElement,
8670
+ children: gridItems[gridItems.length - 1]
8671
+ }, "last-grid-item")], [gridItems]);
8672
+ return jsx(StyledGrid, Object.assign({}, gridArgs, {
8673
+ isLoading: isLoading,
8674
+ children: gridItemsWithLastElement
8675
+ }));
8542
8676
  };
8543
8677
 
8544
8678
  const breakpointsGetter = (value, theme, breakpoint) => {
@@ -14804,7 +14938,8 @@ const stepListClassName = 'dot-stepper-list';
14804
14938
  const contentClassName = 'dot-stepper-content';
14805
14939
  const StyledStepper = styled.div`
14806
14940
  ${({
14807
- theme
14941
+ theme,
14942
+ offset
14808
14943
  }) => css`
14809
14944
  &.${rootClassName$p} {
14810
14945
  display: flex;
@@ -14820,22 +14955,25 @@ const StyledStepper = styled.div`
14820
14955
  flex-direction: row-reverse;
14821
14956
  }
14822
14957
 
14823
- .MuiStepConnector-root .MuiStepConnector-line {
14824
- border-left: 1px solid ${theme.palette.figma.border.default};
14958
+ &.bottom {
14959
+ flex-direction: column;
14825
14960
  }
14826
14961
 
14827
- .${stepListClassName} {
14828
- padding: ${theme.spacing(3)};
14962
+ &.top {
14963
+ flex-direction: column-reverse;
14964
+ }
14829
14965
 
14830
- &.MuiStepper-horizontal {
14831
- padding: 0;
14832
- display: flex;
14833
- flex-direction: column;
14966
+ .MuiStepConnector-root {
14967
+ .MuiStepConnector-line {
14968
+ border-left: 1px solid ${theme.palette.figma.border.default};
14834
14969
  }
14970
+ &.MuiStepConnector-vertical {
14971
+ display: none;
14972
+ }
14973
+ }
14835
14974
 
14975
+ .${stepListClassName} {
14836
14976
  .MuiStep-root {
14837
- width: 315px;
14838
-
14839
14977
  .dot-icon {
14840
14978
  display: flex;
14841
14979
  background: ${theme.palette.figma.primary.rippleLight};
@@ -14845,101 +14983,113 @@ const StyledStepper = styled.div`
14845
14983
  width: 28px;
14846
14984
  }
14847
14985
 
14848
- .MuiStepContent-root {
14849
- border-left: 1px solid ${theme.palette.figma.border.default};
14986
+ .MuiStepLabel-root {
14987
+ padding: 0px;
14988
+ gap: 8px;
14850
14989
  }
14851
14990
 
14852
- &.MuiStep-horizontal {
14853
- padding: ${theme.spacing(1)};
14991
+ &:hover {
14992
+ cursor: pointer;
14993
+ }
14994
+
14995
+ .MuiStepLabel-labelContainer {
14996
+ overflow: hidden;
14997
+ min-width: 0;
14854
14998
 
14855
- .dot-avatar i:before {
14856
- color: ${theme.palette.figma.icon.disabled};
14857
- }
14858
- .dot-avatar,
14859
- .dot-icon {
14860
- background: ${theme.palette.figma.neutral.active};
14861
- }
14862
14999
  .dot-typography {
14863
- color: ${theme.palette.figma.typography.disabled};
14864
- }
14865
- .horizontal-step-description {
14866
- color: ${theme.palette.figma.typography.gray};
15000
+ white-space: nowrap;
14867
15001
  }
15002
+ }
14868
15003
 
14869
- &:hover {
14870
- cursor: pointer;
14871
- }
15004
+ .MuiStepContent-root {
15005
+ border-left-color: transparent;
15006
+ }
15007
+
15008
+ &.MuiStep-horizontal {
15009
+ padding: ${theme.spacing(3)};
14872
15010
 
14873
- &.completed {
15011
+ &.active:not(&.completed):not(&.in-progress) {
14874
15012
  .dot-avatar i:before {
14875
- color: ${theme.palette.figma.overlay.alerts.success.icon};
15013
+ color: ${theme.palette.figma.icon.black};
14876
15014
  }
14877
- .dot-avatar,
14878
- .dot-icon {
14879
- background: ${theme.palette.figma.overlay.alerts.success.background};
15015
+ }
15016
+
15017
+ &.active {
15018
+ .dot-typography {
15019
+ color: ${theme.palette.figma.primary.normal};
14880
15020
  }
14881
15021
  }
15022
+ }
15023
+
15024
+ &.MuiStep-vertical {
15025
+ width: 315px;
15026
+ padding: 8px 4px 8px 16px;
14882
15027
 
14883
15028
  &.active {
14884
15029
  background: ${theme.palette.figma.border.darker};
14885
15030
  }
14886
15031
 
14887
- &.error {
14888
- .dot-avatar i:before {
14889
- color: ${theme.palette.figma.overlay.alerts.error.icon};
14890
- }
14891
- .dot-avatar,
14892
- .dot-icon {
14893
- background: ${theme.palette.figma.overlay.alerts.error.background};
14894
- }
15032
+ .MuiStepConnector-root {
15033
+ display: none;
14895
15034
  }
14896
15035
 
14897
- &.in-progress {
14898
- .dot-avatar i:before {
14899
- color: ${theme.palette.figma.primary.active};
14900
- }
15036
+ .MuiStepLabel-root {
15037
+ width: 90%;
15038
+ }
15039
+
15040
+ .dot-typography {
15041
+ white-space: nowrap;
15042
+ overflow: hidden;
15043
+ text-overflow: ellipsis;
14901
15044
  }
14902
15045
  }
14903
15046
 
14904
- &.MuiStep-vertical {
14905
- &.completed {
14906
- .dot-typography,
14907
- .dot-icon {
14908
- color: ${theme.palette.figma.typography.black};
14909
- }
15047
+ &.inactive {
15048
+ .step-label.dot-typography {
15049
+ color: ${theme.palette.figma.typography.gray};
14910
15050
  }
15051
+ }
14911
15052
 
14912
- &.active {
14913
- .dot-icon {
14914
- background: ${theme.palette.figma.primary.active};
14915
- color: ${theme.palette.figma.typography.white};
14916
- }
14917
- .step-label.dot-typography {
14918
- color: ${theme.palette.figma.primary.normal};
14919
- }
14920
- .dot-typography {
14921
- color: ${theme.palette.figma.typography.black};
14922
- }
15053
+ &.active {
15054
+ .dot-typography {
15055
+ color: ${theme.palette.figma.typography.black};
14923
15056
  }
15057
+ }
14924
15058
 
14925
- &.inactive .step-label.dot-typography {
14926
- color: ${theme.palette.figma.typography.gray};
15059
+ .dot-avatar i:before {
15060
+ color: ${theme.palette.figma.icon.disabled};
15061
+ }
15062
+
15063
+ .dot-avatar,
15064
+ .dot-icon {
15065
+ background: ${theme.palette.figma.neutral.active};
15066
+ }
15067
+
15068
+ &.completed {
15069
+ .dot-avatar i:before {
15070
+ color: ${theme.palette.figma.overlay.alerts.success.icon};
14927
15071
  }
15072
+ }
14928
15073
 
14929
- &.error {
14930
- .dot-typography {
14931
- color: ${theme.palette.figma.destructive.normal};
14932
- }
15074
+ &.error {
15075
+ .dot-avatar i:before {
15076
+ color: ${theme.palette.figma.overlay.alerts.error.icon};
15077
+ }
15078
+ .dot-typography {
15079
+ color: ${theme.palette.figma.destructive.normal} !important;
15080
+ }
15081
+ }
14933
15082
 
14934
- .dot-icon {
14935
- background: ${theme.palette.figma.background.level0.bckgWhite};
14936
- border: 1px solid ${theme.palette.figma.destructive.normal};
14937
- color: ${theme.palette.figma.destructive.normal};
14938
- }
15083
+ &.in-progress {
15084
+ .dot-avatar i:before {
15085
+ color: ${theme.palette.figma.primary.active};
14939
15086
  }
14940
15087
  }
14941
15088
 
14942
15089
  &.disabled {
15090
+ &:hover {
15091
+ cursor: default;
15092
+ }
14943
15093
  .dot-icon {
14944
15094
  color: ${theme.palette.figma.primary.light};
14945
15095
  }
@@ -14947,16 +15097,28 @@ const StyledStepper = styled.div`
14947
15097
  color: ${theme.palette.figma.typography.disabled};
14948
15098
  }
14949
15099
  }
14950
-
14951
- &:last-of-type .MuiStepContent-root {
14952
- border-left-color: transparent;
14953
- }
14954
15100
  }
14955
15101
  }
14956
15102
 
14957
15103
  .${contentClassName} {
14958
15104
  width: 100%;
14959
15105
 
15106
+ .left {
15107
+ border: 0;
15108
+ }
15109
+ .right {
15110
+ border: 0;
15111
+ }
15112
+
15113
+ .bottom {
15114
+ height: ${`calc(100vh - ${offset}px)`};
15115
+ border: 0;
15116
+ }
15117
+ .top {
15118
+ height: ${`calc(100vh - ${offset}px)`};
15119
+ border: 0;
15120
+ }
15121
+
14960
15122
  .step-content-container {
14961
15123
  padding: ${theme.spacing(3, 3, 2, 3)};
14962
15124
  }
@@ -14969,15 +15131,24 @@ const ScrollbarContainer = styled.div`
14969
15131
  theme,
14970
15132
  offset
14971
15133
  }) => css`
14972
- height: ${`calc(100vh - ${offset}px)`};
14973
15134
  overflow-y: auto;
14974
15135
 
14975
15136
  &.left {
15137
+ height: ${`calc(100vh - ${offset}px)`};
14976
15138
  border-right: 1px solid ${theme.palette.figma.border.default};
14977
15139
  }
14978
15140
  &.right {
15141
+ height: ${`calc(100vh - ${offset}px)`};
14979
15142
  border-left: 1px solid ${theme.palette.figma.border.default};
14980
15143
  }
15144
+ &.bottom {
15145
+ width: 100%;
15146
+ border-bottom: 1px solid ${theme.palette.figma.border.default};
15147
+ }
15148
+ &.top {
15149
+ width: 100%;
15150
+ border-top: 1px solid ${theme.palette.figma.border.default};
15151
+ }
14981
15152
  &.center-content {
14982
15153
  display: flex;
14983
15154
  flex-direction: column;
@@ -14991,13 +15162,8 @@ const StepContentWrapper = styled.div`
14991
15162
  flex: 1;
14992
15163
  display: flex;
14993
15164
  justify-content: center;
14994
- `;
14995
- const StepDescription = styled(DotTypography)`
14996
- ${({
14997
- theme
14998
- }) => css`
14999
- margin-bottom: ${theme.spacing(6)};
15000
- `}
15165
+ width: 100%;
15166
+ height: 100%;
15001
15167
  `;
15002
15168
  const StepActionsContainer = styled.div`
15003
15169
  ${({
@@ -15071,32 +15237,47 @@ const DotStepper = ({
15071
15237
  submitButtonText = 'Complete'
15072
15238
  }) => {
15073
15239
  const [currentStep, setActiveStep] = useState(activeStep);
15240
+ const [stepperOffset, setStepperOffset] = useState(activeStep);
15074
15241
  const [isStickyBottom, setIsStickyBottom] = useState(false);
15075
15242
  const actionsRef = useRef(null);
15076
15243
  const stepperContentRef = useRef(null);
15077
- const isHorizontal = orientation === 'horizontal';
15244
+ const stepperRef = useRef(null);
15078
15245
  const displayInitialContent = initialContent && currentStep === 0;
15079
15246
  const displayFinalContent = finalContent && currentStep > steps.length;
15080
15247
  const displayCancelButton = !!(!displayInitialContent && !displayFinalContent && onCancel);
15081
15248
  const isLastStep = currentStep === steps.length && !finalContent || currentStep > steps.length && finalContent;
15082
- const rootClasses = useStylesWithRootClass(rootClassName$p, stepsPosition, className);
15249
+ const getStepsPosition = () => {
15250
+ if (orientation === 'horizontal') {
15251
+ return ['top', 'bottom'].includes(stepsPosition) ? stepsPosition : 'bottom';
15252
+ } else {
15253
+ return ['left', 'right'].includes(stepsPosition) ? stepsPosition : 'left';
15254
+ }
15255
+ };
15256
+ const rootClasses = useStylesWithRootClass(rootClassName$p, getStepsPosition(), className);
15083
15257
  const stepContentClasses = displayInitialContent || displayFinalContent ? 'center-content' : '';
15084
15258
  const stickyBottomClasses = useStylesWithRootClass('actions-container', isStickyBottom ? 'with-top-border' : '');
15085
15259
  const actionsClasses = useStylesWithRootClass('actions', displayInitialContent || displayFinalContent ? 'center-actions' : '');
15086
15260
  useEffect(() => {
15087
15261
  const actionsElement = actionsRef.current;
15088
15262
  const stepperContentElement = stepperContentRef.current;
15089
- let observer;
15263
+ let intersectionObserver;
15090
15264
  if (actionsElement && stepperContentElement) {
15091
- observer = new IntersectionObserver(([e]) => setIsStickyBottom(e.intersectionRatio < 1), {
15265
+ intersectionObserver = new IntersectionObserver(([e]) => setIsStickyBottom(e.intersectionRatio < 1), {
15092
15266
  root: stepperContentElement,
15093
15267
  rootMargin: '0px 0px -1px 0px',
15094
15268
  threshold: [1]
15095
15269
  });
15096
- observer.observe(actionsElement);
15270
+ intersectionObserver.observe(actionsElement);
15271
+ }
15272
+ const stepperContent = stepperRef.current;
15273
+ let resizeObserver;
15274
+ if (stepperContent) {
15275
+ resizeObserver = new ResizeObserver(([e]) => setStepperOffset(e.contentRect.height));
15276
+ resizeObserver.observe(stepperContent);
15097
15277
  }
15098
15278
  return () => {
15099
- actionsElement && observer.unobserve(actionsElement);
15279
+ actionsElement && intersectionObserver.unobserve(actionsElement);
15280
+ stepperContent && resizeObserver.unobserve(stepperContent);
15100
15281
  };
15101
15282
  }, []);
15102
15283
  useEffect(() => {
@@ -15121,23 +15302,21 @@ const DotStepper = ({
15121
15302
  if (displayFinalContent) return finalContent;
15122
15303
  return (_a = steps.find(step => step.id === id)) === null || _a === void 0 ? void 0 : _a.content;
15123
15304
  };
15124
- const getStepIcon = (iconId, completed, error) => {
15305
+ const getStepIcon = (iconId, completed, error, isActive) => {
15125
15306
  let stepIcon;
15126
15307
  if (completed) {
15127
- stepIcon = isHorizontal ? 'check-solid' : 'check-line';
15308
+ stepIcon = 'check-solid';
15128
15309
  } else if (error) {
15129
15310
  stepIcon = 'error-solid';
15130
- } else if (iconId) {
15311
+ } else if (isActive) {
15131
15312
  stepIcon = iconId;
15132
15313
  } else {
15133
- stepIcon = isHorizontal ? 'circle' : 'edit';
15314
+ stepIcon = 'circle';
15134
15315
  }
15135
- return isHorizontal ? jsx(DotAvatar, {
15316
+ return jsx(DotAvatar, {
15136
15317
  alt: iconId || stepIcon,
15137
15318
  iconId: stepIcon,
15138
15319
  type: "icon"
15139
- }) : jsx(DotIcon, {
15140
- iconId: stepIcon
15141
15320
  });
15142
15321
  };
15143
15322
  const navigateToStep = id => {
@@ -15173,7 +15352,7 @@ const DotStepper = ({
15173
15352
  ref: stepperContentRef,
15174
15353
  children: jsxs(ScrollbarContainer, {
15175
15354
  offset: offset,
15176
- className: stepContentClasses,
15355
+ className: `${stepContentClasses} ${getStepsPosition()}`,
15177
15356
  children: [jsx(CssGrid, {
15178
15357
  className: "step-content-container",
15179
15358
  children: jsx(CssCell, Object.assign({}, defaultCellProps, {
@@ -15219,58 +15398,69 @@ const DotStepper = ({
15219
15398
  })
15220
15399
  });
15221
15400
  };
15401
+ const memoizedSteps = useMemo(() => {
15402
+ return steps.map((step, index) => {
15403
+ const isActive = currentStep === step.id;
15404
+ // Memoize step classes
15405
+ const stepClasses = [step.className, isActive ? 'active' : 'inactive', step.completed ? 'completed' : '', step.disabled ? 'disabled' : '', step.error ? 'error' : '', step.inProgress ? 'in-progress' : ''].join(' ').trim();
15406
+ // Memoize step description
15407
+ const getContent = isString$2(step.description) ? step.description : null;
15408
+ // Memoize step icon
15409
+ const icon = getStepIcon(step.iconId, step.completed, step.error, isActive);
15410
+ return {
15411
+ step,
15412
+ index,
15413
+ isActive,
15414
+ stepClasses,
15415
+ getContent,
15416
+ icon
15417
+ };
15418
+ });
15419
+ }, [steps, currentStep]);
15222
15420
  return jsxs(StyledStepper, {
15223
15421
  className: rootClasses,
15422
+ offset: stepperOffset + offset,
15224
15423
  children: [jsx(ScrollbarContainer, {
15225
- className: stepsPosition,
15424
+ className: getStepsPosition(),
15226
15425
  offset: offset,
15227
15426
  tabIndex: 0,
15427
+ ref: stepperRef,
15228
15428
  children: jsx(Stepper, {
15229
15429
  activeStep: currentStep,
15230
15430
  "aria-label": ariaLabel,
15231
15431
  className: stepListClassName,
15232
15432
  "data-testid": dataTestId,
15233
15433
  orientation: orientation,
15234
- children: steps.map((step, index) => {
15235
- const isActive = currentStep === step.id;
15236
- // TODO: use useStylesWithRootClass here
15237
- const stepClasses = () => {
15238
- return [step.className, isActive ? 'active' : 'inactive', step.completed ? 'completed' : '', step.disabled ? 'disabled' : '', step.error ? 'error' : '', step.inProgress ? 'in-progress' : ''].concat().join(' ').trim();
15239
- };
15240
- const getContent = () => {
15241
- return isString$2(step.description) ? jsx(StepDescription, {
15242
- variant: "body2",
15243
- children: step.description
15244
- }) : step.description;
15245
- };
15246
- const getHorizontalDescription = () => {
15247
- return isString$2(step.description) ? jsx(DotTypography, {
15248
- variant: "body2",
15249
- className: "horizontal-step-description",
15250
- children: step.description
15251
- }) : null;
15252
- };
15253
- return jsxs(Step, {
15254
- active: isActive,
15255
- classes: {
15256
- root: stepClasses()
15257
- },
15258
- completed: step.completed,
15259
- disabled: step.disabled,
15260
- expanded: true,
15261
- children: [jsxs(StepLabel, {
15262
- icon: getStepIcon(step.iconId, step.completed, step.error),
15434
+ children: memoizedSteps.map(({
15435
+ step,
15436
+ index,
15437
+ isActive,
15438
+ stepClasses,
15439
+ getContent,
15440
+ icon
15441
+ }) => jsx(Step, {
15442
+ active: isActive,
15443
+ classes: {
15444
+ root: stepClasses
15445
+ },
15446
+ completed: step.completed,
15447
+ disabled: step.disabled,
15448
+ children: jsx(DotTooltip, {
15449
+ title: getContent,
15450
+ children: jsxs(StepLabel, {
15451
+ icon: icon,
15263
15452
  onClick: () => navigateToStep(step.id),
15264
15453
  children: [jsx(DotTypography, {
15265
15454
  className: "step-label",
15266
- variant: isHorizontal ? 'body1' : 'subtitle1',
15455
+ variant: orientation === 'horizontal' ? 'subtitle1' : 'body1',
15267
15456
  children: step.label
15268
- }), orientation === 'horizontal' && getHorizontalDescription()]
15269
- }), orientation === 'vertical' && jsx(StepContent, {
15270
- children: getContent()
15271
- })]
15272
- }, index);
15273
- })
15457
+ }), orientation === 'vertical' && jsx(DotTypography, {
15458
+ variant: "body2",
15459
+ children: getContent
15460
+ })]
15461
+ })
15462
+ })
15463
+ }, index))
15274
15464
  })
15275
15465
  }), jsx(StepContentWrapper, {
15276
15466
  children: renderContent()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "4.5.0",
3
+ "version": "4.7.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, popperZIndex, 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, trimLongOptions, 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>;
@@ -95,9 +95,11 @@ export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOp
95
95
  required?: boolean;
96
96
  /** Determines the padding within the input field 'medium' or 'small' */
97
97
  size?: inputSizeOptions;
98
+ /** If true, longs options won't be wrapped into multiple lines but trimmed with ellipsis and a tooltip */
99
+ trimLongOptions?: boolean;
98
100
  /** value if this is a controlled component */
99
101
  value?: AutoCompleteValue;
100
102
  /** If true, the label will be displayed in a warning state. */
101
103
  warning?: boolean;
102
104
  }
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;
105
+ 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, trimLongOptions, value, warning, }: AutoCompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { AutocompleteGetTagProps } from '@mui/material';
2
2
  import { ChipSize } from '../../chip/Chip';
3
3
  import { AutoCompleteOption, AutoCompleteValue } from './interface';
4
+ import { inputSizeOptions } from '../../input-form-fields/InputFormFields.propTypes';
4
5
  export declare const parseAutoCompleteValue: (value: AutoCompleteValue) => string;
5
6
  export interface GetChipsFromAutocompleteProps {
6
7
  chipSize?: ChipSize;
@@ -11,3 +12,8 @@ export interface GetChipsFromAutocompleteProps {
11
12
  export declare const getChipsFromAutocomplete: ({ chipSize, getTagProps, isReadOnly, values, }: GetChipsFromAutocompleteProps) => import("react/jsx-runtime").JSX.Element[];
12
13
  export declare const checkIfDuplicateItem: (itemText: string, autocompleteOptions: AutoCompleteOption[]) => boolean;
13
14
  export declare const isEmptyValue: (value: AutoCompleteValue) => boolean;
15
+ export declare const getRootClassNames: (className: string, size: inputSizeOptions) => string;
16
+ export declare const getTextFieldRootClassNames: (textFieldWarningClassName: string, isReadOnly: boolean) => string;
17
+ export declare const getInputRootClassNames: (isDense: boolean) => string;
18
+ export declare const getDefaultAutoCompleteValue: (hasMultiple: boolean, defaultValue: AutoCompleteValue) => string | AutoCompleteOption | AutoCompleteValue[];
19
+ export declare const getAutoCompleteGroupBy: (group: boolean) => (option: AutoCompleteOption) => string;
@@ -23,6 +23,10 @@ export interface CssGridProps extends CommonProps {
23
23
  gridTemplateAreas?: string;
24
24
  /** Height of the grid */
25
25
  height?: string;
26
+ /** Function called to load more items when the end of the grid is reached. Should return an array of ReactNodes. */
27
+ loadMoreData?: (page: number) => Promise<ReactNode[]>;
28
+ /** Error handler function for handling any errors that might come from the loadMoreData function */
29
+ onError?: (error: Error) => void;
26
30
  /** Row, overrides columnsBreakpoints */
27
31
  rowGap?: GridOptions;
28
32
  /** Row, configuration */
@@ -30,9 +34,13 @@ export interface CssGridProps extends CommonProps {
30
34
  /** Width of the grid */
31
35
  width?: string;
32
36
  }
37
+ interface InternalGridProps extends CssGridProps {
38
+ isLoading: boolean;
39
+ }
33
40
  export declare const rootClassName = "dot-grid";
34
41
  export declare const defaultGutter: GridOptions;
35
42
  export declare const defaultColumns: GridOptions;
36
- export declare const Grid: ({ className, children }: CssGridProps) => import("react/jsx-runtime").JSX.Element;
37
- export declare const StyledGrid: import("styled-components").StyledComponent<({ className, children }: CssGridProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
38
- export declare const CssGrid: (props: CssGridProps) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const Grid: ({ className, children, isLoading }: InternalGridProps) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const StyledGrid: import("styled-components").StyledComponent<({ className, children, isLoading }: InternalGridProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
45
+ export declare const CssGrid: ({ children, loadMoreData, onError, ...gridArgs }: CssGridProps) => import("react/jsx-runtime").JSX.Element;
46
+ export {};
@@ -3,7 +3,7 @@ import { CommonProps } from '../CommonProps';
3
3
  import { CssCellProps } from '../css-grid/CssCell';
4
4
  export declare const defaultCellProps: CssCellProps;
5
5
  export type StepperOrientation = 'horizontal' | 'vertical';
6
- export type StepsPosition = 'left' | 'right';
6
+ export type StepsPosition = 'top' | 'bottom' | 'left' | 'right';
7
7
  export interface StepProps extends CommonProps {
8
8
  /** if set to `true` the step will display a checkmark icon */
9
9
  completed?: boolean;
@@ -57,6 +57,7 @@ export interface StepperProps extends CommonProps {
57
57
  /** array of steps to be displayed */
58
58
  steps: StepProps[];
59
59
  /** determines where to display the array of steps */
60
+ /** top/bottom are for horizontal orientation (bottom by default) & left/right for vertical orientation (left by default) */
60
61
  stepsPosition?: StepsPosition;
61
62
  /** if passed, will overwrite the default "submit" button text */
62
63
  submitButtonText?: string;
@@ -4,12 +4,11 @@ export declare const contentClassName = "dot-stepper-content";
4
4
  interface StyledStepActionsContainerProps {
5
5
  displayCancelButton?: boolean;
6
6
  }
7
- export declare const StyledStepper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
7
  interface StyledScrollbarContainerProps {
9
8
  offset?: number;
10
9
  }
10
+ export declare const StyledStepper: import("styled-components").StyledComponent<"div", any, StyledScrollbarContainerProps, never>;
11
11
  export declare const ScrollbarContainer: import("styled-components").StyledComponent<"div", any, StyledScrollbarContainerProps, never>;
12
12
  export declare const StepContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
13
- export declare const StepDescription: 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>;
14
13
  export declare const StepActionsContainer: import("styled-components").StyledComponent<"div", any, StyledStepActionsContainerProps, never>;
15
14
  export {};