@datarobot/design-system 29.5.0 → 29.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.
@@ -236,6 +236,8 @@ export { Tabs, TAB_GROUP_SIZE, TABS_ACCENT_TYPES };
236
236
  export type { TextEditorProps, TextEditorValue, TextEditorValueChild, MarkType, BlockType, TextEditorTool, };
237
237
  export { TextEditor, EditedText, InlineTextEditor, isEmptyTextEditorValue, isLongerTextEditorValueThan, hasGreaterTextEditorLinesThan, convertTextToTextEditorValue, TEXT_EDITOR_DEFAULT_VALUE, TEXT_EDITOR_DEFAULT_TOOLS, TEXT_EDITOR_TOOLS, INLINE_EDITOR_TYPES, BLOCK_TYPES, MARK_TYPES, TOOLBAR_POSITION, };
238
238
 
239
+ export { TextMergeView, type TextMergeProps };
240
+
239
241
  export type { TextAreaProps, TextAreaResizeValues };
240
242
  export { TextArea, TEXTAREA_RESIZE_VALUES };
241
243
 
@@ -3706,7 +3708,9 @@ type KeyValuePairsProps = {
3706
3708
  /** Object that represents the key value pairs in this component */
3707
3709
  value: ValueObject;
3708
3710
  className?: string;
3711
+ /** whether whole form is disabled */
3709
3712
  isDisabled?: boolean;
3713
+ disabledPairs?: ValueObject;
3710
3714
  label?: string;
3711
3715
  /** Label for the key column */
3712
3716
  keyLabel?: string;
@@ -3752,7 +3756,7 @@ type KeyValuePairsProps = {
3752
3756
  @midnight-gray-supported
3753
3757
  @alpine-light-supported
3754
3758
  */
3755
- export const KeyValuePairs: ({ value, className, label, keyLabel, valueLabel, helperText, placeholder: placeholderParams, isDisabled, onChange, hasWarning, emptyCheck, warningMessage: warningMessageParams, buttonText: buttonTextParams, maxItemsTooltipText: maxItemsTooltipTextParams, emptyItemErrorText: emptyItemErrorTextParams, deleteKeyValueText: deleteKeyValueTextParams, buildDuplicateItemErrorText: buildDuplicateItemErrorTextParams, testId, infoIconProps, onError, maxSize, addButtonAccentType, keyInputAriaLabel: keyInputAriaLabelParams, valueInputAriaLabel: valueInputAriaLabelParams, id, }: KeyValuePairsProps) => import("react/jsx-runtime").JSX.Element;
3759
+ export const KeyValuePairs: ({ value, className, label, keyLabel, valueLabel, helperText, placeholder: placeholderParams, isDisabled, disabledPairs, onChange, hasWarning, emptyCheck, warningMessage: warningMessageParams, buttonText: buttonTextParams, maxItemsTooltipText: maxItemsTooltipTextParams, emptyItemErrorText: emptyItemErrorTextParams, deleteKeyValueText: deleteKeyValueTextParams, buildDuplicateItemErrorText: buildDuplicateItemErrorTextParams, testId, infoIconProps, onError, maxSize, addButtonAccentType, keyInputAriaLabel: keyInputAriaLabelParams, valueInputAriaLabel: valueInputAriaLabelParams, id, }: KeyValuePairsProps) => import("react/jsx-runtime").JSX.Element;
3756
3760
  export {};
3757
3761
 
3758
3762
  import './label-accent.less';
@@ -6669,6 +6673,28 @@ export function hasGreaterTextEditorLinesThan(value: TextEditorValue[], maxTextL
6669
6673
  */
6670
6674
  export function convertTextToTextEditorValue(text: string): TextEditorValue[];
6671
6675
 
6676
+ import './text-merge-view.less';
6677
+ export type TextMergeProps = {
6678
+ className?: string;
6679
+ testId?: string;
6680
+ isDarkTheme?: boolean;
6681
+ values: {
6682
+ left: string;
6683
+ right: string;
6684
+ };
6685
+ viewSettings?: {
6686
+ showLineNumbers: boolean;
6687
+ highlightActiveLine: boolean;
6688
+ };
6689
+ };
6690
+ /**
6691
+ * Merge view for 2 text versions
6692
+ * Limited to read-only view.
6693
+ * @midnight-gray-supported
6694
+ * @alpine-light-supported
6695
+ */
6696
+ export function TextMergeView({ className, testId, isDarkTheme, values, viewSettings, }: TextMergeProps): import("react/jsx-runtime").JSX.Element;
6697
+
6672
6698
  import './text-with-hyperlinks.less';
6673
6699
  export type TextWithHyperlinksProps = {
6674
6700
  value?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarobot/design-system",
3
- "version": "29.5.0",
3
+ "version": "29.7.0",
4
4
  "description": "DataRobot react components library",
5
5
  "scripts": {
6
6
  "build": "node ../../tools/build-lib.js",
@@ -51,6 +51,9 @@
51
51
  "rheostat": "4.1.1"
52
52
  },
53
53
  "peerDependencies": {
54
+ "@codemirror/merge": "6.11.2",
55
+ "@codemirror/state": "^6.0.0",
56
+ "@codemirror/view": "^6.17.0",
54
57
  "@fortawesome/fontawesome-svg-core": "6.7.1",
55
58
  "@fortawesome/free-brands-svg-icons": "6.7.1",
56
59
  "@fortawesome/free-regular-svg-icons": "6.7.1",
package/styles/index.css CHANGED
@@ -859,6 +859,14 @@
859
859
  --text-editor-background-hover-color: #20262A;
860
860
  --text-editor-active-color: transparent;
861
861
  /*#endregion */
862
+ /*#region TextMergeView component */
863
+ --deleted-main-color: #E64D4D;
864
+ --deleted-with-opacity-color: rgba(230, 77, 77, 0.5);
865
+ --deleted-line-color: rgba(230, 77, 77, 0.08);
866
+ --changed-main-color: #1FFF9A;
867
+ --changed-with-opacity-color: rgba(31, 255, 154, 0.5);
868
+ --changed-line-color: rgba(31, 255, 154, 0.08);
869
+ /*#endregion */
862
870
  /*#region ToggleSwitch */
863
871
  --toggle-bg: transparent;
864
872
  --toggle-area-border-color: #81868A;
@@ -13387,6 +13395,34 @@ table.simple-table.sublevel tr td {
13387
13395
  padding: 0.5rem 0;
13388
13396
  }
13389
13397
 
13398
+ /*!************************************************************************************************************************************************************************************************************************************************************!*\
13399
+ !*** 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-merge-view/text-merge-view.less ***!
13400
+ \************************************************************************************************************************************************************************************************************************************************************/
13401
+ /* stylelint-disable dr-custom/only-kebab-case-class-names */
13402
+ .text-merge-view {
13403
+ width: 100%;
13404
+ }
13405
+ .text-merge-view .cm-mergeViewEditor .cm-merge-a .cm-changedLineGutter {
13406
+ background: var(--deleted-main-color);
13407
+ }
13408
+ .text-merge-view .cm-mergeViewEditor .cm-merge-a .cm-deletedLine .cm-changedText {
13409
+ background: linear-gradient(var(--deleted-with-opacity-color), var(--deleted-with-opacity-color)) bottom / 100% 0.125rem no-repeat;
13410
+ }
13411
+ .text-merge-view .cm-mergeViewEditor .cm-merge-a .cm-changedLine,
13412
+ .text-merge-view .cm-mergeViewEditor .cm-merge-a .cm-deletedChunk {
13413
+ background-color: var(--deleted-line-color);
13414
+ }
13415
+ .text-merge-view .cm-mergeViewEditor .cm-merge-b .cm-changedLineGutter {
13416
+ background: var(--changed-main-color);
13417
+ }
13418
+ .text-merge-view .cm-mergeViewEditor .cm-merge-b .cm-changedLine {
13419
+ background-color: var(--changed-line-color);
13420
+ }
13421
+ .text-merge-view .cm-mergeViewEditor .cm-merge-b .cm-insertedLine .cm-changedText {
13422
+ background: linear-gradient(var(--changed-with-opacity-color), var(--changed-with-opacity-color)) bottom / 100% 0.125rem no-repeat;
13423
+ }
13424
+ /* stylelint-enable dr-custom/only-kebab-case-class-names */
13425
+
13390
13426
  /*!**********************************************************************************************************************************************************************************************************************************************************!*\
13391
13427
  !*** 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/toggler-switch/toggler-switch.less ***!
13392
13428
  \**********************************************************************************************************************************************************************************************************************************************************/