@jetbrains/ring-ui 8.0.0-beta.6 → 8.0.0-beta.8
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.
- package/babel.config.js +0 -8
- package/components/avatar/avatar-info.js +0 -2
- package/components/avatar/avatar-size.d.ts +0 -4
- package/components/avatar/avatar-size.js +0 -4
- package/components/avatar/avatar.js +0 -6
- package/components/avatar/fallback-avatar.js +0 -28
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/button/button.css +4 -4
- package/components/button/button.d.ts +0 -4
- package/components/button/button.js +2 -7
- package/components/global/variables.css +0 -10
- package/components/global/variables.interface.d.ts +0 -4
- package/components/global/variables_dark.css +0 -7
- package/components/icon/icon.css +0 -27
- package/components/icon/icon.d.ts +0 -1
- package/components/icon/icon.js +2 -4
- package/components/list/consts.d.ts +0 -1
- package/components/list/consts.js +0 -1
- package/components/list/list.d.ts +0 -4
- package/components/select/select-popup.d.ts +2 -1
- package/components/select/select-popup.js +3 -3
- package/components/select/select.d.ts +2 -0
- package/components/select/select.js +2 -4
- package/package.json +1 -4
- package/components/content-layout/content-layout.css +0 -109
- package/components/content-layout/content-layout.d.ts +0 -20
- package/components/content-layout/content-layout.js +0 -40
- package/components/content-layout/sidebar.d.ts +0 -26
- package/components/content-layout/sidebar.js +0 -71
- package/components/expand/collapsible-group.css +0 -76
- package/components/expand/collapsible-group.d.ts +0 -8
- package/components/expand/collapsible-group.js +0 -14
- package/components/grid/col.d.ts +0 -16
- package/components/grid/col.js +0 -35
- package/components/grid/grid.css +0 -920
- package/components/grid/grid.d.ts +0 -13
- package/components/grid/grid.js +0 -19
- package/components/grid/row.d.ts +0 -21
- package/components/grid/row.js +0 -41
- package/components/old-browsers-message/__mocks__/old-browsers-message.js +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.d.ts +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -2
- package/components/old-browsers-message/old-browsers-message.css +0 -26
- package/components/old-browsers-message/old-browsers-message.d.ts +0 -5
- package/components/old-browsers-message/old-browsers-message.js +0 -86
- package/components/old-browsers-message/white-list.d.ts +0 -2
- package/components/old-browsers-message/white-list.js +0 -24
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Component, type HTMLAttributes } from 'react';
|
|
2
|
-
export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
'data-test'?: string | null | undefined;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* @name Grid
|
|
7
|
-
* @deprecated Will be removed in Ring UI 8.0. Use flexbox or another layout library instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Grid extends Component<GridProps> {
|
|
10
|
-
render(): import("react").JSX.Element;
|
|
11
|
-
}
|
|
12
|
-
export { default as Row } from './row';
|
|
13
|
-
export { default as Col } from './col';
|
package/components/grid/grid.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import dataTests from '../global/data-tests';
|
|
4
|
-
import styles from './grid.css';
|
|
5
|
-
/**
|
|
6
|
-
* @name Grid
|
|
7
|
-
* @deprecated Will be removed in Ring UI 8.0. Use flexbox or another layout library instead.
|
|
8
|
-
*/
|
|
9
|
-
export class Grid extends Component {
|
|
10
|
-
render() {
|
|
11
|
-
const { children, className, 'data-test': dataTest, ...restProps } = this.props;
|
|
12
|
-
const classes = classNames(styles['container-fluid'], className);
|
|
13
|
-
return (<div data-test={dataTests('ring-grid', dataTest)} {...restProps} className={classes}>
|
|
14
|
-
{children}
|
|
15
|
-
</div>);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export { default as Row } from './row';
|
|
19
|
-
export { default as Col } from './col';
|
package/components/grid/row.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Component, type HTMLAttributes } from 'react';
|
|
2
|
-
type ModifierType = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
-
export interface RowProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
'data-test'?: string | null | undefined;
|
|
5
|
-
reverse?: boolean | null | undefined;
|
|
6
|
-
start?: ModifierType | null | undefined;
|
|
7
|
-
center?: ModifierType | null | undefined;
|
|
8
|
-
end?: ModifierType | null | undefined;
|
|
9
|
-
top?: ModifierType | null | undefined;
|
|
10
|
-
middle?: ModifierType | null | undefined;
|
|
11
|
-
baseline?: ModifierType | null | undefined;
|
|
12
|
-
bottom?: ModifierType | null | undefined;
|
|
13
|
-
around?: ModifierType | null | undefined;
|
|
14
|
-
between?: ModifierType | null | undefined;
|
|
15
|
-
first?: ModifierType | null | undefined;
|
|
16
|
-
last?: ModifierType | null | undefined;
|
|
17
|
-
}
|
|
18
|
-
export default class Row extends Component<RowProps> {
|
|
19
|
-
render(): import("react").JSX.Element;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/components/grid/row.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import dataTests from '../global/data-tests';
|
|
4
|
-
import styles from './grid.css';
|
|
5
|
-
const modifierKeys = [
|
|
6
|
-
'start',
|
|
7
|
-
'center',
|
|
8
|
-
'end', // text-align, justify-content
|
|
9
|
-
'around',
|
|
10
|
-
'between', // justify-content
|
|
11
|
-
'top',
|
|
12
|
-
'middle',
|
|
13
|
-
'baseline',
|
|
14
|
-
'bottom', // align-items
|
|
15
|
-
'first',
|
|
16
|
-
'last', // order
|
|
17
|
-
];
|
|
18
|
-
/**
|
|
19
|
-
* Converts xs="middle" to class "middle-xs"
|
|
20
|
-
* @param {Object} props incoming props
|
|
21
|
-
* @mockReturnValue {Array} result modifier classes
|
|
22
|
-
*/
|
|
23
|
-
function getModifierClassNames(props) {
|
|
24
|
-
return modifierKeys.reduce((result, key) => {
|
|
25
|
-
if (props[key]) {
|
|
26
|
-
return result.concat(styles[`${key}-${props[key]}`]);
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}, []);
|
|
30
|
-
}
|
|
31
|
-
export default class Row extends Component {
|
|
32
|
-
render() {
|
|
33
|
-
const { children, className, 'data-test': dataTest, reverse, start, center, end, top, middle, baseline, bottom, around, between, first, last, ...restProps } = this.props;
|
|
34
|
-
const classes = classNames(className, styles.row, getModifierClassNames({ start, center, end, top, middle, baseline, bottom, around, between, first, last }), {
|
|
35
|
-
[styles.reverse]: reverse,
|
|
36
|
-
});
|
|
37
|
-
return (<div {...restProps} className={classes} data-test={dataTests('ring-grid-row', dataTest)}>
|
|
38
|
-
{children}
|
|
39
|
-
</div>);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function stop() {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { stop as default } from './old-browsers-message';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
@import '../global/variables.css';
|
|
2
|
-
|
|
3
|
-
:global(.ring-old-browsers-message) {
|
|
4
|
-
display: block;
|
|
5
|
-
|
|
6
|
-
margin-top: 15%;
|
|
7
|
-
|
|
8
|
-
text-align: center;
|
|
9
|
-
|
|
10
|
-
color: var(--ring-text-color);
|
|
11
|
-
|
|
12
|
-
font-family: system-ui, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
|
|
13
|
-
font-size: var(--ring-font-size-larger);
|
|
14
|
-
line-height: calc(2.5 * var(--ring-unit));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:global(.ring-old-browsers-message_hidden) {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:global(.ring-old-browsers-message__smile) {
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
user-select: none;
|
|
24
|
-
|
|
25
|
-
font-size: calc(3 * var(--ring-unit));
|
|
26
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { isBrowserInWhiteList } from './white-list';
|
|
2
|
-
/**
|
|
3
|
-
* @name Old Browsers Message
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
The list of versions which are definitely supported. "Browser is unsupported"
|
|
7
|
-
won't be displayed for those and higher versions even when a JS error occurs
|
|
8
|
-
on application start.
|
|
9
|
-
*/
|
|
10
|
-
let smileChanges = 0;
|
|
11
|
-
const MAX_SMILE_CHANGES = 50;
|
|
12
|
-
let previousWindowErrorHandler;
|
|
13
|
-
function changeSmileClickListener(event) {
|
|
14
|
-
const eyes = ['O', 'o', '-', '>', '<'];
|
|
15
|
-
const target = (event.target || event.srcElement);
|
|
16
|
-
smileChanges++;
|
|
17
|
-
function rand(min, max) {
|
|
18
|
-
return Math.round(Math.random() * (max - min)) + min;
|
|
19
|
-
}
|
|
20
|
-
function getRandomEye() {
|
|
21
|
-
return eyes[rand(0, eyes.length - 1)];
|
|
22
|
-
}
|
|
23
|
-
function getRandomSmile() {
|
|
24
|
-
if (smileChanges >= MAX_SMILE_CHANGES) {
|
|
25
|
-
return '\\\\ (x_x) //';
|
|
26
|
-
}
|
|
27
|
-
return `{{ (${getRandomEye()}_${getRandomEye()}) }}`;
|
|
28
|
-
}
|
|
29
|
-
target.innerHTML = getRandomSmile();
|
|
30
|
-
}
|
|
31
|
-
function attachSmileClickListener(smileNode) {
|
|
32
|
-
if (smileNode.addEventListener) {
|
|
33
|
-
smileNode.addEventListener('click', changeSmileClickListener);
|
|
34
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
35
|
-
}
|
|
36
|
-
else if (smileNode.attachEvent) {
|
|
37
|
-
smileNode.attachEvent('onclick', changeSmileClickListener);
|
|
38
|
-
/* eslint-enable */
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Listens to unhandled errors and displays passed node
|
|
43
|
-
*/
|
|
44
|
-
function startOldBrowsersDetector(onOldBrowserDetected) {
|
|
45
|
-
previousWindowErrorHandler = window.onerror;
|
|
46
|
-
window.onerror = function oldBrowsersMessageShower(errorMsg, url, lineNumber) {
|
|
47
|
-
if (onOldBrowserDetected) {
|
|
48
|
-
onOldBrowserDetected();
|
|
49
|
-
}
|
|
50
|
-
if (previousWindowErrorHandler) {
|
|
51
|
-
return previousWindowErrorHandler(errorMsg, url, lineNumber);
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Will be removed in Ring UI 8.0.
|
|
58
|
-
*/
|
|
59
|
-
function stopOldBrowserDetector() {
|
|
60
|
-
window.onerror = previousWindowErrorHandler;
|
|
61
|
-
}
|
|
62
|
-
//Start javascript error detection
|
|
63
|
-
startOldBrowsersDetector(() => {
|
|
64
|
-
const oldBrowsersMessageContainer = document.getElementById('ring-old-browsers-message');
|
|
65
|
-
const browserMessage = document.getElementById('ring-old-browsers-message__browser-message');
|
|
66
|
-
const errorMessage = document.getElementById('ring-old-browsers-message__error-message');
|
|
67
|
-
const smileNode = document.getElementById('ring-old-browsers-message__smile');
|
|
68
|
-
if (browserMessage && errorMessage) {
|
|
69
|
-
if (isBrowserInWhiteList()) {
|
|
70
|
-
browserMessage.style.display = 'none';
|
|
71
|
-
errorMessage.style.display = 'block';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
browserMessage.style.display = 'block';
|
|
75
|
-
errorMessage.style.display = 'none';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (oldBrowsersMessageContainer) {
|
|
79
|
-
oldBrowsersMessageContainer.hidden = false;
|
|
80
|
-
oldBrowsersMessageContainer.style.display = 'block';
|
|
81
|
-
}
|
|
82
|
-
if (smileNode) {
|
|
83
|
-
attachSmileClickListener(smileNode);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
export { stopOldBrowserDetector as stop };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import sniffer from '../global/sniffer';
|
|
2
|
-
const MAJOR_VERSION_INDEX = 0;
|
|
3
|
-
/**
|
|
4
|
-
* SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
|
|
5
|
-
*/
|
|
6
|
-
if (!SUPPORTED_BROWSERS) {
|
|
7
|
-
// eslint-disable-next-line no-console
|
|
8
|
-
console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
|
|
9
|
-
}
|
|
10
|
-
const SUPPORTED = SUPPORTED_BROWSERS || [];
|
|
11
|
-
const WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
|
|
12
|
-
export const WHITE_LIST = SUPPORTED.reduce((acc, item) => {
|
|
13
|
-
const [, browserName, version] = item.match(/(\S+)\s(\S+)/) ?? [];
|
|
14
|
-
if (!WHITE_LISTED_BROWSERS.includes(browserName)) {
|
|
15
|
-
return acc;
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
...acc,
|
|
19
|
-
[browserName]: parseInt(version, 10),
|
|
20
|
-
};
|
|
21
|
-
}, {});
|
|
22
|
-
export function isBrowserInWhiteList() {
|
|
23
|
-
return sniffer.browser.version[MAJOR_VERSION_INDEX] >= WHITE_LIST[sniffer.browser.name];
|
|
24
|
-
}
|