@digital-ai/dot-components 5.1.0 → 5.2.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
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { useEffect, useState, useRef, createContext, useMemo, useContext, forwardRef, useCallback, createElement, Fragment as Fragment$1, useLayoutEffect } from 'react';
4
4
  import { Typography, Fade, StyledEngineProvider, Tooltip, InputAdornment, InputLabel, TextField, Icon, Accordion, AccordionSummary, AccordionDetails, AccordionActions, Toolbar, 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, Stack } from '@mui/material';
5
+ import styled, { css, createGlobalStyle, ThemeProvider as ThemeProvider$1, keyframes } from 'styled-components';
5
6
  import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';
6
- import styled, { createGlobalStyle, ThemeProvider as ThemeProvider$1, css, keyframes } from 'styled-components';
7
7
  import '@digital-ai/dot-icons';
8
8
  import jwt_decode from 'jwt-decode';
9
9
  import '@digital-ai/dot-illustrations';
@@ -42,7 +42,26 @@ const checkIfOverflowPresentInElementTree = element => {
42
42
  return false;
43
43
  };
44
44
 
45
+ const rootClassName$1r = 'dot-typography';
46
+ const StyledTypography = styled(Typography)`
47
+ ${({
48
+ theme
49
+ }) => css`
50
+ &.${rootClassName$1r} {
51
+ &.dot-typography-ai {
52
+ background: ${theme.palette.figma.gradient.ai};
53
+ background-clip: text;
54
+ -webkit-background-clip: text;
55
+ color: transparent;
56
+ -webkit-text-fill-color: transparent;
57
+ width: fit-content;
58
+ }
59
+ }
60
+ `}
61
+ `;
62
+
45
63
  const DotTypography = ({
64
+ ai,
46
65
  ariaLabel,
47
66
  ariaLevel,
48
67
  ariaRole,
@@ -54,7 +73,7 @@ const DotTypography = ({
54
73
  noWrap,
55
74
  variant
56
75
  }) => {
57
- const rootClasses = useStylesWithRootClass('dot-typography', className);
76
+ const rootClasses = useStylesWithRootClass(rootClassName$1r, ai ? 'dot-typography-ai' : '', className);
58
77
  useEffect(() => {
59
78
  if (ariaRole === 'heading' && !ariaLevel) {
60
79
  console.warn('please include ariaLevel when using ariaRole="heading"');
@@ -63,7 +82,7 @@ const DotTypography = ({
63
82
  console.warn('DEPRECATED: `noMarginBottom` on `DotTypography` is no longer included');
64
83
  }
65
84
  }, []);
66
- return jsx(Typography, {
85
+ return jsx(StyledTypography, {
67
86
  "aria-label": ariaLabel,
68
87
  "aria-level": ariaLevel,
69
88
  classes: {
@@ -2679,12 +2698,13 @@ const StyledAvatar = styled(Avatar)`
2679
2698
  height: 105%;
2680
2699
  }
2681
2700
 
2682
- .dot-i,
2683
- .dot-typography {
2701
+ .dot-typography:not(.dot-typography-ai),
2702
+ .dot-icon:not(.dot-icon-ai) .dot-i {
2684
2703
  color: ${({
2685
- color
2704
+ color,
2705
+ style
2686
2706
  }) => {
2687
- return color ? theme.palette.avatarColors[color].color : theme.palette.avatarColors['default'].color;
2707
+ return (style === null || style === void 0 ? void 0 : style.color) !== undefined ? style.color : color ? theme.palette.avatarColors[color].color : theme.palette.avatarColors['default'].color;
2688
2708
  }};
2689
2709
  margin-bottom: 0;
2690
2710
  }
@@ -2708,6 +2728,7 @@ const StyledAvatar = styled(Avatar)`
2708
2728
  `;
2709
2729
 
2710
2730
  const AvatarContent = ({
2731
+ ai,
2711
2732
  'data-testid': dataTestId,
2712
2733
  iconId,
2713
2734
  imageSrc,
@@ -2739,6 +2760,7 @@ const AvatarContent = ({
2739
2760
  const getIconFontSizeFromAvatarSize = () => size === 'small' ? size : 'medium';
2740
2761
  if (type === 'icon' || type === 'image' && !imageSrc) {
2741
2762
  return jsx(DotIcon, {
2763
+ ai: ai,
2742
2764
  "data-testid": `${dataTestId}-icon`,
2743
2765
  fontSize: getIconFontSizeFromAvatarSize(),
2744
2766
  iconId: iconId || 'user'
@@ -2746,6 +2768,7 @@ const AvatarContent = ({
2746
2768
  }
2747
2769
  if (type === 'text') {
2748
2770
  return jsx(DotTypography, {
2771
+ ai: ai,
2749
2772
  variant: size === 'small' ? 'caption' : getHeadingFromAvatarSize(),
2750
2773
  children: parsedNumber() || parsedText()
2751
2774
  });
@@ -2753,6 +2776,7 @@ const AvatarContent = ({
2753
2776
  return null;
2754
2777
  };
2755
2778
  const DotAvatar = ({
2779
+ ai = false,
2756
2780
  alt,
2757
2781
  ariaLabel,
2758
2782
  ariaRole = 'img',
@@ -2802,6 +2826,7 @@ const DotAvatar = ({
2802
2826
  tabIndex: tooltip ? tabIndex : undefined,
2803
2827
  variant: variant,
2804
2828
  children: jsx(AvatarContent, {
2829
+ ai: ai,
2805
2830
  "data-testid": dataTestId,
2806
2831
  iconId: iconId,
2807
2832
  imageSrc: imageSrc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -1,5 +1,5 @@
1
1
  export declare const dashboardCategoriesContainerClassName = "dashboard-categories-container";
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>;
2
+ export declare const InlineMessage: import("styled-components").StyledComponent<({ ai, 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
5
  export declare const StyledAppSelectDotAutoComplete: import("styled-components").StyledComponent<(<T extends import("../..").AutoCompleteOption>({ ListboxComponent, additionalLabelContent, actionItem, ai, aiAction, ariaLabel, autoFocus, autoHighlight, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, defaultValue, dense, disableCloseOnSelect, 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>;
@@ -5,6 +5,8 @@ export type AvatarType = 'image' | 'text' | 'icon';
5
5
  export type AvatarVariant = 'circular' | 'square';
6
6
  export type AvatarColor = 'default' | 'inherit' | 'green' | 'blue' | 'orange' | 'purple' | 'yellow' | 'red' | 'darkGrey' | 'lightGrey' | 'transparent' | 'white';
7
7
  export interface AvatarProps extends CommonProps {
8
+ /** Apply gradient color to inner content (icon / typography) */
9
+ ai?: boolean;
8
10
  /** Text displayed on hover */
9
11
  alt: string;
10
12
  /** Color for avatar */
@@ -36,4 +38,4 @@ export interface AvatarProps extends CommonProps {
36
38
  /** The shape of the avatar */
37
39
  variant?: AvatarVariant;
38
40
  }
39
- export declare const DotAvatar: ({ alt, ariaLabel, ariaRole, className, component, disableInteractive, color, "data-testid": dataTestId, iconId, imageSrc, onClick, number, size, tabIndex, text, type, tooltip, variant, style, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const DotAvatar: ({ ai, alt, ariaLabel, ariaRole, className, component, disableInteractive, color, "data-testid": dataTestId, iconId, imageSrc, onClick, number, size, tabIndex, text, type, tooltip, variant, style, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,8 @@ import { ElementType, ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
3
  export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'button' | 'overline' | 'inherit';
4
4
  export interface TypographyProps extends CommonProps {
5
+ /** If true, applies a gradient color */
6
+ ai?: boolean;
5
7
  /** When `ariaRole` is `heading` then set a level */
6
8
  ariaLevel?: number;
7
9
  /** The content of the component. */
@@ -15,4 +17,4 @@ export interface TypographyProps extends CommonProps {
15
17
  /** Applies the theme typography styles. */
16
18
  variant?: TypographyVariant;
17
19
  }
18
- export declare const DotTypography: ({ ariaLabel, ariaLevel, ariaRole, className, "data-testid": dataTestId, children, component, noMarginBottom, noWrap, variant, }: TypographyProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const DotTypography: ({ ai, ariaLabel, ariaLevel, ariaRole, className, "data-testid": dataTestId, children, component, noMarginBottom, noWrap, variant, }: TypographyProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TypographyProps } from '@mui/material/Typography';
2
+ export declare const rootClassName = "dot-typography";
3
+ export declare const StyledTypography: import("styled-components").StyledComponent<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").TypographyTypeMap<{}, "span">>, any, TypographyProps, never>;