@jetbrains/ring-ui 5.0.74 → 5.0.76

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.
@@ -21,6 +21,8 @@
21
21
  margin: 0;
22
22
  padding: 0;
23
23
 
24
+ cursor: pointer;
25
+
24
26
  text-align: inherit;
25
27
 
26
28
  color: inherit;
@@ -38,19 +40,6 @@
38
40
  @nest .disabled &:focus {
39
41
  outline: none;
40
42
  }
41
- }
42
-
43
- .heading {
44
- overflow: hidden;
45
-
46
- padding: 6px 0;
47
-
48
- cursor: pointer;
49
-
50
- white-space: nowrap;
51
- text-overflow: ellipsis;
52
-
53
- border-radius: var(--ring-border-radius);
54
43
 
55
44
  &:hover {
56
45
  background-color: var(--ring-hover-background-color);
@@ -63,8 +52,22 @@
63
52
  }
64
53
  }
65
54
 
55
+ .heading {
56
+ display: -webkit-box;
57
+ overflow: hidden;
58
+
59
+ -webkit-line-clamp: 1;
60
+ -webkit-box-orient: vertical;
61
+
62
+ border-radius: var(--ring-border-radius);
63
+
64
+ @nest .multiline & {
65
+ -webkit-line-clamp: 3;
66
+ }
67
+ }
68
+
66
69
  .heading.heading {
67
- margin-bottom: 0;
70
+ margin: 6px 0;
68
71
 
69
72
  line-height: 28px;
70
73
  }
@@ -22,6 +22,7 @@ export type EditableHeadingProps = Omit<InputHTMLAttributes<HTMLInputElement>, '
22
22
  onCancel?: () => void;
23
23
  'data-test'?: string | null;
24
24
  error?: string;
25
+ multiline?: boolean;
25
26
  renderMenu?: () => React.ReactNode;
26
27
  translations?: EditableHeadingTranslations;
27
28
  };
@@ -11,7 +11,7 @@ export { Levels };
11
11
  export { Size };
12
12
  function noop() { }
13
13
  export const EditableHeading = (props) => {
14
- const { level = Levels.H1, className, headingClassName, inputClassName, children, isEditing = false, isSavingPossible = false, isSaving = false, embedded = false, size = Size.L, onEdit = noop, onSave = noop, onCancel = noop, autoFocus = true, 'data-test': dataTest, error, disabled, renderMenu = () => null, translations = {
14
+ const { level = Levels.H1, className, headingClassName, inputClassName, children, isEditing = false, isSavingPossible = false, isSaving = false, embedded = false, size = Size.L, onEdit = noop, onSave = noop, onCancel = noop, autoFocus = true, 'data-test': dataTest, error, disabled, multiline = false, renderMenu = () => null, translations = {
15
15
  save: 'Save',
16
16
  cancel: 'Cancel'
17
17
  }, ...restProps } = props;
@@ -29,7 +29,8 @@ export const EditableHeading = (props) => {
29
29
  [styles.fullSize]: isEditing && size === Size.FULL,
30
30
  [styles.isEditing]: isEditing,
31
31
  [styles.error]: hasError,
32
- [styles.disabled]: disabled
32
+ [styles.disabled]: disabled,
33
+ [styles.multiline]: multiline
33
34
  });
34
35
  const headingClasses = classNames(styles.heading, headingClassName, styles[`size${size}`]);
35
36
  const inputClasses = classNames('ring-js-shortcuts', styles.input, inputStyles[`size${size}`], styles[`level${level}`], inputClassName);
@@ -1,9 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeProps } from 'react-markdown/lib/ast-to-react';
3
- declare module 'react-markdown/lib/complex-types' {
4
- interface ReactMarkdownProps {
5
- language?: string;
6
- }
3
+ export interface MarkdownCodeProps extends CodeProps {
4
+ language?: string;
7
5
  }
8
- declare const MarkdownCode: ({ children, language, inline, className }: CodeProps) => JSX.Element;
6
+ declare const MarkdownCode: ({ children, language, inline, className }: MarkdownCodeProps) => JSX.Element;
9
7
  export default MarkdownCode;
@@ -7,6 +7,8 @@
7
7
  padding: unit;
8
8
 
9
9
  text-align: left;
10
+
11
+ color: var(--ring-text-color);
10
12
  }
11
13
 
12
14
  .long {
@@ -22,6 +22,7 @@ export type EditableHeadingProps = Omit<InputHTMLAttributes<HTMLInputElement>, '
22
22
  onCancel?: () => void;
23
23
  'data-test'?: string | null;
24
24
  error?: string;
25
+ multiline?: boolean;
25
26
  renderMenu?: () => React.ReactNode;
26
27
  translations?: EditableHeadingTranslations;
27
28
  };
@@ -30,7 +30,7 @@ import 'combokeys';
30
30
  import '../global/sniffer.js';
31
31
  import 'sniffr';
32
32
 
33
- var modules_6e69b0fe = {"unit":"8px","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","heading":"heading_rui_0870","input":"input_rui_0870","error":"error_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
33
+ var modules_6e69b0fe = {"unit":"8px","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","heading":"heading_rui_0870","multiline":"multiline_rui_0870","input":"input_rui_0870","error":"error_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
34
34
 
35
35
  function noop() {}
36
36
  const EditableHeading = props => {
@@ -52,6 +52,7 @@ const EditableHeading = props => {
52
52
  'data-test': dataTest,
53
53
  error,
54
54
  disabled,
55
+ multiline = false,
55
56
  renderMenu = () => null,
56
57
  translations = {
57
58
  save: 'Save',
@@ -73,7 +74,8 @@ const EditableHeading = props => {
73
74
  [modules_6e69b0fe.fullSize]: isEditing && size === Size.FULL,
74
75
  [modules_6e69b0fe.isEditing]: isEditing,
75
76
  [modules_6e69b0fe.error]: hasError,
76
- [modules_6e69b0fe.disabled]: disabled
77
+ [modules_6e69b0fe.disabled]: disabled,
78
+ [modules_6e69b0fe.multiline]: multiline
77
79
  });
78
80
  const headingClasses = classNames(modules_6e69b0fe.heading, headingClassName, modules_6e69b0fe[`size${size}`]);
79
81
  const inputClasses = classNames('ring-js-shortcuts', modules_6e69b0fe.input, modules_88cfaf40[`size${size}`], modules_6e69b0fe[`level${level}`], inputClassName);
@@ -1,9 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeProps } from 'react-markdown/lib/ast-to-react';
3
- declare module 'react-markdown/lib/complex-types' {
4
- interface ReactMarkdownProps {
5
- language?: string;
6
- }
3
+ export interface MarkdownCodeProps extends CodeProps {
4
+ language?: string;
7
5
  }
8
- declare const MarkdownCode: ({ children, language, inline, className }: CodeProps) => JSX.Element;
6
+ declare const MarkdownCode: ({ children, language, inline, className }: MarkdownCodeProps) => JSX.Element;
9
7
  export default MarkdownCode;