@digital-ai/dot-components 4.19.2 → 4.20.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
@@ -185,23 +185,58 @@ const yA400 = '#ffe2a4';
185
185
  const yA700 = '#ffda8b';
186
186
  //Purple
187
187
  //https://zeroheight.com/4a9ac476a/p/22005a-color/t/48416f
188
- const p50 = '#f3e4ee';
189
- const p100 = '#e0bbd4';
190
- const p200 = '#cc8eb8';
191
- const p300 = '#b8609c';
192
- const p400 = '#a83e86';
193
- const p500 = '#991c71';
194
- const p600 = '#911969';
195
- const p700 = '#86145e';
196
- const p800 = '#7c1154';
197
- const p900 = '#6b0942';
188
+ const p50 = '#f5e9fb';
189
+ const p100 = '#ebd4f7';
190
+ const p200 = '#d7aaee';
191
+ const p300 = '#c37fe6';
192
+ const p400 = '#af54de';
193
+ const p500 = '#9e2fd7';
194
+ const p600 = '#7c21ab';
195
+ const p700 = '#5d1980';
196
+ const p800 = '#3e1155';
197
+ const p900 = '#2e0c40';
198
198
  const pA100 = '#ff9cd1';
199
199
  const pA200 = '#ff69b9';
200
200
  const pA400 = '#ff36a2';
201
201
  const pA700 = '#ff1d96';
202
+ //Pink
203
+ //https://zeroheight.com/4a9ac476a/p/22005a-color/t/a49f524b62
204
+ const pi50 = '#fce9f6';
205
+ const pi100 = '#f8d3ee';
206
+ const pi200 = '#f1a7dc';
207
+ const pi300 = '#eb7acb';
208
+ const pi400 = '#e44eb9';
209
+ const pi500 = '#dd22a8';
210
+ const pi600 = '#b11b86';
211
+ const pi700 = '#851465';
212
+ const pi800 = '#580e43';
213
+ const pi900 = '#2c0722';
214
+ //Violet
215
+ const v50 = '#ede8fd';
216
+ const v100 = '#dbd1fa';
217
+ const v200 = '#b6a3f5';
218
+ const v300 = '#9275f0';
219
+ const v400 = '#704aec';
220
+ const v500 = '#4c1de7';
221
+ const v600 = '#3a13b9';
222
+ const v700 = '#2c0f8a';
223
+ const v800 = '#1d0a5c';
224
+ const v900 = '#0f052e';
202
225
  const selectedGray = 'rgba(0, 0, 0, 0.12)';
203
226
  const lightSelectedGray = 'rgba(0, 0, 0, 0.08)';
204
227
  const hoverGray = 'rgba(0, 0, 0, 0.04)';
228
+ // AI gradient for dark theme
229
+ const aiNormalDark = `linear-gradient(134deg, ${pi200} 18.22%, ${p200} 68.6%, ${v200} 118.99%)`;
230
+ const aiActiveDark = `linear-gradient(134deg, ${pi200} 18.22%, ${p200} 68.6%, ${v200} 118.99%)`;
231
+ const aiElevatedDark = `linear-gradient(134deg, ${pi50} 18.22%, ${p200} 68.6%, ${v200} 118.99%)`;
232
+ const aiLightDark = `linear-gradient(134deg, ${pi700} 18.22%, ${p700} 68.6%, ${v700} 118.99%)`;
233
+ const aiAutoCompleteBorderDark = `linear-gradient(134deg, ${pi200} 18.22%, ${p200} 68.6%, ${pi300} 118.99%)`;
234
+ // AI gradient for light theme
235
+ const aiNormalLight = `linear-gradient(134deg, ${pi500} 18.22%, ${p500} 68.6%, ${v400} 118.99%)`;
236
+ const aiActiveLight = `linear-gradient(134deg, ${pi400} 18.22%, ${p400} 68.6%, ${v400} 118.99%)`;
237
+ const aiElevatedLight = `linear-gradient(134deg, ${pi600} 18.22%, ${p600} 68.6%, ${v600} 118.99%)`;
238
+ const aiLightLight = `linear-gradient(134deg, ${pi50} 18.22%, ${p50} 68.6%, ${v50} 118.99%)`;
239
+ const aiAutoCompleteBorderLight = `linear-gradient(134deg, ${pi500} 18.22%, ${p500} 68.6%, ${pi300} 118.99%)`;
205
240
 
206
241
  var lightThemeColors = /*#__PURE__*/Object.freeze({
207
242
  __proto__: null,
@@ -308,12 +343,50 @@ var lightThemeColors = /*#__PURE__*/Object.freeze({
308
343
  pA200: pA200,
309
344
  pA400: pA400,
310
345
  pA700: pA700,
346
+ pi50: pi50,
347
+ pi100: pi100,
348
+ pi200: pi200,
349
+ pi300: pi300,
350
+ pi400: pi400,
351
+ pi500: pi500,
352
+ pi600: pi600,
353
+ pi700: pi700,
354
+ pi800: pi800,
355
+ pi900: pi900,
356
+ v50: v50,
357
+ v100: v100,
358
+ v200: v200,
359
+ v300: v300,
360
+ v400: v400,
361
+ v500: v500,
362
+ v600: v600,
363
+ v700: v700,
364
+ v800: v800,
365
+ v900: v900,
311
366
  selectedGray: selectedGray,
312
367
  lightSelectedGray: lightSelectedGray,
313
- hoverGray: hoverGray
368
+ hoverGray: hoverGray,
369
+ aiNormalDark: aiNormalDark,
370
+ aiActiveDark: aiActiveDark,
371
+ aiElevatedDark: aiElevatedDark,
372
+ aiLightDark: aiLightDark,
373
+ aiAutoCompleteBorderDark: aiAutoCompleteBorderDark,
374
+ aiNormalLight: aiNormalLight,
375
+ aiActiveLight: aiActiveLight,
376
+ aiElevatedLight: aiElevatedLight,
377
+ aiLightLight: aiLightLight,
378
+ aiAutoCompleteBorderLight: aiAutoCompleteBorderLight
314
379
  });
315
380
 
316
381
  const lightFigmaColors = {
382
+ aiPink: {
383
+ active: pi400,
384
+ elevated: pi600,
385
+ light: pi50,
386
+ normal: pi500,
387
+ ripple: pi300,
388
+ rippleLight: pi200
389
+ },
317
390
  appToolbar: {
318
391
  background: n700,
319
392
  btnHover: n900
@@ -349,6 +422,13 @@ const lightFigmaColors = {
349
422
  disabled: {
350
423
  normal: n50
351
424
  },
425
+ gradient: {
426
+ active: aiActiveLight,
427
+ ai: aiAutoCompleteBorderLight,
428
+ elevated: aiElevatedLight,
429
+ light: aiLightLight,
430
+ normal: aiNormalLight
431
+ },
352
432
  graph: {
353
433
  alert: {
354
434
  error: r500,
@@ -461,6 +541,14 @@ const lightFigmaColors = {
461
541
  }
462
542
  };
463
543
  const darkFigmaColors = {
544
+ aiPink: {
545
+ active: pi200,
546
+ elevated: pi50,
547
+ light: pi700,
548
+ normal: pi200,
549
+ ripple: pi300,
550
+ rippleLight: pi200
551
+ },
464
552
  appToolbar: {
465
553
  background: n700,
466
554
  btnHover: n900
@@ -496,6 +584,13 @@ const darkFigmaColors = {
496
584
  disabled: {
497
585
  normal: n500
498
586
  },
587
+ gradient: {
588
+ active: aiActiveDark,
589
+ ai: aiAutoCompleteBorderDark,
590
+ elevated: aiElevatedDark,
591
+ light: aiLightDark,
592
+ normal: aiNormalDark
593
+ },
499
594
  graph: {
500
595
  alert: {
501
596
  error: r200,
@@ -1299,6 +1394,7 @@ const fieldsetClassName = 'MuiOutlinedInput-notchedOutline';
1299
1394
  const readOnlyClassName$1 = 'read-only';
1300
1395
  const resizerClassName = 'with-resizer';
1301
1396
  const ROW_HEIGHT = 37;
1397
+ const inputAiClassName$1 = 'dot-input-ai';
1302
1398
  const StyledAdornment = styled(InputAdornment)`
1303
1399
  .dot-icon {
1304
1400
  ${adornmentIconStyles()};
@@ -1499,6 +1595,17 @@ const StyledTextField = styled(TextField)`
1499
1595
  }
1500
1596
  }
1501
1597
 
1598
+ &.${inputAiClassName$1} {
1599
+ color: ${theme.palette.figma.typography.white};
1600
+ background: ${theme.palette.figma.gradient.normal};
1601
+ border: 1px solid transparent;
1602
+ border-radius: 4px;
1603
+
1604
+ .MuiOutlinedInput-root .${fieldsetClassName} {
1605
+ border: none;
1606
+ }
1607
+ }
1608
+
1502
1609
  .MuiOutlinedInput-adornedStart {
1503
1610
  padding-left: 12px;
1504
1611
 
@@ -1515,6 +1622,7 @@ const StyledTextField = styled(TextField)`
1515
1622
  `;
1516
1623
 
1517
1624
  const rootClassName$1n = 'dot-icon';
1625
+ const aiIconClassName = 'dot-icon-ai';
1518
1626
  const StyledIcon = styled(Icon)`
1519
1627
  ${({
1520
1628
  theme
@@ -1523,13 +1631,17 @@ const StyledIcon = styled(Icon)`
1523
1631
  color: ${theme.palette.figma.icon.black};
1524
1632
  font-size: 20px;
1525
1633
 
1634
+ i {
1635
+ height: 20px;
1636
+ width: 20px;
1637
+ }
1638
+
1526
1639
  &.MuiIcon-fontSizeLarge {
1527
- font-size: 28px;
1528
- height: 35px;
1529
- width: 35px;
1640
+ font-size: 24px;
1530
1641
 
1531
1642
  i {
1532
- height: 28px;
1643
+ height: 24px;
1644
+ width: 24px;
1533
1645
  }
1534
1646
  }
1535
1647
  &.MuiIcon-fontSizeSmall {
@@ -1537,16 +1649,19 @@ const StyledIcon = styled(Icon)`
1537
1649
 
1538
1650
  i {
1539
1651
  height: 18px;
1652
+ width: 18px;
1540
1653
  }
1541
1654
  }
1542
1655
 
1543
- i {
1544
- height: 20px;
1545
- }
1546
-
1547
1656
  &.${warningClassName} {
1548
1657
  color: ${theme.palette.figma.warning.normal};
1549
1658
  }
1659
+
1660
+ &.${aiIconClassName} {
1661
+ background: ${theme.palette.figma.gradient.normal};
1662
+ color: transparent;
1663
+ -webkit-background-clip: text;
1664
+ }
1550
1665
  }
1551
1666
  `}
1552
1667
  `;
@@ -1559,9 +1674,10 @@ const DotIcon = ({
1559
1674
  disableInteractive,
1560
1675
  fontSize = 'medium',
1561
1676
  iconId,
1562
- tooltip
1677
+ tooltip,
1678
+ ai = false
1563
1679
  }) => {
1564
- const rootClasses = useStylesWithRootClass(rootClassName$1n, className);
1680
+ const rootClasses = useStylesWithRootClass(rootClassName$1n, className, ai ? aiIconClassName : '');
1565
1681
  return jsx(DotTooltip, {
1566
1682
  disableInteractive: disableInteractive,
1567
1683
  childrenDisplayStyle: "inline-block",
@@ -2723,6 +2839,71 @@ const StyledButton = styled(Button)`
2723
2839
  border-color: ${theme.palette.figma.border.defaultButton};
2724
2840
  }
2725
2841
 
2842
+ &.MuiButton-ai {
2843
+ color: ${theme.palette.figma.typography.white};
2844
+ background: ${theme.palette.figma.gradient.normal};
2845
+
2846
+ &:hover {
2847
+ background: ${theme.palette.figma.gradient.elevated};
2848
+ }
2849
+ &:active {
2850
+ background-color: ${theme.palette.figma.gradient.active};
2851
+ }
2852
+ .dot-icon {
2853
+ color: ${theme.palette.figma.icon.white};
2854
+ }
2855
+ &.Mui-disabled {
2856
+ background: ${theme.palette.figma.disabled.normal};
2857
+ border-color: ${theme.palette.figma.border.defaultButton};
2858
+ }
2859
+ }
2860
+
2861
+ &.MuiButton-ai-outlined {
2862
+ color: ${theme.palette.figma.gradient.normal};
2863
+
2864
+ ${theme.name === 'light' && css`
2865
+ background-image: linear-gradient(white, white),
2866
+ ${theme.palette.figma.gradient.normal};
2867
+ border: 2px solid transparent;
2868
+ `}
2869
+ ${theme.name === 'dark' && css`
2870
+ border: 2px solid ${theme.palette.figma.aiPink.active};
2871
+ `}
2872
+
2873
+ background-clip: padding-box, border-box;
2874
+ background-origin: border-box;
2875
+
2876
+ &:hover {
2877
+ ${theme.name === 'light' && css`
2878
+ background-image: linear-gradient(
2879
+ ${theme.palette.figma.aiPink.light},
2880
+ ${theme.palette.figma.aiPink.light}
2881
+ ),
2882
+ ${theme.palette.figma.gradient.normal};
2883
+ border: 2px solid transparent;
2884
+ `}
2885
+ }
2886
+ &:active {
2887
+ background-color: ${theme.palette.figma.neutral.active};
2888
+ }
2889
+
2890
+ .dot-icon {
2891
+ background: ${theme.palette.figma.gradient.normal};
2892
+ background-clip: text;
2893
+ color: transparent;
2894
+ }
2895
+ }
2896
+
2897
+ &.MuiButton-ai-outlined {
2898
+ background-color: ${theme.palette.figma.neutral.normal};
2899
+ color: ${theme.palette.figma.aiPink.normal};
2900
+
2901
+ &.Mui-disabled {
2902
+ background: ${theme.palette.figma.disabled.normal};
2903
+ border-color: ${theme.palette.figma.border.defaultButton};
2904
+ }
2905
+ }
2906
+
2726
2907
  &.MuiButton-text {
2727
2908
  background-color: transparent;
2728
2909
  }
@@ -2802,6 +2983,14 @@ const DotButton = forwardRef(({
2802
2983
  color = 'inherit';
2803
2984
  variant = 'text';
2804
2985
  break;
2986
+ case 'ai':
2987
+ color = 'primary';
2988
+ variant = 'ai';
2989
+ break;
2990
+ case 'ai-outlined':
2991
+ color = 'inherit';
2992
+ variant = 'ai-outlined';
2993
+ break;
2805
2994
  }
2806
2995
  return jsx(DotTooltip, {
2807
2996
  childrenDisplayStyle: "inline-block",
@@ -3694,6 +3883,29 @@ const StyledIconButton = styled(IconButton)`
3694
3883
  ${color === 'default' ? css`
3695
3884
  color: ${theme.palette.figma.icon.black};
3696
3885
  ` : ''}
3886
+
3887
+ &.MuiIconButton-colorAi{
3888
+ color: ${theme.palette.figma.icon.white};
3889
+ background: ${theme.palette.figma.gradient.normal};
3890
+
3891
+ &:hover {
3892
+ background: ${theme.palette.figma.gradient.elevated};
3893
+ }
3894
+ &:active {
3895
+ background-color: ${theme.palette.figma.gradient.ripple};
3896
+ }
3897
+ &:focus {
3898
+ background-color: ${theme.palette.figma.gradient.active};
3899
+ }
3900
+ .dot-icon {
3901
+ color: ${theme.palette.figma.icon.white};
3902
+ }
3903
+ &.Mui-disabled {
3904
+ background: ${theme.palette.figma.disabled.normal};
3905
+ border: 1px solid ${theme.palette.figma.border.defaultButton};
3906
+ }
3907
+ }
3908
+
3697
3909
  font-size: inherit;
3698
3910
  padding: 10px;
3699
3911
 
@@ -3719,11 +3931,15 @@ const StyledIconButton = styled(IconButton)`
3719
3931
 
3720
3932
  &.shape-square {
3721
3933
  border-radius: 4px;
3722
- border: 1px solid ${theme.palette.figma.border.defaultButton};
3723
3934
  padding: ${theme.spacing(1)};
3935
+ ${color !== 'ai' ? css`
3936
+ border: 1px solid ${theme.palette.figma.border.defaultButton};
3937
+ ` : ''}
3724
3938
 
3725
3939
  &:active {
3726
- background: ${theme.palette.figma.toggleTabs.bckg};
3940
+ ${color !== 'ai' ? css`
3941
+ background: ${theme.palette.figma.toggleTabs.bckg};
3942
+ ` : ''}
3727
3943
  }
3728
3944
  }
3729
3945
 
@@ -4667,6 +4883,7 @@ const getInitialState = (value, defaultValue) => ({
4667
4883
  inputValue: value || defaultValue || ''
4668
4884
  });
4669
4885
  const DotInputText = ({
4886
+ ai = false,
4670
4887
  autoComplete = 'off',
4671
4888
  autoFocus,
4672
4889
  className,
@@ -4715,11 +4932,12 @@ const DotInputText = ({
4715
4932
  const hasError = error && errorClassName;
4716
4933
  const hasWarning = !error && warning && warningClassName;
4717
4934
  const hasSuccess = !error && !warning && success && successClassName;
4935
+ const isAiEnabled = ai && inputAiClassName$1;
4718
4936
  const hasEndAdornmentIcon = endIcon || error || hasWarning || hasSuccess;
4719
4937
  const internalInputRef = useRef(null);
4720
4938
  const textFieldInputRef = inputRef || internalInputRef;
4721
4939
  const [inputTextState, setInputTextState] = useState(getInitialState(value));
4722
- const rootStyles = useStylesWithRootClass(rootClassName$1o, hasError, hasWarning, hasSuccess, readOnly && readOnlyClassName$1);
4940
+ const rootStyles = useStylesWithRootClass(rootClassName$1o, hasError, hasWarning, hasSuccess, isAiEnabled, readOnly && readOnlyClassName$1);
4723
4941
  useEffect(() => {
4724
4942
  if (value !== inputTextState.inputValue) {
4725
4943
  setInputTextState(getInitialState(value, defaultValue));
@@ -6699,6 +6917,7 @@ const DotChip = ({
6699
6917
  const rootClassName$Z = 'dot-autocomplete';
6700
6918
  const inputRootClassName = 'dot-input-root';
6701
6919
  const inputMediumClassName = 'dot-input-medium';
6920
+ const inputAiClassName = 'dot-input-ai';
6702
6921
  const StyledAutocomplete = styled(Autocomplete)`
6703
6922
  ${({
6704
6923
  theme
@@ -6737,6 +6956,19 @@ const StyledAutocomplete = styled(Autocomplete)`
6737
6956
  }
6738
6957
  }
6739
6958
  }
6959
+
6960
+ &.${inputAiClassName} {
6961
+ color: ${theme.palette.figma.typography.white};
6962
+ background: ${theme.palette.figma.gradient.ai};
6963
+ border: 2px solid transparent;
6964
+ border-radius: 4px;
6965
+ .MuiOutlinedInput-root {
6966
+ padding: 8px;
6967
+ }
6968
+ .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
6969
+ border: none;
6970
+ }
6971
+ }
6740
6972
  `}
6741
6973
  `;
6742
6974
 
@@ -6809,6 +7041,8 @@ const DEFAULT_ACTION_ITEM_TEXT = 'Add new item';
6809
7041
  const DotAutoComplete = ({
6810
7042
  ListboxComponent,
6811
7043
  actionItem,
7044
+ ai = false,
7045
+ aiAction,
6812
7046
  ariaLabel,
6813
7047
  autoFocus,
6814
7048
  autoHighlight,
@@ -6875,7 +7109,7 @@ const DotAutoComplete = ({
6875
7109
  const popperOpen = !readOnly && (open || isOpened);
6876
7110
  const preventDuplicateInsertion = actionItem === null || actionItem === void 0 ? void 0 : actionItem.preventDuplicateInsertion;
6877
7111
  const textFieldWarningClassName = !error && warning && warningClassName;
6878
- const rootClasses = getRootClassNames(className, size);
7112
+ const rootClasses = useStylesWithRootClass(getRootClassNames(className, size), ai ? inputAiClassName : '');
6879
7113
  const textFieldRootClasses = getTextFieldRootClassNames(textFieldWarningClassName, readOnly);
6880
7114
  const inputRootClasses = getInputRootClassNames(dense);
6881
7115
  const popperClasses = useStylesWithRootClass(rootClassName$1d, popperClassName);
@@ -6915,6 +7149,9 @@ const DotAutoComplete = ({
6915
7149
  event.relatedTarget !== actionItemRef.current && setIsOpened(false);
6916
7150
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
6917
7151
  };
7152
+ const handleAiAction = useCallback(inputText => {
7153
+ aiAction === null || aiAction === void 0 ? void 0 : aiAction(inputText);
7154
+ }, [aiAction]);
6918
7155
  const onActionButtonClick = () => {
6919
7156
  setIsOpened(false);
6920
7157
  textFieldInput.focus();
@@ -7046,6 +7283,20 @@ const DotAutoComplete = ({
7046
7283
  }), getInputAdornment(), nativeEndAdornment]
7047
7284
  });
7048
7285
  };
7286
+ const renderAISendAdornment = params => {
7287
+ const {
7288
+ inputProps
7289
+ } = params;
7290
+ return jsx(DotIconButton, {
7291
+ iconId: "send-airplane",
7292
+ tooltip: "Send",
7293
+ "data-testid": dataTestId && `${dataTestId}-send-airplane-icon`,
7294
+ shape: "square",
7295
+ color: "ai",
7296
+ disabled: !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value),
7297
+ onClick: () => handleAiAction(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value.toString())
7298
+ });
7299
+ };
7049
7300
  const renderTrimmedLongOptions = (props, option) => {
7050
7301
  const key = 'id' in option ? option.id : option.title;
7051
7302
  return jsx(DotTooltip, {
@@ -7064,6 +7315,15 @@ const DotAutoComplete = ({
7064
7315
  const handleRenderOption = (props, option, state) => {
7065
7316
  return renderOption ? renderOption(props, option, state) : renderTrimmedLongOptions(props, option);
7066
7317
  };
7318
+ const getEndAdornment = params => {
7319
+ if (ai) {
7320
+ return renderAISendAdornment(params);
7321
+ }
7322
+ if (!readOnly) {
7323
+ return renderEndAdornment(params.InputProps.endAdornment);
7324
+ }
7325
+ return undefined;
7326
+ };
7067
7327
  return jsx(StyledAutocomplete, {
7068
7328
  PopperComponent: DotPopper,
7069
7329
  "aria-label": ariaLabel,
@@ -7150,7 +7410,7 @@ const DotAutoComplete = ({
7150
7410
  htmlFor: inputId
7151
7411
  },
7152
7412
  InputProps: Object.assign(Object.assign({}, params.InputProps), {
7153
- endAdornment: !readOnly ? renderEndAdornment(params.InputProps.endAdornment) : undefined
7413
+ endAdornment: getEndAdornment(params)
7154
7414
  }),
7155
7415
  inputRef: textFieldRef,
7156
7416
  label: persistentLabel ? null : label,
@@ -12415,11 +12675,14 @@ const inProgressEditMessage = 'This is a published dashboard. Changes will not b
12415
12675
  // in_progress_changes object itself, which will have parent_id set.
12416
12676
  // The Dashboard Table/Grid will always give the parent dashboard, while in the editor we will be dealing with the
12417
12677
  // in_progress_changes object. This function accounts for both cases
12418
- const dashboardLocked = (dashboard, userId) => {
12419
- if (dashboard.in_progress_changes) {
12420
- return dashboard.in_progress_changes.author_id !== userId;
12421
- } else if (dashboard.parent_id) {
12422
- return dashboard.author_id !== userId;
12678
+ const dashboardLocked = (dashboard, user) => {
12679
+ if (user) {
12680
+ if (dashboard.in_progress_changes) {
12681
+ return dashboard.in_progress_changes.author_id !== user.id;
12682
+ } else if (dashboard.parent_id) {
12683
+ return dashboard.author_id !== user.id;
12684
+ }
12685
+ return false;
12423
12686
  }
12424
12687
  return false;
12425
12688
  };
@@ -12491,7 +12754,7 @@ function DotDashboardOptionsMenu({
12491
12754
  const isDraft = !dashboard.parent_id && dashboard.lifecycle_state === DashboardView.lifecycle_state.DRAFT;
12492
12755
  const isPublished = dashboard.parent_id || dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED;
12493
12756
  const menuItems = [];
12494
- if (!isEdit && onViewMode && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser.id)) {
12757
+ if (!isEdit && onViewMode && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser)) {
12495
12758
  menuItems.push({
12496
12759
  children: jsx(DotButton, {
12497
12760
  ariaLabel: "Edit dashboard",
@@ -12504,7 +12767,7 @@ function DotDashboardOptionsMenu({
12504
12767
  key: 'edit'
12505
12768
  });
12506
12769
  }
12507
- if (onUpdatedProperties && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser.id)) {
12770
+ if (onUpdatedProperties && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser)) {
12508
12771
  let menuItem = jsx(DotButton, {
12509
12772
  ariaLabel: "Edit dashboard properties",
12510
12773
  className: isEdit ? 'disabled-menu-item' : '',
@@ -12555,7 +12818,7 @@ function DotDashboardOptionsMenu({
12555
12818
  key: 'duplicate'
12556
12819
  });
12557
12820
  }
12558
- if (onStartDelete && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser.id)) {
12821
+ if (onStartDelete && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser)) {
12559
12822
  menuItems.push({
12560
12823
  children: jsx(DotButton, {
12561
12824
  ariaLabel: "Delete dashboard",
@@ -12692,7 +12955,7 @@ function DotDashboardOptionsMenu({
12692
12955
  open: isEditPropertiesDialogOpen,
12693
12956
  onClose: handleCloseEditProperties,
12694
12957
  onSubmit: handleSubmitEditProperties,
12695
- editDashboard: editInProgressByUser(dashboard, currentUser.id) && dashboard.in_progress_changes ? dashboard.in_progress_changes : dashboard
12958
+ editDashboard: currentUser && editInProgressByUser(dashboard, currentUser.id) && dashboard.in_progress_changes ? dashboard.in_progress_changes : dashboard
12696
12959
  }), jsx(DotIconButton, {
12697
12960
  className: "expand-button",
12698
12961
  "data-testid": "card-header-action-button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "4.19.2",
3
+ "version": "4.20.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -1,7 +1,7 @@
1
1
  import { MouseEvent, KeyboardEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from './CommonProps';
3
3
  import { TooltipPlacement } from './tooltip';
4
- export type ButtonType = 'destructive' | 'primary' | 'outlined' | 'text';
4
+ export type ButtonType = 'destructive' | 'primary' | 'outlined' | 'text' | 'ai' | 'ai-outlined';
5
5
  export type ButtonSize = 'small' | 'medium' | 'large';
6
6
  export interface BaseButtonProps extends CommonProps {
7
7
  /** If true, the button will be focused **/
@@ -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, trimLongOptions, 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, ai, aiAction, 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>;
@@ -13,6 +13,10 @@ export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOp
13
13
  ListboxComponent?: JSXElementConstructor<HTMLAttributes<HTMLElement>>;
14
14
  /** Action button as the last element on the menu **/
15
15
  actionItem?: ActionItem;
16
+ /** If true, applies a gradient color to the border */
17
+ ai?: boolean;
18
+ /** Event callback */
19
+ aiAction?: (inputText: string) => void;
16
20
  /** This prop helps users to fill forms faster */
17
21
  autoFocus?: boolean;
18
22
  /** If true, the first option is automatically highlighted. */
@@ -102,4 +106,4 @@ export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOp
102
106
  /** If true, the label will be displayed in a warning state. */
103
107
  warning?: boolean;
104
108
  }
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;
109
+ export declare const DotAutoComplete: <T extends AutoCompleteOption>({ ListboxComponent, actionItem, ai, aiAction, 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;
@@ -2,4 +2,5 @@ import { Autocomplete } from '@mui/material';
2
2
  export declare const rootClassName = "dot-autocomplete";
3
3
  export declare const inputRootClassName = "dot-input-root";
4
4
  export declare const inputMediumClassName = "dot-input-medium";
5
+ export declare const inputAiClassName = "dot-input-ai";
5
6
  export declare const StyledAutocomplete: import("styled-components").StyledComponent<typeof Autocomplete, any, {}, never>;
@@ -2,7 +2,7 @@ import { MouseEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
3
  import { IconFontSize } from '../icon/Icon';
4
4
  import { TooltipPlacement } from '../tooltip';
5
- export type IconButtonColor = 'default' | 'inherit' | 'primary' | 'secondary';
5
+ export type IconButtonColor = 'default' | 'inherit' | 'primary' | 'secondary' | 'ai';
6
6
  export type IconButtonSize = 'small' | 'medium';
7
7
  export type IconButtonShape = 'circle' | 'square';
8
8
  export interface CommonIconButtonProps extends CommonProps {
@@ -1,6 +1,8 @@
1
1
  import { CommonProps } from '../CommonProps';
2
- export type IconFontSize = 'small' | 'medium';
2
+ export type IconFontSize = 'small' | 'medium' | 'large';
3
3
  export interface IconProps extends CommonProps {
4
+ /** If true, applies a gradient color to the icon */
5
+ ai?: boolean;
4
6
  /** If true, makes a tooltip not interactive, so it will close when the user hovers over the tooltip before the leaveDelay is expired. */
5
7
  disableInteractive?: boolean;
6
8
  /** Determines the size of the icon and spacing around it */
@@ -10,4 +12,4 @@ export interface IconProps extends CommonProps {
10
12
  /** Tooltip text displayed on hover */
11
13
  tooltip?: string;
12
14
  }
13
- export declare const DotIcon: ({ ariaLabel, ariaRole, className, "data-testid": dataTestId, disableInteractive, fontSize, iconId, tooltip, }: IconProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const DotIcon: ({ ariaLabel, ariaRole, className, "data-testid": dataTestId, disableInteractive, fontSize, iconId, tooltip, ai, }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import '@digital-ai/dot-icons';
2
2
  export declare const rootClassName = "dot-icon";
3
+ export declare const aiIconClassName = "dot-icon-ai";
3
4
  export declare const StyledIcon: import("styled-components").StyledComponent<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").IconTypeMap<{}, "span">> & {
4
5
  muiName: string;
5
6
  }, any, {}, never>;
@@ -0,0 +1,2 @@
1
+ export { DotIcon } from './Icon';
2
+ export type { IconProps, IconFontSize } from './Icon';
@@ -15,6 +15,7 @@ export type { DialogButtonProps, SubmitButtonProps } from './dialog/Dialog';
15
15
  export type { DrawerAnchor } from './drawer/Drawer';
16
16
  export type { DynamicFormProps } from './dynamic-form/DynamicForm';
17
17
  export type { ConditionFunction, ControlClickHandler, DisabledConditionFunction, DisabledControlCondition, DynamicFormConfig, DynamicFormControl, DynamicFormControlProps, DynamicFormControlType, DynamicFormOutputData, DynamicFormSectionProps, DynamicFormState, DynamicFormStateItem, FieldValidation, } from './dynamic-form/models';
18
+ export type { IconFontSize, IconProps } from './icon';
18
19
  export type { InputTextProps } from './input-form-fields/InputText';
19
20
  export type { InputSelectProps, InputSelectOption, OptionType, } from './input-form-fields/InputSelect';
20
21
  export type { LinkUnderline } from './link/Link';
@@ -95,7 +96,7 @@ export { DotEmptyFilterState } from './empty-state/EmptyFilterState';
95
96
  export { DotForm } from './form/Form';
96
97
  export { DotFormGroup } from './form-group/FormGroup';
97
98
  export { DotDynamicForm } from './dynamic-form/DynamicForm';
98
- export { DotIcon } from './icon/Icon';
99
+ export { DotIcon } from './icon';
99
100
  export { DotIllustration } from './illustration/Illustration';
100
101
  export { DotImpactDialog } from './impact-dialog/ImpactDialog';
101
102
  export { DotInlineEdit } from './inline-edit';
@@ -2,6 +2,8 @@ import { ChangeEvent, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
3
  export type inputSizeOptions = 'small' | 'medium';
4
4
  export interface InputProps extends CommonProps {
5
+ /** If true, applies no border */
6
+ ai?: boolean;
5
7
  /** This prop helps users to fill forms faster */
6
8
  autoFocus?: boolean;
7
9
  /** default value of the input element */
@@ -11,6 +11,7 @@ export declare const fieldsetClassName = "MuiOutlinedInput-notchedOutline";
11
11
  export declare const readOnlyClassName = "read-only";
12
12
  export declare const resizerClassName = "with-resizer";
13
13
  export declare const ROW_HEIGHT = 37;
14
+ export declare const inputAiClassName = "dot-input-ai";
14
15
  interface StyledTextFieldProps {
15
16
  $maxRows?: number;
16
17
  $minRows?: number;
@@ -3,6 +3,8 @@ import { InputProps } from './InputFormFields.propTypes';
3
3
  export declare const DELAY_MS = 300;
4
4
  export type endAdornmentIconType = 'warning' | 'error' | 'check';
5
5
  export interface InputTextProps extends InputProps {
6
+ /** If true, applies no border */
7
+ ai?: boolean;
6
8
  /** The HTML autocomplete property to pass along to the input tag. Used for
7
9
  controlling autofill behavior in forms. This property follows this HTML spec:
8
10
  https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
@@ -40,4 +42,4 @@ export interface EndIconProps {
40
42
  success?: boolean;
41
43
  warning?: boolean;
42
44
  }
43
- export declare const DotInputText: ({ autoComplete, autoFocus, className, defaultValue, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, hasResizer, helperText, endIcon, endText, id, informationToolTip, inputRef, label, max, maxLength, maxRows, min, minLength, minRows, multiline, name, onBlur, onChange, onClear, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, shrink, startIcon, size, success, type, value, warning, }: InputTextProps) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const DotInputText: ({ ai, autoComplete, autoFocus, className, defaultValue, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, hasResizer, helperText, endIcon, endText, id, informationToolTip, inputRef, label, max, maxLength, maxRows, min, minLength, minRows, multiline, name, onBlur, onChange, onClear, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, shrink, startIcon, size, success, type, value, warning, }: InputTextProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export declare const rootClassName = "dot-search";
2
- export declare const StyledSearch: import("styled-components").StyledComponent<({ autoComplete, autoFocus, className, defaultValue, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, hasResizer, helperText, endIcon, endText, id, informationToolTip, inputRef, label, max, maxLength, maxRows, min, minLength, minRows, multiline, name, onBlur, onChange, onClear, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, shrink, startIcon, size, success, type, value, warning, }: import("../input-form-fields/InputText").InputTextProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
2
+ export declare const StyledSearch: import("styled-components").StyledComponent<({ ai, autoComplete, autoFocus, className, defaultValue, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, hasResizer, helperText, endIcon, endText, id, informationToolTip, inputRef, label, max, maxLength, maxRows, min, minLength, minRows, multiline, name, onBlur, onChange, onClear, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, shrink, startIcon, size, success, type, value, warning, }: import("../input-form-fields/InputText").InputTextProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
@@ -20,6 +20,17 @@ declare module '@mui/material/styles/createPalette' {
20
20
  purple?: PaletteColorOptions;
21
21
  }
22
22
  }
23
+ declare module '@mui/material/Button' {
24
+ interface ButtonPropsVariantOverrides {
25
+ ai: true;
26
+ 'ai-outlined': true;
27
+ }
28
+ }
29
+ declare module '@mui/material/IconButton' {
30
+ interface IconButtonPropsColorOverrides {
31
+ ai: true;
32
+ }
33
+ }
23
34
  export type ThemeOptions = 'light' | 'dark';
24
35
  export declare const typographyOptions: TypographyOptions;
25
36
  export declare const breakpointOptions: BreakpointOptions;
@@ -87,20 +87,50 @@ export declare const yA100 = "#ffffff";
87
87
  export declare const yA200 = "#fff2d7";
88
88
  export declare const yA400 = "#ffe2a4";
89
89
  export declare const yA700 = "#ffda8b";
90
- export declare const p50 = "#f3e4ee";
91
- export declare const p100 = "#e0bbd4";
92
- export declare const p200 = "#cc8eb8";
93
- export declare const p300 = "#b8609c";
94
- export declare const p400 = "#a83e86";
95
- export declare const p500 = "#991c71";
96
- export declare const p600 = "#911969";
97
- export declare const p700 = "#86145e";
98
- export declare const p800 = "#7c1154";
99
- export declare const p900 = "#6b0942";
90
+ export declare const p50 = "#f5e9fb";
91
+ export declare const p100 = "#ebd4f7";
92
+ export declare const p200 = "#d7aaee";
93
+ export declare const p300 = "#c37fe6";
94
+ export declare const p400 = "#af54de";
95
+ export declare const p500 = "#9e2fd7";
96
+ export declare const p600 = "#7c21ab";
97
+ export declare const p700 = "#5d1980";
98
+ export declare const p800 = "#3e1155";
99
+ export declare const p900 = "#2e0c40";
100
100
  export declare const pA100 = "#ff9cd1";
101
101
  export declare const pA200 = "#ff69b9";
102
102
  export declare const pA400 = "#ff36a2";
103
103
  export declare const pA700 = "#ff1d96";
104
+ export declare const pi50 = "#fce9f6";
105
+ export declare const pi100 = "#f8d3ee";
106
+ export declare const pi200 = "#f1a7dc";
107
+ export declare const pi300 = "#eb7acb";
108
+ export declare const pi400 = "#e44eb9";
109
+ export declare const pi500 = "#dd22a8";
110
+ export declare const pi600 = "#b11b86";
111
+ export declare const pi700 = "#851465";
112
+ export declare const pi800 = "#580e43";
113
+ export declare const pi900 = "#2c0722";
114
+ export declare const v50 = "#ede8fd";
115
+ export declare const v100 = "#dbd1fa";
116
+ export declare const v200 = "#b6a3f5";
117
+ export declare const v300 = "#9275f0";
118
+ export declare const v400 = "#704aec";
119
+ export declare const v500 = "#4c1de7";
120
+ export declare const v600 = "#3a13b9";
121
+ export declare const v700 = "#2c0f8a";
122
+ export declare const v800 = "#1d0a5c";
123
+ export declare const v900 = "#0f052e";
104
124
  export declare const selectedGray = "rgba(0, 0, 0, 0.12)";
105
125
  export declare const lightSelectedGray = "rgba(0, 0, 0, 0.08)";
106
126
  export declare const hoverGray = "rgba(0, 0, 0, 0.04)";
127
+ export declare const aiNormalDark: string;
128
+ export declare const aiActiveDark: string;
129
+ export declare const aiElevatedDark: string;
130
+ export declare const aiLightDark: string;
131
+ export declare const aiAutoCompleteBorderDark: string;
132
+ export declare const aiNormalLight: string;
133
+ export declare const aiActiveLight: string;
134
+ export declare const aiElevatedLight: string;
135
+ export declare const aiLightLight: string;
136
+ export declare const aiAutoCompleteBorderLight: string;
@@ -27,6 +27,14 @@ export interface BreakpointOptions {
27
27
  };
28
28
  }
29
29
  export interface FigmaTheme {
30
+ aiPink: {
31
+ active: string;
32
+ elevated: string;
33
+ light: string;
34
+ normal: string;
35
+ ripple: string;
36
+ rippleLight: string;
37
+ };
30
38
  appToolbar: {
31
39
  background: string;
32
40
  btnHover: string;
@@ -62,6 +70,13 @@ export interface FigmaTheme {
62
70
  disabled: {
63
71
  normal: string;
64
72
  };
73
+ gradient: {
74
+ active: string;
75
+ ai: string;
76
+ elevated: string;
77
+ light: string;
78
+ normal: string;
79
+ };
65
80
  graph: {
66
81
  alert: {
67
82
  error: string;