@digital-ai/dot-components 4.21.0 → 4.22.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.
Files changed (2) hide show
  1. package/index.esm.js +28 -9
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -1606,6 +1606,10 @@ const StyledTextField = styled(TextField)`
1606
1606
  }
1607
1607
  }
1608
1608
 
1609
+ .ai-text-clear-icon {
1610
+ right: 36px;
1611
+ position: relative;
1612
+ }
1609
1613
  .MuiOutlinedInput-adornedStart {
1610
1614
  padding-left: 12px;
1611
1615
 
@@ -7293,14 +7297,23 @@ const DotAutoComplete = ({
7293
7297
  const {
7294
7298
  inputProps
7295
7299
  } = params;
7296
- return jsx(DotIconButton, {
7297
- iconId: "send-airplane",
7298
- tooltip: "Send",
7299
- "data-testid": dataTestId && `${dataTestId}-send-airplane-icon`,
7300
- shape: "square",
7301
- color: "ai",
7302
- disabled: !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value),
7303
- onClick: () => handleAiAction(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value.toString())
7300
+ return jsxs(Fragment, {
7301
+ children: [jsx(DotIconButton, {
7302
+ iconId: "send-airplane",
7303
+ tooltip: "Send",
7304
+ "data-testid": dataTestId && `${dataTestId}-send-airplane-icon`,
7305
+ shape: "square",
7306
+ color: "ai",
7307
+ disabled: !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value),
7308
+ onClick: () => {
7309
+ if (inputProps === null || inputProps === void 0 ? void 0 : inputProps.value) {
7310
+ handleAiAction(inputProps.value.toString());
7311
+ }
7312
+ }
7313
+ }), jsx("span", {
7314
+ className: "ai-text-clear-icon",
7315
+ children: params.InputProps.endAdornment
7316
+ })]
7304
7317
  });
7305
7318
  };
7306
7319
  const renderTrimmedLongOptions = (props, option) => {
@@ -7428,6 +7441,12 @@ const DotAutoComplete = ({
7428
7441
  event.preventDefault();
7429
7442
  (_a = actionItemRef === null || actionItemRef === void 0 ? void 0 : actionItemRef.current) === null || _a === void 0 ? void 0 : _a.focus();
7430
7443
  }
7444
+ if (event.key === 'Enter' && ai) {
7445
+ event.stopPropagation();
7446
+ event.preventDefault();
7447
+ const text = event.target.value;
7448
+ handleAiAction(text);
7449
+ }
7431
7450
  },
7432
7451
  placeholder: showPlaceholder ? placeholder : undefined,
7433
7452
  required: required,
@@ -53926,7 +53945,7 @@ const DotToggleSwitch = ({
53926
53945
  })
53927
53946
  }), label && jsx(DotTypography, {
53928
53947
  className: "dot-toggle-switch-label",
53929
- variant: "body1",
53948
+ variant: "caption",
53930
53949
  children: label
53931
53950
  })]
53932
53951
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "4.21.0",
3
+ "version": "4.22.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [