@datarobot/design-system 28.4.0 → 28.6.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 (40) hide show
  1. package/cjs/chat/chat-message-body.js +9 -4
  2. package/cjs/chat/hocs.d.ts +1 -1
  3. package/cjs/chat/hocs.js +21 -22
  4. package/cjs/chat/index.d.ts +2 -0
  5. package/cjs/chat/index.js +14 -0
  6. package/cjs/checkbox/checkbox.js +5 -3
  7. package/cjs/text-editor/inline-text-editor.d.ts +3 -1
  8. package/cjs/text-editor/inline-text-editor.js +6 -2
  9. package/cjs/text-editor/text-editor-constants.d.ts +0 -2
  10. package/cjs/text-editor/text-editor-constants.js +0 -8
  11. package/cjs/text-editor/text-editor-content.d.ts +2 -1
  12. package/cjs/text-editor/text-editor-content.js +22 -2
  13. package/cjs/text-editor/text-editor-header.js +2 -9
  14. package/cjs/text-editor/text-editor-helpers.d.ts +1 -0
  15. package/cjs/text-editor/text-editor-helpers.js +22 -17
  16. package/cjs/text-editor/text-editor.d.ts +5 -1
  17. package/cjs/text-editor/text-editor.js +31 -6
  18. package/esm/chat/chat-message-body.js +9 -4
  19. package/esm/chat/hocs.d.ts +1 -1
  20. package/esm/chat/hocs.js +21 -22
  21. package/esm/chat/index.d.ts +2 -0
  22. package/esm/chat/index.js +2 -0
  23. package/esm/checkbox/checkbox.js +5 -3
  24. package/esm/text-editor/inline-text-editor.d.ts +3 -1
  25. package/esm/text-editor/inline-text-editor.js +6 -2
  26. package/esm/text-editor/text-editor-constants.d.ts +0 -2
  27. package/esm/text-editor/text-editor-constants.js +0 -6
  28. package/esm/text-editor/text-editor-content.d.ts +2 -1
  29. package/esm/text-editor/text-editor-content.js +22 -2
  30. package/esm/text-editor/text-editor-header.js +3 -10
  31. package/esm/text-editor/text-editor-helpers.d.ts +1 -0
  32. package/esm/text-editor/text-editor-helpers.js +22 -18
  33. package/esm/text-editor/text-editor.d.ts +5 -1
  34. package/esm/text-editor/text-editor.js +33 -8
  35. package/js/bundle/bundle.js +182 -130
  36. package/js/bundle/bundle.min.js +1 -1
  37. package/js/bundle/index.d.ts +22 -5
  38. package/package.json +1 -1
  39. package/styles/index.css +78 -20
  40. package/styles/index.min.css +1 -1
@@ -25,6 +25,7 @@ import { IconLookup } from '@fortawesome/fontawesome-svg-core';
25
25
  import React, { MouseEvent } from 'react';
26
26
  import React, { ReactNode } from 'react';
27
27
  import { Editor, Descendant } from 'slate';
28
+ import { ReactEditor } from 'slate-react';
28
29
  import { Descendant } from 'slate';
29
30
  import { RenderElementProps } from 'slate-react';
30
31
  import React, { ChangeEvent, KeyboardEventHandler } from 'react';
@@ -781,6 +782,13 @@ export type ChatProps = {
781
782
  };
782
783
  export const Chat: React.MemoExoticComponent<React.ForwardRefExoticComponent<ChatProps & React.RefAttributes<HTMLUListElement>>>;
783
784
 
785
+ function CharactersCounterBase({ currLength, maxLength, getCharactersCounterString, }: CharactersCounterProps): import("react/jsx-runtime").JSX.Element;
786
+ namespace CharactersCounterBase {
787
+ var displayName: string;
788
+ }
789
+ export const CharactersCounter: React.MemoExoticComponent<typeof CharactersCounterBase>;
790
+ export {};
791
+
784
792
  export function isMentionElement(type: string): boolean;
785
793
  export function getMentionsCount(nodes: CustomElement[]): number;
786
794
  /** This function synchronises slate editor chidren with value prop.
@@ -789,6 +797,9 @@ export function getMentionsCount(nodes: CustomElement[]): number;
789
797
  */
790
798
  export function resetNodes(editor: Editor, nodes: Descendant[]): void;
791
799
 
800
+ export const withMaxLength: (maxLength: number | undefined) => (editor: ReactEditor) => ReactEditor;
801
+ export const withMentions: (editor: any) => any;
802
+
792
803
  export const DEFAULT_VALUE: Descendant[];
793
804
  export const CUSTOM_ELEMENT_TYPES: {
794
805
  mention: string;
@@ -6247,6 +6258,8 @@ export type TextEditorComponentProps = {
6247
6258
  onBlur?: () => void;
6248
6259
  deleteEditorContentButtonAriaLabel: string;
6249
6260
  id: string;
6261
+ maxLength?: number;
6262
+ getCharactersCounterString?: (count: number) => string;
6250
6263
  };
6251
6264
  export type TextEditorProps = {
6252
6265
  name: string;
@@ -6303,12 +6316,14 @@ export type TextEditorProps = {
6303
6316
  linkInputLabelText?: string;
6304
6317
  deleteEditorContentButtonAriaLabel: string;
6305
6318
  id?: string;
6319
+ maxLength?: number;
6320
+ getCharactersCounterString?: (count: number) => string;
6306
6321
  };
6307
6322
  /**
6308
6323
  * @midnight-gray-supported
6309
6324
  * @alpine-light-supported
6310
6325
  * */
6311
- export default function TextEditor({ name, header, type, value, initialValue, validity, label, placeholder, autoFocus, readOnly, testId, contentTestId, contentAriaLabel, className, height, enabledTools, toolbarPosition, elementRender, leafRender, onChange, onCancel, onSave, tooltipTextBold, tooltipTextItalic, tooltipTextUnderline, tooltipTextSuperscript, tooltipTextLink, tooltipTextRemoveLink, tooltipTextBulletedList, tooltipTextNumberedList, tooltipTextClearFormatting, tooltipTextCode, urlIsRequiredMessage, enterValidUrlMessage, saveButtonText, headingLargeText, headingMediumText, headingSmallText, regularText, validationErrorWarningMessage, linkInputLabelText, deleteEditorContentButtonAriaLabel, id, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
6326
+ export default function TextEditor({ name, header, type, value, initialValue, validity, label, placeholder, autoFocus, readOnly, testId, contentTestId, contentAriaLabel, className, height, enabledTools, toolbarPosition, elementRender, leafRender, onChange, onCancel, onSave, tooltipTextBold, tooltipTextItalic, tooltipTextUnderline, tooltipTextSuperscript, tooltipTextLink, tooltipTextRemoveLink, tooltipTextBulletedList, tooltipTextNumberedList, tooltipTextClearFormatting, tooltipTextCode, urlIsRequiredMessage, enterValidUrlMessage, saveButtonText, headingLargeText, headingMediumText, headingSmallText, regularText, validationErrorWarningMessage, linkInputLabelText, deleteEditorContentButtonAriaLabel, id, maxLength, getCharactersCounterString, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
6312
6327
 
6313
6328
  import './edited-text.less';
6314
6329
  export type EditedTextComponentProps = {
@@ -6357,8 +6372,10 @@ export type InlineTextEditorProps = {
6357
6372
  readOnly?: boolean;
6358
6373
  deleteEditorContentButtonAriaLabel?: string;
6359
6374
  autoFocus?: boolean;
6375
+ maxLength?: number;
6376
+ getCharactersCounterString?: (count: number) => string;
6360
6377
  };
6361
- export default function InlineTextEditor({ name, type, readOnly, initialValue, placeholder, ariaLabel, className, enabledTools, header, toolbarPosition, height, onCancel, onSave, autoFocus, deleteEditorContentButtonAriaLabel, }: InlineTextEditorProps): import("react/jsx-runtime").JSX.Element;
6378
+ export default function InlineTextEditor({ name, type, readOnly, initialValue, placeholder, ariaLabel, className, enabledTools, header, toolbarPosition, height, onCancel, onSave, autoFocus, deleteEditorContentButtonAriaLabel, maxLength, getCharactersCounterString, }: InlineTextEditorProps): import("react/jsx-runtime").JSX.Element;
6362
6379
 
6363
6380
  export type TextEditorEngine = BaseEditor & ReactEditor & HistoryEditor & EditorInterface;
6364
6381
  export const MARK_TYPES: {
@@ -6431,8 +6448,6 @@ export interface SlateReact {
6431
6448
  Slate: FC<SlateComponent>;
6432
6449
  withReact: typeof withReact;
6433
6450
  }
6434
- export function instanceOfContentChild(obj: TextEditorValue | TextEditorValueChild): obj is TextEditorValueChild;
6435
- export function instanceOfContent(obj: TextEditorValue | TextEditorValueChild): obj is TextEditorValue;
6436
6451
  export const TEXT_EDITOR_DEFAULT_VALUE: TextEditorValue[];
6437
6452
  export const TEXT_EDITOR_DEFAULT_TOOLS: TextEditorTool[];
6438
6453
  export interface TextEditorToolbarLabels {
@@ -6481,6 +6496,7 @@ export function isEmptyTextEditorValue(value: TextEditorValue[]): boolean;
6481
6496
  * @returns {boolean}
6482
6497
  */
6483
6498
  export function isLongerTextEditorValueThan(value: TextEditorValue[] | TextEditorValueChild[], maxLength?: number): boolean;
6499
+ export function getTextEditorValueLength(value: TextEditorValue[] | TextEditorValueChild[]): number;
6484
6500
  /**
6485
6501
  * @param {Array} value - the type of value is defined with TextEditorValue
6486
6502
  * @param {number} maxTextLines
@@ -8426,8 +8442,9 @@ export type TextEditorContentProps = {
8426
8442
  leafRender?: FC<LeafProps>;
8427
8443
  onBlur?: () => void;
8428
8444
  onFocus?: () => void;
8445
+ maxLength?: number;
8429
8446
  };
8430
- export default function TextEditorContent({ ariaAttrs, testId, placeholder, readOnly, autoFocus, isScrollable, elementRender, leafRender, onBlur, onFocus, }: TextEditorContentProps): import("react/jsx-runtime").JSX.Element;
8447
+ export default function TextEditorContent({ ariaAttrs, testId, placeholder, readOnly, autoFocus, isScrollable, elementRender, leafRender, onBlur, onFocus, maxLength, }: TextEditorContentProps): import("react/jsx-runtime").JSX.Element;
8431
8448
 
8432
8449
  export type TourHandlerFunction = () => void;
8433
8450
  export type SkipTourHandlerFunction = (stepNumber: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarobot/design-system",
3
- "version": "28.4.0",
3
+ "version": "28.6.0",
4
4
  "description": "DataRobot react components library",
5
5
  "scripts": {
6
6
  "build": "node ../../tools/build-lib.js",
package/styles/index.css CHANGED
@@ -926,6 +926,8 @@
926
926
  /* REACT COMPONENT MIXINS */
927
927
  .sr-only {
928
928
  position: absolute;
929
+ top: 0;
930
+ left: 0;
929
931
  height: 0.0625rem;
930
932
  width: 0.0625rem;
931
933
  /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
@@ -3627,13 +3629,15 @@ popout[data-popper-placement^='right']::after,
3627
3629
  .checkbox-tooltip-container {
3628
3630
  display: inline-block;
3629
3631
  }
3632
+ .checkbox-wrapper {
3633
+ position: relative;
3634
+ display: inline-block;
3635
+ }
3630
3636
  .checkbox {
3631
3637
  /* Hide native checkbox, but keep it focusable */
3632
- height: 0;
3633
- width: 0;
3634
- margin: 0;
3635
- clip: rect(0 0 0 0);
3636
3638
  position: absolute;
3639
+ top: 0;
3640
+ left: 0;
3637
3641
  height: 0.0625rem;
3638
3642
  width: 0.0625rem;
3639
3643
  /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
@@ -3657,6 +3661,7 @@ popout[data-popper-placement^='right']::after,
3657
3661
  align-self: center;
3658
3662
  min-height: 1rem;
3659
3663
  min-width: 1rem;
3664
+ max-width: 100%;
3660
3665
  padding-left: 1.5rem;
3661
3666
  vertical-align: middle;
3662
3667
  font-size: 0.875rem;
@@ -3789,15 +3794,26 @@ popout[data-popper-placement^='right']::after,
3789
3794
  /*!******************************************************************************************************************************************************************************************************************************************************!*\
3790
3795
  !*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/components/radio-button/radio-button.less ***!
3791
3796
  \******************************************************************************************************************************************************************************************************************************************************/
3797
+ /* stylelint-disable dr-custom/no-several-root-selectors */
3798
+ .radiobutton-wrapper {
3799
+ position: relative;
3800
+ }
3792
3801
  .radiobutton {
3802
+ /* Hide native radiobutton, but keep it focusable */
3793
3803
  position: absolute;
3794
- height: 0;
3795
- width: 0;
3796
- margin: 0;
3804
+ top: 0;
3805
+ left: 0;
3806
+ height: 0.0625rem;
3807
+ width: 0.0625rem;
3808
+ /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
3809
+ margin: -0.0625rem;
3797
3810
  padding: 0;
3811
+ white-space: nowrap;
3798
3812
  border: 0;
3813
+ clip: rect(0.0625rem, 0.0625rem, 0.0625rem, 0.0625rem);
3814
+ -webkit-clip-path: inset(50%);
3815
+ clip-path: inset(50%);
3799
3816
  overflow: hidden;
3800
- clip: rect(0 0 0 0);
3801
3817
  }
3802
3818
  .radiobutton + label {
3803
3819
  position: relative;
@@ -3906,6 +3922,7 @@ popout[data-popper-placement^='right']::after,
3906
3922
  .radiobutton + .radiobutton-label.lg + .radiobutton-helper-text {
3907
3923
  padding-left: 1.5rem;
3908
3924
  }
3925
+ /* stylelint-enable dr-custom/no-several-root-selectors */
3909
3926
 
3910
3927
  /*!*********************************************************************************************************************************************************************************************************************************************************************!*\
3911
3928
  !*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/components/dropdown-menu/dropdown-item-radio-button.less ***!
@@ -4262,6 +4279,12 @@ popout[data-popper-placement^='right']::after,
4262
4279
  .dropdown-content ul.dropdown-menu-footer div.drop-item .checkbox-item {
4263
4280
  position: relative;
4264
4281
  }
4282
+ .dropdown-content ul.dropdown-menu-list li.drop-item .checkbox-item .checkbox-wrapper,
4283
+ .dropdown-content ul.dropdown-menu-footer li.drop-item .checkbox-item .checkbox-wrapper,
4284
+ .dropdown-content ul.dropdown-menu-list div.drop-item .checkbox-item .checkbox-wrapper,
4285
+ .dropdown-content ul.dropdown-menu-footer div.drop-item .checkbox-item .checkbox-wrapper {
4286
+ width: 100%;
4287
+ }
4265
4288
  .dropdown-content ul.dropdown-menu-list li.drop-item .checkbox-item .checkbox + label,
4266
4289
  .dropdown-content ul.dropdown-menu-footer li.drop-item .checkbox-item .checkbox + label,
4267
4290
  .dropdown-content ul.dropdown-menu-list div.drop-item .checkbox-item .checkbox + label,
@@ -4426,6 +4449,9 @@ popout[data-popper-placement^='right']::after,
4426
4449
  .dropdown-content ul.dropdown-menu-list.sectioned li.drop-item .checkbox-item {
4427
4450
  position: relative;
4428
4451
  }
4452
+ .dropdown-content ul.dropdown-menu-list.sectioned li.drop-item .checkbox-item .checkbox-wrapper {
4453
+ width: 100%;
4454
+ }
4429
4455
  .dropdown-content ul.dropdown-menu-list.sectioned li.drop-item .checkbox-item .checkbox + label {
4430
4456
  width: 100%;
4431
4457
  padding: 0.25rem 2rem 0.25rem 3.25rem;
@@ -5766,6 +5792,7 @@ button.highlighted-badge.apple:active:not(:disabled),
5766
5792
  !*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/components/chart-legend/chart-legend-item.less ***!
5767
5793
  \***********************************************************************************************************************************************************************************************************************************************************/
5768
5794
  .chart-legend-item {
5795
+ position: relative;
5769
5796
  display: flex;
5770
5797
  align-content: center;
5771
5798
  justify-content: center;
@@ -5798,13 +5825,19 @@ button.highlighted-badge.apple:active:not(:disabled),
5798
5825
  .chart-legend-item input.chart-legend-item-checkbox {
5799
5826
  /* Hide native checkbox, but keep it focusable */
5800
5827
  position: absolute;
5801
- height: 0;
5802
- width: 0;
5803
- margin: 0;
5828
+ top: 0;
5829
+ left: 0;
5830
+ height: 0.0625rem;
5831
+ width: 0.0625rem;
5832
+ /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
5833
+ margin: -0.0625rem;
5804
5834
  padding: 0;
5835
+ white-space: nowrap;
5805
5836
  border: 0;
5837
+ clip: rect(0.0625rem, 0.0625rem, 0.0625rem, 0.0625rem);
5838
+ -webkit-clip-path: inset(50%);
5839
+ clip-path: inset(50%);
5806
5840
  overflow: hidden;
5807
- clip: rect(0 0 0 0);
5808
5841
  }
5809
5842
  .chart-legend-item input.chart-legend-item-checkbox + label {
5810
5843
  cursor: pointer;
@@ -10775,6 +10808,7 @@ button:hover.active.pill {
10775
10808
  !*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/components/tabs/tabs.less ***!
10776
10809
  \**************************************************************************************************************************************************************************************************************************************/
10777
10810
  .tabgroup {
10811
+ position: relative;
10778
10812
  border: 0;
10779
10813
  }
10780
10814
  .tabgroup.tabgroup-container {
@@ -10797,13 +10831,19 @@ button:hover.active.pill {
10797
10831
  .tabgroup .tabgroup-tab {
10798
10832
  /* 1. hide native input */
10799
10833
  position: absolute;
10800
- height: 0;
10801
- width: 0;
10802
- margin: 0;
10834
+ top: 0;
10835
+ left: 0;
10836
+ height: 0.0625rem;
10837
+ width: 0.0625rem;
10838
+ /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
10839
+ margin: -0.0625rem;
10803
10840
  padding: 0;
10841
+ white-space: nowrap;
10804
10842
  border: 0;
10843
+ clip: rect(0.0625rem, 0.0625rem, 0.0625rem, 0.0625rem);
10844
+ -webkit-clip-path: inset(50%);
10845
+ clip-path: inset(50%);
10805
10846
  overflow: hidden;
10806
- clip: rect(0 0 0 0);
10807
10847
  }
10808
10848
  .tabgroup .tabgroup-tab:focus-visible + label {
10809
10849
  outline: var(--focus-outline-color) solid 0.0625rem;
@@ -12147,6 +12187,8 @@ table.simple-table.sublevel tr td {
12147
12187
  fill: var(--react-table-header-text-color);
12148
12188
  border-left: 0.0625rem solid var(--react-table-header-border);
12149
12189
  position: absolute;
12190
+ top: 0;
12191
+ left: 0;
12150
12192
  height: 0.0625rem;
12151
12193
  width: 0.0625rem;
12152
12194
  /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
@@ -13041,6 +13083,16 @@ table.simple-table.sublevel tr td {
13041
13083
  color: var(--text-primary);
13042
13084
  fill: var(--text-primary);
13043
13085
  }
13086
+ .text-editor .characters-counter {
13087
+ font-family: 'Inter', sans-serif;
13088
+ font-size: 0.75rem;
13089
+ font-weight: 400;
13090
+ line-height: 1rem;
13091
+ letter-spacing: normal;
13092
+ color: var(--text-secondary);
13093
+ fill: var(--text-secondary);
13094
+ margin: 0.25rem;
13095
+ }
13044
13096
 
13045
13097
  /*!****************************************************************************************************************************************************************************************************************************************************!*\
13046
13098
  !*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./src/components/text-editor/edited-text.less ***!
@@ -13160,13 +13212,19 @@ table.simple-table.sublevel tr td {
13160
13212
  .toggle {
13161
13213
  /* Hide native checkbox, but keep it focusable */
13162
13214
  position: absolute;
13163
- height: 0;
13164
- width: 0;
13165
- margin: 0;
13215
+ top: 0;
13216
+ left: 0;
13217
+ height: 0.0625rem;
13218
+ width: 0.0625rem;
13219
+ /* stylelint-disable-next-line dr-custom/no-unexpected-spacing-definitions */
13220
+ margin: -0.0625rem;
13166
13221
  padding: 0;
13222
+ white-space: nowrap;
13167
13223
  border: 0;
13224
+ clip: rect(0.0625rem, 0.0625rem, 0.0625rem, 0.0625rem);
13225
+ -webkit-clip-path: inset(50%);
13226
+ clip-path: inset(50%);
13168
13227
  overflow: hidden;
13169
- clip: rect(0 0 0 0);
13170
13228
  /* Represents the only visible element of toggle */
13171
13229
  /* Represents knob area */
13172
13230
  /* Represents actual knob that changes position when checked/unchecked */