@jetbrains/ring-ui 7.0.63 → 7.0.65
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.
|
@@ -49,7 +49,7 @@ export class Button extends PureComponent {
|
|
|
49
49
|
className: classes,
|
|
50
50
|
children: (_jsxs(_Fragment, { children: [loader && !isInline && _jsx("div", { className: styles.loaderBackground }), content] })),
|
|
51
51
|
};
|
|
52
|
-
return 'href' in
|
|
52
|
+
return 'href' in commonProps && commonProps.href !== undefined ? (_jsx(ClickableLink, { ...commonProps })) : (_jsx("button", { ref: this.buttonRef, type: 'button', disabled: isDisabled, ...commonProps }));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
export { Size as IconSize };
|
package/components/tag/tag.css
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
|
|
29
29
|
padding: 0 var(--ring-unit);
|
|
30
30
|
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
|
|
33
31
|
vertical-align: top;
|
|
34
32
|
|
|
35
33
|
color: var(--ring-tag-text-color);
|
|
@@ -64,6 +62,10 @@
|
|
|
64
62
|
background-color: var(--ring-tag-container-background-color);
|
|
65
63
|
}
|
|
66
64
|
|
|
65
|
+
.interactive {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
68
|
+
|
|
67
69
|
.default {
|
|
68
70
|
--ring-tag-container-background-color: var(--ring-tag-background-color);
|
|
69
71
|
--ring-tag-container-hover-background-color: var(--ring-tag-hover-background-color);
|
|
@@ -147,7 +149,7 @@
|
|
|
147
149
|
|
|
148
150
|
.focused,
|
|
149
151
|
.tag:focus-visible,
|
|
150
|
-
.
|
|
152
|
+
.interactive:hover {
|
|
151
153
|
--ring-tag-outline-color: var(--ring-tag-outline-hover-color);
|
|
152
154
|
--ring-tag-container-background-color: var(--ring-tag-container-hover-background-color);
|
|
153
155
|
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface TagRenderProps extends HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
ref: RefCallback<HTMLElement>;
|
|
7
7
|
'data-test': string;
|
|
8
|
+
interactive?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare enum TagType {
|
|
10
11
|
DEFAULT = "default",
|
|
@@ -20,7 +21,7 @@ export interface TagProps {
|
|
|
20
21
|
readOnly: boolean;
|
|
21
22
|
disabled: boolean;
|
|
22
23
|
focused: boolean;
|
|
23
|
-
render: (props: TagRenderProps) => ReactNode;
|
|
24
|
+
render: (props: TagRenderProps, interactive?: boolean) => ReactNode;
|
|
24
25
|
children?: ReactNode;
|
|
25
26
|
className?: string | null | undefined;
|
|
26
27
|
containerClassName?: string | null | undefined;
|
|
@@ -32,6 +33,7 @@ export interface TagProps {
|
|
|
32
33
|
backgroundColor?: string | undefined;
|
|
33
34
|
outline?: boolean;
|
|
34
35
|
tagType?: TagType;
|
|
36
|
+
interactive?: boolean;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* @name Tag
|
package/components/tag/tag.js
CHANGED
|
@@ -24,7 +24,8 @@ export default class Tag extends PureComponent {
|
|
|
24
24
|
readOnly: false,
|
|
25
25
|
disabled: false,
|
|
26
26
|
focused: false,
|
|
27
|
-
|
|
27
|
+
interactive: true,
|
|
28
|
+
render: (props, interactive) => (interactive ? _jsx("button", { type: 'button', ...props }) : _jsx("span", { ...props })),
|
|
28
29
|
tagType: TagType.DEFAULT,
|
|
29
30
|
};
|
|
30
31
|
state = {
|
|
@@ -101,6 +102,7 @@ export default class Tag extends PureComponent {
|
|
|
101
102
|
const { backgroundColor, textColor, render } = this.props;
|
|
102
103
|
return (_jsxs("span", { className: classNames(styles.container, this.props.containerClassName, styles[this.props.tagType], {
|
|
103
104
|
[styles.outline]: this.props.outline,
|
|
105
|
+
[styles.interactive]: this.props.interactive,
|
|
104
106
|
}), children: [render({
|
|
105
107
|
'data-test': 'ring-tag',
|
|
106
108
|
className: classes,
|
|
@@ -109,6 +111,6 @@ export default class Tag extends PureComponent {
|
|
|
109
111
|
style: { backgroundColor, color: textColor },
|
|
110
112
|
disabled: this.props.disabled,
|
|
111
113
|
children: (_jsxs(_Fragment, { children: [this.renderAvatar(), this.renderCustomIcon(), this.renderImage(), _jsx("span", { className: styles.content, children: this.props.children })] })),
|
|
112
|
-
}), this.renderRemoveIcon()] }));
|
|
114
|
+
}, this.props.interactive), this.renderRemoveIcon()] }));
|
|
113
115
|
}
|
|
114
116
|
}
|