@digigov/react-core 0.21.1 → 0.22.1
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/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/AccessibilityIcon/index.d.ts +15 -0
- package/AccessibilityIcon/index.js +52 -0
- package/AccessibilityIcon/index.test.d.ts +1 -0
- package/AccessibilityIcon/index.test.js +137 -0
- package/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/AccessibilityTextIcon/index.d.ts +15 -0
- package/AccessibilityTextIcon/index.js +34 -0
- package/AccessibilityTextIcon/index.test.d.ts +1 -0
- package/AccessibilityTextIcon/index.test.js +129 -0
- package/CHANGELOG.md +14 -1
- package/DetailsSummary/index.d.ts +2 -1
- package/DetailsSummary/index.js +4 -3
- package/FieldContainer/index.js +10 -3
- package/Nav/index.d.ts +16 -1
- package/Nav/index.js +8 -2
- package/SectionBreak/index.d.ts +1 -1
- package/SectionBreak/index.js +4 -2
- package/SvgIcon/index.d.ts +1 -1
- package/es/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/es/AccessibilityIcon/index.js +36 -0
- package/es/AccessibilityIcon/index.test.js +131 -0
- package/es/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/es/AccessibilityTextIcon/index.js +21 -0
- package/es/AccessibilityTextIcon/index.test.js +123 -0
- package/es/DetailsSummary/index.js +4 -3
- package/es/FieldContainer/index.js +8 -3
- package/es/Nav/index.js +8 -2
- package/es/SectionBreak/index.js +4 -2
- package/es/index.js +2 -0
- package/es/registry.js +4 -0
- package/esm/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/esm/AccessibilityIcon/index.js +36 -0
- package/esm/AccessibilityIcon/index.test.js +131 -0
- package/esm/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/esm/AccessibilityTextIcon/index.js +21 -0
- package/esm/AccessibilityTextIcon/index.test.js +123 -0
- package/esm/DetailsSummary/index.js +4 -3
- package/esm/FieldContainer/index.js +8 -3
- package/esm/Nav/index.js +8 -2
- package/esm/SectionBreak/index.js +4 -2
- package/esm/index.js +3 -1
- package/esm/registry.js +4 -0
- package/index.d.ts +2 -0
- package/index.js +26 -0
- package/package.json +2 -2
- package/registry.d.ts +2 -0
- package/registry.js +6 -0
- package/src/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/src/AccessibilityIcon/index.test.tsx +53 -0
- package/src/AccessibilityIcon/index.tsx +41 -0
- package/src/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/src/AccessibilityTextIcon/index.test.tsx +50 -0
- package/src/AccessibilityTextIcon/index.tsx +28 -0
- package/src/DetailsSummary/index.tsx +8 -2
- package/src/FieldContainer/index.tsx +2 -1
- package/src/Nav/index.tsx +29 -2
- package/src/SectionBreak/index.tsx +5 -2
- package/src/SvgIcon/index.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/registry.js +4 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import AccessibilityTextIcon from '@digigov/react-core/AccessibilityTextIcon';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(AccessibilityTextIcon, null);
|
|
6
|
+
|
|
7
|
+
it('renders the AccessibilityTextIcon with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
12
|
+
size: "s"
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders the AccessibilityTextIcon with prop size=s', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
20
|
+
size: "m"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders the AccessibilityTextIcon with prop size=m', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
28
|
+
size: "l"
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders the AccessibilityTextIcon with prop size=l', function () {
|
|
32
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var _ref5 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
36
|
+
size: "xl"
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders the AccessibilityTextIcon with prop size=xl', function () {
|
|
40
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _ref6 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
44
|
+
variant: "dark"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('renders the AccessibilityTextIcon with prop variant=dark', function () {
|
|
48
|
+
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var _ref7 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
52
|
+
variant: "light"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders the AccessibilityTextIcon with prop variant=light', function () {
|
|
56
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _ref8 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
60
|
+
variant: "gray"
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders the AccessibilityTextIcon with prop variant=gray', function () {
|
|
64
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var _ref9 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
68
|
+
variant: "primary"
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('renders the AccessibilityTextIcon with prop variant=primary', function () {
|
|
72
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
var _ref10 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
76
|
+
variant: "success"
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders the AccessibilityTextIcon with prop variant=success', function () {
|
|
80
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _ref11 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
84
|
+
variant: "warning"
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('renders the AccessibilityTextIcon with prop variant=warning', function () {
|
|
88
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var _ref12 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
92
|
+
variant: "error"
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('renders the AccessibilityTextIcon with prop variant=error', function () {
|
|
96
|
+
expect(mount(_ref12)).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
var _ref13 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
100
|
+
variant: "focus"
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('renders the AccessibilityTextIcon with prop variant=focus', function () {
|
|
104
|
+
expect(mount(_ref13)).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
var _ref14 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
108
|
+
variant: "warning",
|
|
109
|
+
size: "s"
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('renders the AccessibilityTextIcon with prop variant=warning and size=s', function () {
|
|
113
|
+
expect(mount(_ref14)).toMatchSnapshot();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
var _ref15 = /*#__PURE__*/React.createElement(AccessibilityTextIcon, {
|
|
117
|
+
variant: "warning",
|
|
118
|
+
size: "xl"
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('renders the AccessibilityTextIcon with prop variant=error and size= xl', function () {
|
|
122
|
+
expect(mount(_ref15)).toMatchSnapshot();
|
|
123
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["size", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -9,14 +9,15 @@ import clsx from 'clsx';
|
|
|
9
9
|
* Use this inside Details.DetailsSummary will be the text to click on.
|
|
10
10
|
*/
|
|
11
11
|
export var DetailsSummary = /*#__PURE__*/React.forwardRef(function DetailsSummary(_ref, ref) {
|
|
12
|
-
var
|
|
12
|
+
var size = _ref.size,
|
|
13
|
+
className = _ref.className,
|
|
13
14
|
children = _ref.children,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
|
|
16
17
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
17
18
|
as: "summary",
|
|
18
19
|
ref: ref,
|
|
19
|
-
className: clsx(className, true && 'govgr-details__summary')
|
|
20
|
+
className: clsx(className, size === 'l' && 'govgr-details__summary--l', true && 'govgr-details__summary')
|
|
20
21
|
}, props), children);
|
|
21
22
|
});
|
|
22
23
|
export default DetailsSummary;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["error", "className", "children", "xs", "md", "lg", "xl"];
|
|
1
4
|
import React from 'react';
|
|
2
5
|
import clsx from 'clsx';
|
|
3
6
|
import Grid from '@digigov/react-core/Grid';
|
|
@@ -16,8 +19,10 @@ export var FieldContainer = /*#__PURE__*/React.forwardRef(function FieldContaine
|
|
|
16
19
|
_ref$lg = _ref.lg,
|
|
17
20
|
lg = _ref$lg === void 0 ? 12 : _ref$lg,
|
|
18
21
|
_ref$xl = _ref.xl,
|
|
19
|
-
xl = _ref$xl === void 0 ? 12 : _ref$xl
|
|
20
|
-
|
|
22
|
+
xl = _ref$xl === void 0 ? 12 : _ref$xl,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(Grid, _extends({
|
|
21
26
|
ref: ref,
|
|
22
27
|
className: clsx(className, error === true && 'govgr-field__error', true && 'govgr-field'),
|
|
23
28
|
item: true,
|
|
@@ -25,6 +30,6 @@ export var FieldContainer = /*#__PURE__*/React.forwardRef(function FieldContaine
|
|
|
25
30
|
md: md,
|
|
26
31
|
lg: lg,
|
|
27
32
|
xl: xl
|
|
28
|
-
}, children);
|
|
33
|
+
}, props), children);
|
|
29
34
|
});
|
|
30
35
|
export default FieldContainer;
|
package/esm/Nav/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "open", "layout", "children"];
|
|
3
|
+
var _excluded = ["className", "open", "layout", "hidden", "fixed", "border", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -15,13 +15,19 @@ export var Nav = /*#__PURE__*/React.forwardRef(function Nav(_ref, ref) {
|
|
|
15
15
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
16
16
|
_ref$layout = _ref.layout,
|
|
17
17
|
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
18
|
+
_ref$hidden = _ref.hidden,
|
|
19
|
+
hidden = _ref$hidden === void 0 ? false : _ref$hidden,
|
|
20
|
+
_ref$fixed = _ref.fixed,
|
|
21
|
+
fixed = _ref$fixed === void 0 ? true : _ref$fixed,
|
|
22
|
+
_ref$border = _ref.border,
|
|
23
|
+
border = _ref$border === void 0 ? true : _ref$border,
|
|
18
24
|
children = _ref.children,
|
|
19
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
26
|
|
|
21
27
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
22
28
|
as: "nav",
|
|
23
29
|
ref: ref,
|
|
24
|
-
className: clsx(className, layout === 'horizontal' && 'govgr-nav-horizontal--border', true && 'govgr-horizontal-nav', open && 'govgr-horizontal-nav--open')
|
|
30
|
+
className: clsx(className, layout === 'horizontal' && 'govgr-horizontal-nav--order', border && 'govgr-nav-horizontal--border', hidden && 'govgr-horizontal-nav--hidden', fixed && 'govgr-nav-horizontal--fixed', true && 'govgr-horizontal-nav', open && 'govgr-horizontal-nav--open')
|
|
25
31
|
}, props), children);
|
|
26
32
|
});
|
|
27
33
|
export default Nav;
|
|
@@ -9,8 +9,10 @@ import clsx from 'clsx';
|
|
|
9
9
|
* SectionBreak is used to create a thematic break between sections of content.
|
|
10
10
|
*/
|
|
11
11
|
export var SectionBreak = /*#__PURE__*/React.forwardRef(function SectionBreak(_ref, ref) {
|
|
12
|
-
var visible = _ref.visible,
|
|
13
|
-
|
|
12
|
+
var _ref$visible = _ref.visible,
|
|
13
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
14
|
+
_ref$size = _ref.size,
|
|
15
|
+
size = _ref$size === void 0 ? 's' : _ref$size,
|
|
14
16
|
className = _ref.className,
|
|
15
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
18
|
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
/** @license Digigov v0.
|
|
1
|
+
/** @license Digigov v0.22.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the BSD-2-Clause license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
5
5
|
*/
|
|
6
|
+
export * from '@digigov/react-core/AccessibilityIcon';
|
|
7
|
+
export * from '@digigov/react-core/AccessibilityTextIcon';
|
|
6
8
|
export * from '@digigov/react-core/Accordion';
|
|
7
9
|
export * from '@digigov/react-core/AccordionControls';
|
|
8
10
|
export * from '@digigov/react-core/AccordionSection';
|
package/esm/registry.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as _digigov_react_core_AccessibilityIcon from '@digigov/react-core/AccessibilityIcon';
|
|
2
|
+
import * as _digigov_react_core_AccessibilityTextIcon from '@digigov/react-core/AccessibilityTextIcon';
|
|
1
3
|
import * as _digigov_react_core_Accordion from '@digigov/react-core/Accordion';
|
|
2
4
|
import * as _digigov_react_core_AccordionControls from '@digigov/react-core/AccordionControls';
|
|
3
5
|
import * as _digigov_react_core_AccordionSection from '@digigov/react-core/AccordionSection';
|
|
@@ -172,6 +174,8 @@ function lazyImport(pkgImport) {
|
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
export default {
|
|
177
|
+
'@digigov/react-core/AccessibilityIcon': lazyImport(_digigov_react_core_AccessibilityIcon),
|
|
178
|
+
'@digigov/react-core/AccessibilityTextIcon': lazyImport(_digigov_react_core_AccessibilityTextIcon),
|
|
175
179
|
'@digigov/react-core/Accordion': lazyImport(_digigov_react_core_Accordion),
|
|
176
180
|
'@digigov/react-core/AccordionControls': lazyImport(_digigov_react_core_AccordionControls),
|
|
177
181
|
'@digigov/react-core/AccordionSection': lazyImport(_digigov_react_core_AccordionSection),
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from '@digigov/react-core/AccessibilityIcon';
|
|
2
|
+
export * from '@digigov/react-core/AccessibilityTextIcon';
|
|
1
3
|
export * from '@digigov/react-core/Accordion';
|
|
2
4
|
export * from '@digigov/react-core/AccordionControls';
|
|
3
5
|
export * from '@digigov/react-core/AccordionSection';
|
package/index.js
CHANGED
|
@@ -4,6 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
var _AccessibilityIcon = require("@digigov/react-core/AccessibilityIcon");
|
|
8
|
+
|
|
9
|
+
Object.keys(_AccessibilityIcon).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _AccessibilityIcon[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _AccessibilityIcon[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _AccessibilityTextIcon = require("@digigov/react-core/AccessibilityTextIcon");
|
|
21
|
+
|
|
22
|
+
Object.keys(_AccessibilityTextIcon).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _AccessibilityTextIcon[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _AccessibilityTextIcon[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
7
33
|
var _Accordion = require("@digigov/react-core/Accordion");
|
|
8
34
|
|
|
9
35
|
Object.keys(_Accordion).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@digigov/css": "0.
|
|
14
|
+
"@digigov/css": "0.34.1",
|
|
15
15
|
"clsx": "1.1.1",
|
|
16
16
|
"react": "^16.8.0 || ^17.0.0",
|
|
17
17
|
"react-dom": "^16.8.0 || ^17.0.0"
|
package/registry.d.ts
CHANGED
package/registry.js
CHANGED
|
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _digigov_react_core_AccessibilityIcon = _interopRequireWildcard(require("@digigov/react-core/AccessibilityIcon"));
|
|
11
|
+
|
|
12
|
+
var _digigov_react_core_AccessibilityTextIcon = _interopRequireWildcard(require("@digigov/react-core/AccessibilityTextIcon"));
|
|
13
|
+
|
|
10
14
|
var _digigov_react_core_Accordion = _interopRequireWildcard(require("@digigov/react-core/Accordion"));
|
|
11
15
|
|
|
12
16
|
var _digigov_react_core_AccordionControls = _interopRequireWildcard(require("@digigov/react-core/AccordionControls"));
|
|
@@ -342,6 +346,8 @@ function lazyImport(pkgImport) {
|
|
|
342
346
|
}
|
|
343
347
|
|
|
344
348
|
var _default = {
|
|
349
|
+
'@digigov/react-core/AccessibilityIcon': lazyImport(_digigov_react_core_AccessibilityIcon),
|
|
350
|
+
'@digigov/react-core/AccessibilityTextIcon': lazyImport(_digigov_react_core_AccessibilityTextIcon),
|
|
345
351
|
'@digigov/react-core/Accordion': lazyImport(_digigov_react_core_Accordion),
|
|
346
352
|
'@digigov/react-core/AccordionControls': lazyImport(_digigov_react_core_AccordionControls),
|
|
347
353
|
'@digigov/react-core/AccordionSection': lazyImport(_digigov_react_core_AccordionSection),
|