@dxc-technology/halstack-react 0.0.0-59568e7 → 0.0.0-5aa300b
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/HalstackContext.js +7 -11
- package/accordion/Accordion.js +117 -104
- package/accordion/Accordion.stories.tsx +54 -15
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- package/accordion-group/AccordionGroup.js +2 -21
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +20 -45
- package/accordion-group/types.d.ts +10 -3
- package/alert/Alert.js +1 -1
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +1 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +94 -95
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +23 -33
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +50 -70
- package/button/Button.stories.tsx +61 -1
- package/button/types.d.ts +7 -7
- package/card/Card.js +34 -36
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +92 -99
- package/checkbox/Checkbox.stories.tsx +79 -59
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +6 -2
- package/chip/Chip.js +11 -23
- package/chip/Chip.stories.tsx +41 -9
- package/chip/types.d.ts +1 -1
- package/common/variables.js +186 -158
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +77 -222
- package/date-input/DateInput.stories.tsx +30 -17
- package/date-input/DateInput.test.js +411 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +53 -0
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +247 -249
- package/dropdown/Dropdown.stories.tsx +135 -64
- package/dropdown/Dropdown.test.js +504 -108
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +25 -5
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +53 -12
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +38 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/{radio → flex}/types.js +0 -0
- package/footer/Footer.stories.tsx +8 -1
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +74 -72
- package/header/Header.stories.tsx +4 -4
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +36 -36
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +16 -6
- package/layout/ApplicationLayout.js +70 -117
- package/layout/ApplicationLayout.stories.tsx +84 -93
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +18 -33
- package/link/Link.d.ts +2 -2
- package/link/Link.js +24 -50
- package/link/Link.stories.tsx +13 -6
- package/link/types.d.ts +3 -4
- package/main.d.ts +6 -9
- package/main.js +32 -56
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +16 -20
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +6 -12
- package/paginator/Paginator.test.js +43 -1
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.test.js +13 -12
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +3 -1
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.js +25 -20
- package/quick-nav/QuickNav.stories.tsx +131 -26
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +23 -22
- package/radio-group/RadioGroup.stories.tsx +1 -0
- package/radio-group/RadioGroup.test.js +123 -96
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -107
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +65 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +53 -7
- package/select/Option.js +8 -10
- package/select/Select.js +43 -43
- package/select/Select.stories.tsx +225 -136
- package/select/Select.test.js +363 -250
- package/select/types.d.ts +2 -5
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +182 -52
- package/sidenav/Sidenav.stories.tsx +163 -156
- package/sidenav/Sidenav.test.js +25 -37
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +120 -95
- package/slider/Slider.stories.tsx +7 -1
- package/slider/Slider.test.js +121 -21
- package/slider/types.d.ts +6 -2
- package/spinner/Spinner.js +2 -2
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +135 -68
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +144 -17
- package/switch/types.d.ts +6 -2
- package/table/Table.js +1 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +81 -5
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +172 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +128 -0
- package/tabs-nav/types.d.ts +53 -0
- package/{row → tabs-nav}/types.js +0 -0
- package/tag/Tag.js +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +38 -9
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +195 -292
- package/text-input/TextInput.stories.tsx +211 -185
- package/text-input/TextInput.test.js +737 -725
- package/text-input/types.d.ts +22 -3
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/{stack → typography}/types.js +0 -0
- package/wizard/Wizard.js +9 -16
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/types.d.ts +5 -4
- package/common/RequiredComponent.js +0 -32
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/list/types.d.ts +0 -7
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -173
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
- package/row/Row.d.ts +0 -3
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -237
- package/row/types.d.ts +0 -28
- package/stack/Stack.d.ts +0 -3
- package/stack/Stack.js +0 -97
- package/stack/Stack.stories.tsx +0 -164
- package/stack/types.d.ts +0 -24
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
package/package.json
CHANGED
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxc-technology/halstack-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5aa300b",
|
|
4
4
|
"description": "DXC Halstack React components library",
|
|
5
5
|
"repository": "dxc-technology/halstack-react",
|
|
6
|
-
"homepage": "
|
|
6
|
+
"homepage": "https://developer.dxc.com/halstack",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "DXC Technology",
|
|
10
10
|
"email": "DigitalInsurance@dxc.com",
|
|
11
|
-
"url": "https://dxc.com"
|
|
11
|
+
"url": "https://developer.dxc.com"
|
|
12
12
|
},
|
|
13
13
|
"main": "./main.js",
|
|
14
14
|
"types": "./main.d.ts",
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"react": "^
|
|
17
|
-
"react-dom": "^
|
|
16
|
+
"react": "^18.x",
|
|
17
|
+
"react-dom": "^18.x",
|
|
18
18
|
"styled-components": "^5.0.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@material-ui/core": "4.11.1",
|
|
23
|
-
"@material-ui/icons": "4.4.3",
|
|
24
|
-
"@material-ui/lab": "4.0.0-alpha.17",
|
|
25
|
-
"@material-ui/pickers": "3.2.2",
|
|
26
|
-
"@material-ui/styles": "4.0.2",
|
|
21
|
+
"@radix-ui/react-popover": "0.1.6",
|
|
27
22
|
"@types/styled-components": "^5.1.24",
|
|
28
23
|
"@types/uuid": "^8.3.4",
|
|
29
24
|
"color": "^3.1.3",
|
|
30
25
|
"dayjs": "^1.11.1",
|
|
31
|
-
"prop-types": "^15.7.2",
|
|
32
26
|
"rgb-hex": "^3.0.0",
|
|
33
27
|
"slugify": "^1.6.5",
|
|
34
28
|
"uuid": "^8.3.2"
|
|
35
29
|
},
|
|
36
30
|
"scripts": {
|
|
37
|
-
"test": "jest",
|
|
31
|
+
"test": "jest --env=jsdom",
|
|
38
32
|
"test:watch": "npm test -- --watch --coverage",
|
|
39
33
|
"build": "babel src --extensions .js,.jsx,.ts,.tsx --out-dir ../dist --copy-files --verbose && node ../scripts/build/copy-package.js && tsc ",
|
|
40
34
|
"build:watch": "babel src --watch --extensions .js,.jsx,.ts,.tsx --out-dir ../dist --copy-files --verbose",
|
|
@@ -55,9 +49,9 @@
|
|
|
55
49
|
"@storybook/addon-links": "^6.4.9",
|
|
56
50
|
"@storybook/react": "^6.4.9",
|
|
57
51
|
"@storybook/testing-library": "0.0.7",
|
|
58
|
-
"@testing-library/react": "^
|
|
59
|
-
"@testing-library/user-event": "^
|
|
60
|
-
"@types/react": "
|
|
52
|
+
"@testing-library/react": "^13.0.0",
|
|
53
|
+
"@testing-library/user-event": "^13.0.0",
|
|
54
|
+
"@types/react": "^18.0.18",
|
|
61
55
|
"babel-jest": "^24.8.0",
|
|
62
56
|
"babel-loader": "^8.0.6",
|
|
63
57
|
"chromatic": "^6.3.3",
|
|
@@ -71,9 +65,10 @@
|
|
|
71
65
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
72
66
|
"eslint-plugin-storybook": "^0.5.5",
|
|
73
67
|
"identity-obj-proxy": "^3.0.0",
|
|
74
|
-
"jest": "^
|
|
75
|
-
"
|
|
76
|
-
"react
|
|
68
|
+
"jest": "^29.2.2",
|
|
69
|
+
"jest-environment-jsdom": "^29.3.1",
|
|
70
|
+
"react": "^18.x",
|
|
71
|
+
"react-dom": "^18.x",
|
|
77
72
|
"react-test-renderer": "^16.8.6",
|
|
78
73
|
"storybook-addon-pseudo-states": "^1.0.0",
|
|
79
74
|
"styled-components": "^5.0.1",
|
|
@@ -83,7 +78,8 @@
|
|
|
83
78
|
"moduleNameMapper": {
|
|
84
79
|
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
|
|
85
80
|
"\\.(svg)$": "<rootDir>/test/mocks/svgMock.js",
|
|
86
|
-
"\\.(png)$": "<rootDir>/test/mocks/pngMock.js"
|
|
81
|
+
"\\.(png)$": "<rootDir>/test/mocks/pngMock.js",
|
|
82
|
+
"^uuid$": "uuid"
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
}
|
package/paginator/Icons.js
CHANGED
|
@@ -11,56 +11,44 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var firstIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
height: "24",
|
|
15
|
+
width: "24",
|
|
16
|
+
fill: "currentColor"
|
|
17
17
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
18
|
-
|
|
19
|
-
"data-name": "Path 2463",
|
|
20
|
-
d: "M18.41,16.59,13.82,12l4.59-4.59L17,6l-6,6,6,6ZM6,6H8V18H6Z",
|
|
21
|
-
transform: "translate(-6 -6)"
|
|
18
|
+
d: "M6 18V6h2v12Zm11 0-6-6 6-6 1.4 1.4-4.6 4.6 4.6 4.6Z"
|
|
22
19
|
}));
|
|
23
20
|
|
|
24
21
|
exports.firstIcon = firstIcon;
|
|
25
22
|
|
|
26
23
|
var previousIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
27
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
height: "24",
|
|
26
|
+
width: "24",
|
|
27
|
+
fill: "currentColor"
|
|
31
28
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
32
|
-
|
|
33
|
-
"data-name": "Path 2459",
|
|
34
|
-
d: "M15.41,7.41,14,6,8,12l6,6,1.41-1.41L10.83,12Z",
|
|
35
|
-
transform: "translate(-8 -6)"
|
|
29
|
+
d: "m14 18-6-6 6-6 1.4 1.4-4.6 4.6 4.6 4.6Z"
|
|
36
30
|
}));
|
|
37
31
|
|
|
38
32
|
exports.previousIcon = previousIcon;
|
|
39
33
|
|
|
40
34
|
var nextIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
41
35
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
height: "24",
|
|
37
|
+
width: "24",
|
|
38
|
+
fill: "currentColor"
|
|
45
39
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
46
|
-
|
|
47
|
-
"data-name": "Path 2461",
|
|
48
|
-
d: "M10,6,8.59,7.41,13.17,12,8.59,16.59,10,18l6-6Z",
|
|
49
|
-
transform: "translate(-8.59 -6)"
|
|
40
|
+
d: "M9.4 18 8 16.6l4.6-4.6L8 7.4 9.4 6l6 6Z"
|
|
50
41
|
}));
|
|
51
42
|
|
|
52
43
|
exports.nextIcon = nextIcon;
|
|
53
44
|
|
|
54
45
|
var lastIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
55
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
height: "24",
|
|
48
|
+
width: "24",
|
|
49
|
+
fill: "currentColor"
|
|
59
50
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
60
|
-
|
|
61
|
-
"data-name": "Path 2465",
|
|
62
|
-
d: "M5.59,7.41,10.18,12,5.59,16.59,7,18l6-6L7,6ZM16,6h2V18H16Z",
|
|
63
|
-
transform: "translate(-5.59 -6)"
|
|
51
|
+
d: "m7 18-1.4-1.4 4.6-4.6-4.6-4.6L7 6l6 6Zm9 0V6h2v12Z"
|
|
64
52
|
}));
|
|
65
53
|
|
|
66
54
|
exports.lastIcon = lastIcon;
|
package/paginator/Paginator.js
CHANGED
|
@@ -27,7 +27,7 @@ var _Icons = require("./Icons");
|
|
|
27
27
|
|
|
28
28
|
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
29
29
|
|
|
30
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
31
31
|
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
@@ -72,7 +72,6 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
72
72
|
size: "fillParent",
|
|
73
73
|
tabIndex: tabIndex
|
|
74
74
|
}))), /*#__PURE__*/_react["default"].createElement(TotalItemsContainer, null, translatedLabels.paginator.minToMaxOfText(minItemsPerPage, maxItemsPerPage, totalItems)), onPageChange && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
75
|
-
size: "small",
|
|
76
75
|
mode: "secondary",
|
|
77
76
|
disabled: currentPageInternal === 1 || currentPageInternal === 0,
|
|
78
77
|
icon: _Icons.firstIcon,
|
|
@@ -81,7 +80,6 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
81
80
|
onPageChange(1);
|
|
82
81
|
}
|
|
83
82
|
}), onPageChange && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
84
|
-
size: "small",
|
|
85
83
|
mode: "secondary",
|
|
86
84
|
disabled: currentPageInternal === 1 || currentPageInternal === 0,
|
|
87
85
|
icon: _Icons.previousIcon,
|
|
@@ -89,7 +87,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
89
87
|
onClick: function onClick() {
|
|
90
88
|
onPageChange(currentPage - 1);
|
|
91
89
|
}
|
|
92
|
-
}), showGoToPage
|
|
90
|
+
}), showGoToPage ? /*#__PURE__*/_react["default"].createElement(PageToSelectContainer, null, /*#__PURE__*/_react["default"].createElement(GoToLabel, null, translatedLabels.paginator.goToPageText, " "), /*#__PURE__*/_react["default"].createElement(SelectContainer, null, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
93
91
|
options: Array.from(Array(totalPages), function (e, num) {
|
|
94
92
|
return {
|
|
95
93
|
label: (num + 1).toString(),
|
|
@@ -102,8 +100,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
102
100
|
value: currentPage.toString(),
|
|
103
101
|
size: "fillParent",
|
|
104
102
|
tabIndex: tabIndex
|
|
105
|
-
})))
|
|
106
|
-
size: "small",
|
|
103
|
+
}))) : /*#__PURE__*/_react["default"].createElement("span", null, translatedLabels.paginator.pageOfText(currentPageInternal, totalPages)), onPageChange && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
107
104
|
mode: "secondary",
|
|
108
105
|
disabled: currentPageInternal === totalPages,
|
|
109
106
|
icon: _Icons.nextIcon,
|
|
@@ -112,7 +109,6 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
112
109
|
onPageChange(currentPage + 1);
|
|
113
110
|
}
|
|
114
111
|
}), onPageChange && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
115
|
-
size: "small",
|
|
116
112
|
mode: "secondary",
|
|
117
113
|
disabled: currentPageInternal === totalPages,
|
|
118
114
|
icon: _Icons.lastIcon,
|
|
@@ -145,7 +141,7 @@ var DxcPaginatorContainer = _styledComponents["default"].div(_templateObject ||
|
|
|
145
141
|
|
|
146
142
|
var SelectContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n min-width: 5.25rem;\n"])));
|
|
147
143
|
|
|
148
|
-
var ItemsPageContainer = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n margin-left: ", ";\n
|
|
144
|
+
var ItemsPageContainer = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
149
145
|
return props.theme.itemsPerPageSelectorMarginRight;
|
|
150
146
|
}, function (props) {
|
|
151
147
|
return props.theme.itemsPerPageSelectorMarginLeft;
|
|
@@ -153,7 +149,7 @@ var ItemsPageContainer = _styledComponents["default"].span(_templateObject3 || (
|
|
|
153
149
|
|
|
154
150
|
var ItemsLabel = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n"])));
|
|
155
151
|
|
|
156
|
-
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left:
|
|
152
|
+
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left: 0.5rem;\n"])));
|
|
157
153
|
|
|
158
154
|
var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
159
155
|
return props.theme.totalItemsContainerMarginRight;
|
|
@@ -163,9 +159,7 @@ var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 ||
|
|
|
163
159
|
|
|
164
160
|
var LabelsContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n gap: 0.5rem;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n"])));
|
|
165
161
|
|
|
166
|
-
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n
|
|
167
|
-
|
|
168
|
-
var TextContainer = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
162
|
+
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-right: 0.5rem;\n"])));
|
|
169
163
|
|
|
170
164
|
var _default = DxcPaginator;
|
|
171
165
|
exports["default"] = _default;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
6
|
+
|
|
7
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
+
|
|
5
9
|
var _react = _interopRequireDefault(require("react"));
|
|
6
10
|
|
|
7
11
|
var _react2 = require("@testing-library/react");
|
|
@@ -10,6 +14,44 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
10
14
|
|
|
11
15
|
var _Paginator = _interopRequireDefault(require("./Paginator"));
|
|
12
16
|
|
|
17
|
+
// Mocking DOMRect for Radix Primitive Popover
|
|
18
|
+
global.globalThis = global;
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = /*#__PURE__*/function () {
|
|
21
|
+
function ResizeObserver(cb) {
|
|
22
|
+
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
23
|
+
this.cb = cb;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
(0, _createClass2["default"])(ResizeObserver, [{
|
|
27
|
+
key: "observe",
|
|
28
|
+
value: function observe() {
|
|
29
|
+
this.cb([{
|
|
30
|
+
borderBoxSize: {
|
|
31
|
+
inlineSize: 0,
|
|
32
|
+
blockSize: 0
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "unobserve",
|
|
38
|
+
value: function unobserve() {}
|
|
39
|
+
}]);
|
|
40
|
+
return ResizeObserver;
|
|
41
|
+
}();
|
|
42
|
+
|
|
43
|
+
global.DOMRect = {
|
|
44
|
+
fromRect: function fromRect() {
|
|
45
|
+
return {
|
|
46
|
+
top: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
right: 0,
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
13
55
|
describe("Paginator component tests", function () {
|
|
14
56
|
test("Paginator renders with default values", function () {
|
|
15
57
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], null)),
|
|
@@ -35,7 +77,7 @@ describe("Paginator component tests", function () {
|
|
|
35
77
|
})),
|
|
36
78
|
getByText = _render3.getByText;
|
|
37
79
|
|
|
38
|
-
expect(getByText("Items per page")).toBeTruthy();
|
|
80
|
+
expect(getByText("Items per page:")).toBeTruthy();
|
|
39
81
|
});
|
|
40
82
|
test("Paginator renders with itemsPerPageOptions", function () {
|
|
41
83
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
15
|
+
|
|
16
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
17
|
+
|
|
18
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var Paragraph = function Paragraph(_ref) {
|
|
25
|
+
var children = _ref.children;
|
|
26
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
27
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
29
|
+
as: "p",
|
|
30
|
+
display: colorsTheme.paragraph.display,
|
|
31
|
+
fontSize: colorsTheme.paragraph.fontSize,
|
|
32
|
+
fontWeight: colorsTheme.paragraph.fontWeight,
|
|
33
|
+
color: backgroundType && backgroundType === "dark" ? colorsTheme.paragraph.fontColorOnDark : colorsTheme.paragraph.fontColor
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var _default = Paragraph;
|
|
38
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import DxcParagraph from "./Paragraph";
|
|
4
|
+
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Paragraph",
|
|
10
|
+
component: DxcParagraph,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Chromatic = () => (
|
|
14
|
+
<>
|
|
15
|
+
<ExampleContainer>
|
|
16
|
+
<Title title="Default Paragraph" level={4} />
|
|
17
|
+
<DxcParagraph>
|
|
18
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id tortor sit amet velit auctor cursus id eget
|
|
19
|
+
nisl. Vivamus luctus egestas eros, at mattis libero eleifend ac. Integer vel urna rutrum, pretium arcu
|
|
20
|
+
dignissim, fringilla turpis. Nullam luctus odio quis magna finibus, a pharetra magna euismod. Nullam efficitur
|
|
21
|
+
semper pellentesque. Nulla eget arcu ac diam fringilla vehicula. In imperdiet nisl hendrerit, elementum metus
|
|
22
|
+
eu, ornare risus. Aenean neque nibh, vestibulum vitae elit vel, imperdiet suscipit leo. Curabitur blandit
|
|
23
|
+
iaculis pretium. Fusce id imperdiet dui, ut laoreet justo. Sed maximus sollicitudin ipsum, et varius massa
|
|
24
|
+
condimentum eget. Vivamus id mauris et nisl mattis consequat et id lectus. Quisque mollis lacinia nisl.
|
|
25
|
+
Suspendisse sed quam tincidunt, commodo dolor vel, tincidunt nisl.
|
|
26
|
+
</DxcParagraph>
|
|
27
|
+
</ExampleContainer>
|
|
28
|
+
<BackgroundColorProvider color="#333333">
|
|
29
|
+
<DarkContainer>
|
|
30
|
+
<Title title="Default Paragraph" theme="dark" level={4} />
|
|
31
|
+
<DxcParagraph>
|
|
32
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id tortor sit amet velit auctor cursus id eget
|
|
33
|
+
nisl. Vivamus luctus egestas eros, at mattis libero eleifend ac. Integer vel urna rutrum, pretium arcu
|
|
34
|
+
dignissim, fringilla turpis. Nullam luctus odio quis magna finibus, a pharetra magna euismod. Nullam efficitur
|
|
35
|
+
semper pellentesque. Nulla eget arcu ac diam fringilla vehicula. In imperdiet nisl hendrerit, elementum metus
|
|
36
|
+
eu, ornare risus. Aenean neque nibh, vestibulum vitae elit vel, imperdiet suscipit leo. Curabitur blandit
|
|
37
|
+
iaculis pretium. Fusce id imperdiet dui, ut laoreet justo. Sed maximus sollicitudin ipsum, et varius massa
|
|
38
|
+
condimentum eget. Vivamus id mauris et nisl mattis consequat et id lectus. Quisque mollis lacinia nisl.
|
|
39
|
+
Suspendisse sed quam tincidunt, commodo dolor vel, tincidunt nisl.
|
|
40
|
+
</DxcParagraph>
|
|
41
|
+
</DarkContainer>
|
|
42
|
+
</BackgroundColorProvider>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
@@ -46,9 +46,9 @@ describe("Password input component tests", function () {
|
|
|
46
46
|
label: "Password input",
|
|
47
47
|
onChange: onChange
|
|
48
48
|
})),
|
|
49
|
-
|
|
49
|
+
getByLabelText = _render4.getByLabelText;
|
|
50
50
|
|
|
51
|
-
var passwordInput =
|
|
51
|
+
var passwordInput = getByLabelText("Password input");
|
|
52
52
|
|
|
53
53
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
54
54
|
|
|
@@ -64,9 +64,9 @@ describe("Password input component tests", function () {
|
|
|
64
64
|
label: "Password input",
|
|
65
65
|
onBlur: onBlur
|
|
66
66
|
})),
|
|
67
|
-
|
|
67
|
+
getByLabelText = _render5.getByLabelText;
|
|
68
68
|
|
|
69
|
-
var passwordInput =
|
|
69
|
+
var passwordInput = getByLabelText("Password input");
|
|
70
70
|
|
|
71
71
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
72
72
|
|
|
@@ -83,9 +83,9 @@ describe("Password input component tests", function () {
|
|
|
83
83
|
clearable: true
|
|
84
84
|
})),
|
|
85
85
|
getAllByRole = _render6.getAllByRole,
|
|
86
|
-
|
|
86
|
+
getByLabelText = _render6.getByLabelText;
|
|
87
87
|
|
|
88
|
-
var passwordInput =
|
|
88
|
+
var passwordInput = getByLabelText("Password input");
|
|
89
89
|
|
|
90
90
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
91
91
|
|
|
@@ -101,9 +101,9 @@ describe("Password input component tests", function () {
|
|
|
101
101
|
label: "Password input"
|
|
102
102
|
})),
|
|
103
103
|
getAllByRole = _render7.getAllByRole,
|
|
104
|
-
|
|
104
|
+
getByLabelText = _render7.getByLabelText;
|
|
105
105
|
|
|
106
|
-
var passwordInput =
|
|
106
|
+
var passwordInput = getByLabelText("Password input");
|
|
107
107
|
|
|
108
108
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
109
109
|
|
|
@@ -117,9 +117,9 @@ describe("Password input component tests", function () {
|
|
|
117
117
|
clearable: true
|
|
118
118
|
})),
|
|
119
119
|
getAllByRole = _render8.getAllByRole,
|
|
120
|
-
|
|
120
|
+
getByLabelText = _render8.getByLabelText;
|
|
121
121
|
|
|
122
|
-
var passwordInput =
|
|
122
|
+
var passwordInput = getByLabelText("Password input");
|
|
123
123
|
|
|
124
124
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
125
125
|
|
|
@@ -164,9 +164,10 @@ describe("Password input component tests", function () {
|
|
|
164
164
|
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_PasswordInput["default"], {
|
|
165
165
|
label: "Password input"
|
|
166
166
|
})),
|
|
167
|
-
getByRole = _render10.getByRole
|
|
167
|
+
getByRole = _render10.getByRole,
|
|
168
|
+
getByLabelText = _render10.getByLabelText;
|
|
168
169
|
|
|
169
|
-
var passwordInput =
|
|
170
|
+
var passwordInput = getByLabelText("Password input");
|
|
170
171
|
expect(passwordInput.getAttribute("aria-autocomplete")).toBeNull();
|
|
171
172
|
expect(passwordInput.getAttribute("aria-controls")).toBeNull();
|
|
172
173
|
expect(passwordInput.getAttribute("aria-expanded")).toBeNull();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare const DxcProgressBar: ({ label, helperText, overlay, value, showValue, margin, }:
|
|
2
|
+
import { Props } from "./types";
|
|
3
|
+
declare const DxcProgressBar: ({ label, helperText, overlay, value, showValue, margin, }: Props) => JSX.Element;
|
|
4
4
|
export default DxcProgressBar;
|