@synerise/ds-utils 0.24.12 → 0.24.13
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.24.13](https://github.com/synerise/synerise-design/compare/@synerise/ds-utils@0.24.12...@synerise/ds-utils@0.24.13) (2023-08-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-utils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.24.12](https://github.com/synerise/synerise-design/compare/@synerise/ds-utils@0.24.11...@synerise/ds-utils@0.24.12) (2023-08-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-utils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-utils",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.13",
|
|
4
4
|
"description": "Utils UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react": ">=16.9.0 < 17.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@synerise/ds-core": "^0.39.
|
|
40
|
+
"@synerise/ds-core": "^0.39.13"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "9d424b025fe368bbf3beccea2102f000f4d7e82c"
|
|
43
43
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getPopupContainer } from './getPopupContainer';
|
|
2
|
-
describe('getPopupContainer utility', function () {
|
|
3
|
-
it('searches for closest parent with data-popup-container attribute', function () {
|
|
4
|
-
document.body.innerHTML = "\n <div id=\"A\">\n <div id=\"B\" data-popup-container>\n <div id=\"C\">\n <div id=\"popup\"></div>\n </div>\n </div>\n </div>\n ";
|
|
5
|
-
expect(getPopupContainer(document.getElementById('popup')).id).toBe('B');
|
|
6
|
-
});
|
|
7
|
-
it('returns document body when no parent is designated as a popup container', function () {
|
|
8
|
-
document.body.innerHTML = "\n <div id=\"A\">\n <div id=\"B\">\n <div id=\"C\">\n <div id=\"popup\"></div>\n </div>\n </div>\n </div>\n ";
|
|
9
|
-
expect(getPopupContainer(document.getElementById('popup'))).toBe(document.body);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { theme } from '@synerise/ds-core';
|
|
2
|
-
import selectColorByLetter, { palette } from './selectColorByLetter';
|
|
3
|
-
describe('selectColorByLetter', function () {
|
|
4
|
-
it('should return correct color for the given letter', function () {
|
|
5
|
-
expect(selectColorByLetter()).toBe(theme.palette['orange-500']);
|
|
6
|
-
expect(selectColorByLetter('*')).toBe(theme.palette['orange-500']);
|
|
7
|
-
|
|
8
|
-
for (var i = 0; i <= 25; i += 1) {
|
|
9
|
-
expect(selectColorByLetter(String.fromCharCode(i + 65))).toBe(theme.palette[palette[i % palette.length] + "-500"]);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
it('should return correct object with color and hue', function () {
|
|
13
|
-
expect(selectColorByLetter(undefined, true)).toStrictEqual({
|
|
14
|
-
color: 'orange',
|
|
15
|
-
hue: '500'
|
|
16
|
-
});
|
|
17
|
-
expect(selectColorByLetter('*', true)).toStrictEqual({
|
|
18
|
-
color: 'orange',
|
|
19
|
-
hue: '500'
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
for (var i = 0; i <= 25; i += 1) {
|
|
23
|
-
expect(selectColorByLetter(String.fromCharCode(i + 65), true)).toStrictEqual({
|
|
24
|
-
color: palette[i % palette.length],
|
|
25
|
-
hue: '500'
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import renderWithProvider from './renderWithProvider';
|
|
4
|
-
var Div = styled.div.withConfig({
|
|
5
|
-
displayName: "renderWithProviderspec__Div",
|
|
6
|
-
componentId: "k551ep-0"
|
|
7
|
-
})(["color:", ";"], function (props) {
|
|
8
|
-
return props.theme.palette['red-800'];
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var Component = function Component() {
|
|
12
|
-
return /*#__PURE__*/React.createElement(Div, null, "test");
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
describe('renderWithProvider', function () {
|
|
16
|
-
it('shoud render with theme provider', function () {
|
|
17
|
-
var C = renderWithProvider( /*#__PURE__*/React.createElement(Component, null));
|
|
18
|
-
expect(C).toBeTruthy();
|
|
19
|
-
});
|
|
20
|
-
});
|