@digigov/react-core 0.10.2 → 0.13.0
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/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/AccordionSectionHeader/index.d.ts +1 -1
- package/AccordionSectionHeader/index.js +1 -1
- package/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/AccordionSectionSummary/index.d.ts +9 -0
- package/AccordionSectionSummary/index.js +35 -0
- package/AccordionSectionSummary/index.test.d.ts +1 -0
- package/AccordionSectionSummary/index.test.js +15 -0
- package/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/AccordionSectionSummaryHeading/index.d.ts +9 -0
- package/AccordionSectionSummaryHeading/index.js +37 -0
- package/AccordionSectionSummaryHeading/index.test.d.ts +1 -0
- package/AccordionSectionSummaryHeading/index.test.js +15 -0
- package/CHANGELOG.md +28 -1
- package/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/Card/index.d.ts +14 -2
- package/Card/index.js +4 -2
- package/Card/index.test.js +65 -3
- package/Grid/index.d.ts +1 -1
- package/Grid/index.js +1 -1
- package/List/__snapshots__/index.test.tsx.snap +15 -15
- package/List/index.d.ts +2 -2
- package/List/index.js +2 -2
- package/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/PhaseBannerHeaderContainer/inde.test.d.ts +1 -0
- package/PhaseBannerHeaderContainer/inde.test.js +15 -0
- package/PhaseBannerHeaderContainer/index.d.ts +8 -0
- package/PhaseBannerHeaderContainer/index.js +32 -0
- package/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/TableContainer/index.d.ts +13 -0
- package/TableContainer/index.js +37 -0
- package/TableContainer/index.test.d.ts +1 -0
- package/TableContainer/index.test.js +23 -0
- package/es/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/es/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/es/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/es/AccordionSectionHeader/index.js +1 -1
- package/es/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/es/AccordionSectionSummary/index.js +20 -0
- package/es/AccordionSectionSummary/index.test.js +9 -0
- package/es/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/es/AccordionSectionSummaryHeading/index.js +22 -0
- package/es/AccordionSectionSummaryHeading/index.test.js +9 -0
- package/es/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/es/Card/index.js +4 -2
- package/es/Card/index.test.js +65 -3
- package/es/Grid/index.js +1 -1
- package/es/List/__snapshots__/index.test.tsx.snap +15 -15
- package/es/List/index.js +2 -2
- package/es/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/es/PhaseBannerHeaderContainer/inde.test.js +9 -0
- package/es/PhaseBannerHeaderContainer/index.js +16 -0
- package/es/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/es/TableContainer/index.js +22 -0
- package/es/TableContainer/index.test.js +17 -0
- package/es/index.js +4 -0
- package/esm/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/esm/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/esm/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/esm/AccordionSectionHeader/index.js +1 -1
- package/esm/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/esm/AccordionSectionSummary/index.js +20 -0
- package/esm/AccordionSectionSummary/index.test.js +9 -0
- package/esm/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/esm/AccordionSectionSummaryHeading/index.js +22 -0
- package/esm/AccordionSectionSummaryHeading/index.test.js +9 -0
- package/esm/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/esm/Card/index.js +4 -2
- package/esm/Card/index.test.js +65 -3
- package/esm/Grid/index.js +1 -1
- package/esm/List/__snapshots__/index.test.tsx.snap +15 -15
- package/esm/List/index.js +2 -2
- package/esm/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/esm/PhaseBannerHeaderContainer/inde.test.js +9 -0
- package/esm/PhaseBannerHeaderContainer/index.js +16 -0
- package/esm/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/esm/TableContainer/index.js +22 -0
- package/esm/TableContainer/index.test.js +17 -0
- package/esm/index.js +5 -1
- package/index.d.ts +4 -0
- package/index.js +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AccordionSectionSummaryHeading with no props 1`] = `
|
|
4
|
+
<ForwardRef(AccordionSectionSummaryHeading)>
|
|
5
|
+
<h2
|
|
6
|
+
className="govgr-accordion__section-heading"
|
|
7
|
+
>
|
|
8
|
+
<span
|
|
9
|
+
className="govgr-accordion__section-button"
|
|
10
|
+
>
|
|
11
|
+
hello
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
</ForwardRef(AccordionSectionSummaryHeading)>
|
|
15
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* AccordionSectionSummaryHeading should be placed inside AccordionSectionSummary.
|
|
9
|
+
*/
|
|
10
|
+
export var AccordionSectionSummaryHeading = /*#__PURE__*/React.forwardRef(function AccordionSectionSummaryHeading(_ref, ref) {
|
|
11
|
+
var className = _ref.className,
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
|
|
15
|
+
return /*#__PURE__*/React.createElement("h2", _extends({
|
|
16
|
+
ref: ref,
|
|
17
|
+
className: clsx(className, true && 'govgr-accordion__section-heading')
|
|
18
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
19
|
+
className: clsx(true && 'govgr-accordion__section-button')
|
|
20
|
+
}, children));
|
|
21
|
+
});
|
|
22
|
+
export default AccordionSectionSummaryHeading;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import AccordionSectionSummaryHeading from '@digigov/react-core/AccordionSectionSummaryHeading';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(AccordionSectionSummaryHeading, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the AccordionSectionSummaryHeading with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the Card with callToActon props 1`] = `
|
|
4
|
+
<ForwardRef(Card)
|
|
5
|
+
callToAction={true}
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="govgr-card--cta govgr-card"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
className="govgr-card__body"
|
|
12
|
+
>
|
|
13
|
+
hello
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</ForwardRef(Card)>
|
|
17
|
+
`;
|
|
18
|
+
|
|
3
19
|
exports[`renders the Card with no props 1`] = `
|
|
4
20
|
<ForwardRef(Card)>
|
|
5
21
|
<div
|
|
@@ -14,6 +30,40 @@ exports[`renders the Card with no props 1`] = `
|
|
|
14
30
|
</ForwardRef(Card)>
|
|
15
31
|
`;
|
|
16
32
|
|
|
33
|
+
exports[`renders the Card with variant="border" and borderColor="dark" props 1`] = `
|
|
34
|
+
<ForwardRef(Card)
|
|
35
|
+
borderColor="dark"
|
|
36
|
+
variant="border"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
className="govgr-card--border govgr-card--border-dark govgr-card"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
className="govgr-card__body"
|
|
43
|
+
>
|
|
44
|
+
hello
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</ForwardRef(Card)>
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`renders the Card with variant="border" and borderColor="gray" props 1`] = `
|
|
51
|
+
<ForwardRef(Card)
|
|
52
|
+
borderColor="gray"
|
|
53
|
+
variant="border"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
className="govgr-card--border govgr-card--border-gray govgr-card"
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
className="govgr-card__body"
|
|
60
|
+
>
|
|
61
|
+
hello
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</ForwardRef(Card)>
|
|
65
|
+
`;
|
|
66
|
+
|
|
17
67
|
exports[`renders the Card with variant="border" props 1`] = `
|
|
18
68
|
<ForwardRef(Card)
|
|
19
69
|
variant="border"
|
|
@@ -30,6 +80,74 @@ exports[`renders the Card with variant="border" props 1`] = `
|
|
|
30
80
|
</ForwardRef(Card)>
|
|
31
81
|
`;
|
|
32
82
|
|
|
83
|
+
exports[`renders the Card with variant="border-top" and borderColor="dark" callToAction props 1`] = `
|
|
84
|
+
<ForwardRef(Card)
|
|
85
|
+
borderColor="dark"
|
|
86
|
+
callToAction={true}
|
|
87
|
+
variant="border-top"
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
className="govgr-card--border-top govgr-card--border-dark govgr-card--cta govgr-card"
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
className="govgr-card__body"
|
|
94
|
+
>
|
|
95
|
+
hello
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ForwardRef(Card)>
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`renders the Card with variant="border-top" and borderColor="dark" props 1`] = `
|
|
102
|
+
<ForwardRef(Card)
|
|
103
|
+
borderColor="dark"
|
|
104
|
+
variant="border-top"
|
|
105
|
+
>
|
|
106
|
+
<div
|
|
107
|
+
className="govgr-card--border-top govgr-card--border-dark govgr-card"
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
className="govgr-card__body"
|
|
111
|
+
>
|
|
112
|
+
hello
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</ForwardRef(Card)>
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
exports[`renders the Card with variant="border-top" and borderColor="gray" props 1`] = `
|
|
119
|
+
<ForwardRef(Card)
|
|
120
|
+
borderColor="gray"
|
|
121
|
+
variant="border-top"
|
|
122
|
+
>
|
|
123
|
+
<div
|
|
124
|
+
className="govgr-card--border-top govgr-card--border-gray govgr-card"
|
|
125
|
+
>
|
|
126
|
+
<div
|
|
127
|
+
className="govgr-card__body"
|
|
128
|
+
>
|
|
129
|
+
hello
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</ForwardRef(Card)>
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
exports[`renders the Card with variant="border-top" props 1`] = `
|
|
136
|
+
<ForwardRef(Card)
|
|
137
|
+
variant="border-top"
|
|
138
|
+
>
|
|
139
|
+
<div
|
|
140
|
+
className="govgr-card--border-top govgr-card"
|
|
141
|
+
>
|
|
142
|
+
<div
|
|
143
|
+
className="govgr-card__body"
|
|
144
|
+
>
|
|
145
|
+
hello
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</ForwardRef(Card)>
|
|
149
|
+
`;
|
|
150
|
+
|
|
33
151
|
exports[`renders the Card with variant="divider" props 1`] = `
|
|
34
152
|
<ForwardRef(Card)
|
|
35
153
|
variant="divider"
|
package/esm/Card/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 = ["variant", "style", "className", "children"];
|
|
3
|
+
var _excluded = ["variant", "borderColor", "callToAction", "style", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -11,6 +11,8 @@ import clsx from 'clsx';
|
|
|
11
11
|
*/
|
|
12
12
|
export var Card = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
|
|
13
13
|
var variant = _ref.variant,
|
|
14
|
+
borderColor = _ref.borderColor,
|
|
15
|
+
callToAction = _ref.callToAction,
|
|
14
16
|
style = _ref.style,
|
|
15
17
|
className = _ref.className,
|
|
16
18
|
children = _ref.children,
|
|
@@ -18,7 +20,7 @@ export var Card = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
|
|
|
18
20
|
|
|
19
21
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
20
22
|
ref: ref,
|
|
21
|
-
className: clsx(className, variant ===
|
|
23
|
+
className: clsx(className, variant === 'border-top' && 'govgr-card--border-top', borderColor === 'gray' && 'govgr-card--border-gray', borderColor === 'dark' && 'govgr-card--border-dark', variant === 'divider' && 'govgr-card--divider', variant === 'border' && 'govgr-card--border', callToAction && 'govgr-card--cta', true && 'govgr-card')
|
|
22
24
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
23
25
|
className: clsx(true && 'govgr-card__body')
|
|
24
26
|
}, children));
|
package/esm/Card/index.test.js
CHANGED
|
@@ -9,17 +9,79 @@ it('renders the Card with no props', function () {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
var _ref2 = /*#__PURE__*/React.createElement(Card, {
|
|
12
|
-
|
|
12
|
+
callToAction: true
|
|
13
13
|
}, "hello");
|
|
14
14
|
|
|
15
|
-
it('renders the Card with
|
|
15
|
+
it('renders the Card with callToActon props', function () {
|
|
16
16
|
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
var _ref3 = /*#__PURE__*/React.createElement(Card, {
|
|
20
|
+
variant: "border"
|
|
21
|
+
}, "hello");
|
|
22
|
+
|
|
23
|
+
it('renders the Card with variant="border" props', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(Card, {
|
|
20
28
|
variant: "divider"
|
|
21
29
|
}, "hello");
|
|
22
30
|
|
|
23
31
|
it('renders the Card with variant="divider" props', function () {
|
|
24
|
-
expect(mount(
|
|
32
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var _ref5 = /*#__PURE__*/React.createElement(Card, {
|
|
36
|
+
variant: "border-top"
|
|
37
|
+
}, "hello");
|
|
38
|
+
|
|
39
|
+
it('renders the Card with variant="border-top" props', function () {
|
|
40
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _ref6 = /*#__PURE__*/React.createElement(Card, {
|
|
44
|
+
variant: "border",
|
|
45
|
+
borderColor: "dark"
|
|
46
|
+
}, "hello");
|
|
47
|
+
|
|
48
|
+
it('renders the Card with variant="border" and borderColor="dark" props', function () {
|
|
49
|
+
expect(mount(_ref6)).toMatchSnapshot();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var _ref7 = /*#__PURE__*/React.createElement(Card, {
|
|
53
|
+
variant: "border",
|
|
54
|
+
borderColor: "gray"
|
|
55
|
+
}, "hello");
|
|
56
|
+
|
|
57
|
+
it('renders the Card with variant="border" and borderColor="gray" props', function () {
|
|
58
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var _ref8 = /*#__PURE__*/React.createElement(Card, {
|
|
62
|
+
variant: "border-top",
|
|
63
|
+
borderColor: "dark"
|
|
64
|
+
}, "hello");
|
|
65
|
+
|
|
66
|
+
it('renders the Card with variant="border-top" and borderColor="dark" props', function () {
|
|
67
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
var _ref9 = /*#__PURE__*/React.createElement(Card, {
|
|
71
|
+
variant: "border-top",
|
|
72
|
+
borderColor: "gray"
|
|
73
|
+
}, "hello");
|
|
74
|
+
|
|
75
|
+
it('renders the Card with variant="border-top" and borderColor="gray" props', function () {
|
|
76
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var _ref10 = /*#__PURE__*/React.createElement(Card, {
|
|
80
|
+
variant: "border-top",
|
|
81
|
+
borderColor: "dark",
|
|
82
|
+
callToAction: true
|
|
83
|
+
}, "hello");
|
|
84
|
+
|
|
85
|
+
it('renders the Card with variant="border-top" and borderColor="dark" callToAction props', function () {
|
|
86
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
25
87
|
});
|
package/esm/Grid/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export var Grid = /*#__PURE__*/React.forwardRef(function Grid(_ref, ref) {
|
|
|
25
25
|
|
|
26
26
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
27
27
|
ref: ref,
|
|
28
|
-
className: clsx(className, container === true && [inline === true && 'govgr-grid-inline', 'govgr-grid'], container && [spacing === 1 && "govgr-grid__gap-1", spacing === 2 && "govgr-grid__gap-2", spacing === 4 && "govgr-grid__gap-4", spacing === 6 && "govgr-grid__gap-6"], item && [xs === 'auto' && "xs:govgr-grid__col-auto", sm === 'auto' && "sm:govgr-grid__col-auto", md === 'auto' && "md:govgr-grid__col-auto", lg === 'auto' && "lg:govgr-grid__col-auto", xl === 'auto' && "xl:govgr-grid__col-auto", xs === 10 && "xs:govgr-grid__col-span-10", xs === 11 && "xs:govgr-grid__col-span-11", xs === 12 && "xs:govgr-grid__col-span-12", sm === 10 && "sm:govgr-grid__col-span-10", sm === 11 && "sm:govgr-grid__col-span-11", sm === 12 && "sm:govgr-grid__col-span-12", md === 10 && "md:govgr-grid__col-span-10", md === 11 && "md:govgr-grid__col-span-11", md === 12 && "md:govgr-grid__col-span-12", lg === 10 && "lg:govgr-grid__col-span-10", lg === 11 && "lg:govgr-grid__col-span-11", lg === 12 && "lg:govgr-grid__col-span-12", xl === 10 && "xl:govgr-grid__col-span-10", xl === 11 && "xl:govgr-grid__col-span-11", xl === 12 && "xl:govgr-grid__col-span-12", xs === 1 && "xs:govgr-grid__col-span-1", xs === 2 && "xs:govgr-grid__col-span-2", xs === 3 && "xs:govgr-grid__col-span-3", xs === 4 && "xs:govgr-grid__col-span-4", xs === 5 && "xs:govgr-grid__col-span-5", xs === 6 && "xs:govgr-grid__col-span-6", xs === 7 && "xs:govgr-grid__col-span-7", xs === 8 && "xs:govgr-grid__col-span-8", xs === 9 && "xs:govgr-grid__col-span-9", sm === 1 && "sm:govgr-grid__col-span-1", sm === 2 && "sm:govgr-grid__col-span-2", sm === 3 && "sm:govgr-grid__col-span-3", sm === 4 && "sm:govgr-grid__col-span-4", sm === 5 && "sm:govgr-grid__col-span-5", sm === 6 && "sm:govgr-grid__col-span-6", sm === 7 && "sm:govgr-grid__col-span-7", sm === 8 && "sm:govgr-grid__col-span-8", sm === 9 && "sm:govgr-grid__col-span-9", md === 1 && "md:govgr-grid__col-span-1", md === 2 && "md:govgr-grid__col-span-2", md === 3 && "md:govgr-grid__col-span-3", md === 4 && "md:govgr-grid__col-span-4", md === 5 && "md:govgr-grid__col-span-5", md === 6 && "md:govgr-grid__col-span-6", md === 7 && "md:govgr-grid__col-span-7", md === 8 && "md:govgr-grid__col-span-8", md === 9 && "md:govgr-grid__col-span-9", lg === 1 && "lg:govgr-grid__col-span-1", lg === 2 && "lg:govgr-grid__col-span-2", lg === 3 && "lg:govgr-grid__col-span-3", lg === 4 && "lg:govgr-grid__col-span-4", lg === 5 && "lg:govgr-grid__col-span-5", lg === 6 && "lg:govgr-grid__col-span-6", lg === 7 && "lg:govgr-grid__col-span-7", lg === 8 && "lg:govgr-grid__col-span-8", lg === 9 && "lg:govgr-grid__col-span-9", xl === 1 && "xl:govgr-grid__col-span-1", xl === 2 && "xl:govgr-grid__col-span-2", xl === 3 && "xl:govgr-grid__col-span-3", xl === 4 && "xl:govgr-grid__col-span-4", xl === 5 && "xl:govgr-grid__col-span-5", xl === 6 && "xl:govgr-grid__col-span-6", xl === 7 && "xl:govgr-grid__col-span-7", xl === 8 && "xl:govgr-grid__col-span-8", xl === 9 && "xl:govgr-grid__col-span-9"])
|
|
28
|
+
className: clsx(className, container === true && [inline === true && 'govgr-grid-inline', 'govgr-grid'], container && [spacing === 10 && "govgr-grid__gap-10", spacing === 12 && "govgr-grid__gap-12", spacing === 1 && "govgr-grid__gap-1", spacing === 2 && "govgr-grid__gap-2", spacing === 4 && "govgr-grid__gap-4", spacing === 6 && "govgr-grid__gap-6", spacing === 8 && "govgr-grid__gap-8"], item && [xs === 'auto' && "xs:govgr-grid__col-auto", sm === 'auto' && "sm:govgr-grid__col-auto", md === 'auto' && "md:govgr-grid__col-auto", lg === 'auto' && "lg:govgr-grid__col-auto", xl === 'auto' && "xl:govgr-grid__col-auto", xs === 10 && "xs:govgr-grid__col-span-10", xs === 11 && "xs:govgr-grid__col-span-11", xs === 12 && "xs:govgr-grid__col-span-12", sm === 10 && "sm:govgr-grid__col-span-10", sm === 11 && "sm:govgr-grid__col-span-11", sm === 12 && "sm:govgr-grid__col-span-12", md === 10 && "md:govgr-grid__col-span-10", md === 11 && "md:govgr-grid__col-span-11", md === 12 && "md:govgr-grid__col-span-12", lg === 10 && "lg:govgr-grid__col-span-10", lg === 11 && "lg:govgr-grid__col-span-11", lg === 12 && "lg:govgr-grid__col-span-12", xl === 10 && "xl:govgr-grid__col-span-10", xl === 11 && "xl:govgr-grid__col-span-11", xl === 12 && "xl:govgr-grid__col-span-12", xs === 1 && "xs:govgr-grid__col-span-1", xs === 2 && "xs:govgr-grid__col-span-2", xs === 3 && "xs:govgr-grid__col-span-3", xs === 4 && "xs:govgr-grid__col-span-4", xs === 5 && "xs:govgr-grid__col-span-5", xs === 6 && "xs:govgr-grid__col-span-6", xs === 7 && "xs:govgr-grid__col-span-7", xs === 8 && "xs:govgr-grid__col-span-8", xs === 9 && "xs:govgr-grid__col-span-9", sm === 1 && "sm:govgr-grid__col-span-1", sm === 2 && "sm:govgr-grid__col-span-2", sm === 3 && "sm:govgr-grid__col-span-3", sm === 4 && "sm:govgr-grid__col-span-4", sm === 5 && "sm:govgr-grid__col-span-5", sm === 6 && "sm:govgr-grid__col-span-6", sm === 7 && "sm:govgr-grid__col-span-7", sm === 8 && "sm:govgr-grid__col-span-8", sm === 9 && "sm:govgr-grid__col-span-9", md === 1 && "md:govgr-grid__col-span-1", md === 2 && "md:govgr-grid__col-span-2", md === 3 && "md:govgr-grid__col-span-3", md === 4 && "md:govgr-grid__col-span-4", md === 5 && "md:govgr-grid__col-span-5", md === 6 && "md:govgr-grid__col-span-6", md === 7 && "md:govgr-grid__col-span-7", md === 8 && "md:govgr-grid__col-span-8", md === 9 && "md:govgr-grid__col-span-9", lg === 1 && "lg:govgr-grid__col-span-1", lg === 2 && "lg:govgr-grid__col-span-2", lg === 3 && "lg:govgr-grid__col-span-3", lg === 4 && "lg:govgr-grid__col-span-4", lg === 5 && "lg:govgr-grid__col-span-5", lg === 6 && "lg:govgr-grid__col-span-6", lg === 7 && "lg:govgr-grid__col-span-7", lg === 8 && "lg:govgr-grid__col-span-8", lg === 9 && "lg:govgr-grid__col-span-9", xl === 1 && "xl:govgr-grid__col-span-1", xl === 2 && "xl:govgr-grid__col-span-2", xl === 3 && "xl:govgr-grid__col-span-3", xl === 4 && "xl:govgr-grid__col-span-4", xl === 5 && "xl:govgr-grid__col-span-5", xl === 6 && "xl:govgr-grid__col-span-6", xl === 7 && "xl:govgr-grid__col-span-7", xl === 8 && "xl:govgr-grid__col-span-8", xl === 9 && "xl:govgr-grid__col-span-9"])
|
|
29
29
|
}, props), children);
|
|
30
30
|
});
|
|
31
31
|
export default Grid;
|
|
@@ -4,11 +4,11 @@ exports[`renders the List with listStyle=bullet 1`] = `
|
|
|
4
4
|
<ForwardRef(List)
|
|
5
5
|
listStyle="bullet"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
7
|
+
<ol
|
|
8
8
|
className="govgr-list--bullet govgr-list"
|
|
9
9
|
>
|
|
10
10
|
hello
|
|
11
|
-
</
|
|
11
|
+
</ol>
|
|
12
12
|
</ForwardRef(List)>
|
|
13
13
|
`;
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ exports[`renders the List with listStyle=bullet 2`] = `
|
|
|
16
16
|
<ForwardRef(List)
|
|
17
17
|
listStyle="bullet"
|
|
18
18
|
>
|
|
19
|
-
<
|
|
19
|
+
<ol
|
|
20
20
|
className="govgr-list--bullet govgr-list"
|
|
21
21
|
>
|
|
22
22
|
<ForwardRef(ListItem)>
|
|
@@ -33,7 +33,7 @@ exports[`renders the List with listStyle=bullet 2`] = `
|
|
|
33
33
|
hello Katerina
|
|
34
34
|
</li>
|
|
35
35
|
</ForwardRef(ListItem)>
|
|
36
|
-
</
|
|
36
|
+
</ol>
|
|
37
37
|
</ForwardRef(List)>
|
|
38
38
|
`;
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ exports[`renders the List with listStyle=bullet and spaced 1`] = `
|
|
|
42
42
|
listStyle="bullet"
|
|
43
43
|
spaced={true}
|
|
44
44
|
>
|
|
45
|
-
<
|
|
45
|
+
<ol
|
|
46
46
|
className="govgr-list--bullet govgr-list--spaced govgr-list"
|
|
47
47
|
>
|
|
48
48
|
<ForwardRef(ListItem)>
|
|
@@ -59,7 +59,7 @@ exports[`renders the List with listStyle=bullet and spaced 1`] = `
|
|
|
59
59
|
hello Katerina
|
|
60
60
|
</li>
|
|
61
61
|
</ForwardRef(ListItem)>
|
|
62
|
-
</
|
|
62
|
+
</ol>
|
|
63
63
|
</ForwardRef(List)>
|
|
64
64
|
`;
|
|
65
65
|
|
|
@@ -67,11 +67,11 @@ exports[`renders the List with listStyle=number 1`] = `
|
|
|
67
67
|
<ForwardRef(List)
|
|
68
68
|
listStyle="number"
|
|
69
69
|
>
|
|
70
|
-
<
|
|
70
|
+
<ol
|
|
71
71
|
className="govgr-list--number govgr-list"
|
|
72
72
|
>
|
|
73
73
|
hello
|
|
74
|
-
</
|
|
74
|
+
</ol>
|
|
75
75
|
</ForwardRef(List)>
|
|
76
76
|
`;
|
|
77
77
|
|
|
@@ -79,7 +79,7 @@ exports[`renders the List with listStyle=number 2`] = `
|
|
|
79
79
|
<ForwardRef(List)
|
|
80
80
|
listStyle="number"
|
|
81
81
|
>
|
|
82
|
-
<
|
|
82
|
+
<ol
|
|
83
83
|
className="govgr-list--number govgr-list"
|
|
84
84
|
>
|
|
85
85
|
<ForwardRef(ListItem)>
|
|
@@ -96,7 +96,7 @@ exports[`renders the List with listStyle=number 2`] = `
|
|
|
96
96
|
hello Katerina
|
|
97
97
|
</li>
|
|
98
98
|
</ForwardRef(ListItem)>
|
|
99
|
-
</
|
|
99
|
+
</ol>
|
|
100
100
|
</ForwardRef(List)>
|
|
101
101
|
`;
|
|
102
102
|
|
|
@@ -105,7 +105,7 @@ exports[`renders the List with listStyle=number and spaced 1`] = `
|
|
|
105
105
|
listStyle="number"
|
|
106
106
|
spaced={true}
|
|
107
107
|
>
|
|
108
|
-
<
|
|
108
|
+
<ol
|
|
109
109
|
className="govgr-list--number govgr-list--spaced govgr-list"
|
|
110
110
|
>
|
|
111
111
|
<ForwardRef(ListItem)>
|
|
@@ -122,16 +122,16 @@ exports[`renders the List with listStyle=number and spaced 1`] = `
|
|
|
122
122
|
hello Katerina
|
|
123
123
|
</li>
|
|
124
124
|
</ForwardRef(ListItem)>
|
|
125
|
-
</
|
|
125
|
+
</ol>
|
|
126
126
|
</ForwardRef(List)>
|
|
127
127
|
`;
|
|
128
128
|
|
|
129
129
|
exports[`renders the List with no props 1`] = `
|
|
130
130
|
<ForwardRef(List)>
|
|
131
|
-
<
|
|
132
|
-
className="govgr-list"
|
|
131
|
+
<ol
|
|
132
|
+
className="govgr-list--bullet govgr-list"
|
|
133
133
|
>
|
|
134
134
|
hello
|
|
135
|
-
</
|
|
135
|
+
</ol>
|
|
136
136
|
</ForwardRef(List)>
|
|
137
137
|
`;
|
package/esm/List/index.js
CHANGED
|
@@ -10,14 +10,14 @@ import clsx from 'clsx';
|
|
|
10
10
|
*/
|
|
11
11
|
export var List = /*#__PURE__*/React.forwardRef(function List(_ref, ref) {
|
|
12
12
|
var _ref$listStyle = _ref.listStyle,
|
|
13
|
-
listStyle = _ref$listStyle === void 0 ? '
|
|
13
|
+
listStyle = _ref$listStyle === void 0 ? 'none' : _ref$listStyle,
|
|
14
14
|
_ref$spaced = _ref.spaced,
|
|
15
15
|
spaced = _ref$spaced === void 0 ? false : _ref$spaced,
|
|
16
16
|
className = _ref.className,
|
|
17
17
|
children = _ref.children,
|
|
18
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
|
|
20
|
-
return /*#__PURE__*/React.createElement("
|
|
20
|
+
return /*#__PURE__*/React.createElement("ol", _extends({
|
|
21
21
|
ref: ref,
|
|
22
22
|
className: clsx(className, listStyle === 'bullet' && 'govgr-list--bullet', listStyle === 'number' && 'govgr-list--number', spaced === true && 'govgr-list--spaced', true && 'govgr-list')
|
|
23
23
|
}, props), children);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the PhaseBannerHeaderContainer with no props 1`] = `
|
|
4
|
+
<ForwardRef(PhaseBannerHeaderContainer)>
|
|
5
|
+
<div
|
|
6
|
+
className="govgr-phase-banner_header"
|
|
7
|
+
>
|
|
8
|
+
hello
|
|
9
|
+
</div>
|
|
10
|
+
</ForwardRef(PhaseBannerHeaderContainer)>
|
|
11
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import PhaseBannerHeaderContainer from '@digigov/react-core/PhaseBannerHeaderContainer';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(PhaseBannerHeaderContainer, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the PhaseBannerHeaderContainer with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
export var PhaseBannerHeaderContainer = /*#__PURE__*/React.forwardRef(function PhaseBannerHeaderContainer(_ref, ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
11
|
+
ref: ref
|
|
12
|
+
}, props, {
|
|
13
|
+
className: clsx(true && 'govgr-phase-banner_header')
|
|
14
|
+
}), children);
|
|
15
|
+
});
|
|
16
|
+
export default PhaseBannerHeaderContainer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the TableContainer with border prop 1`] = `
|
|
4
|
+
<ForwardRef(TableContainer)
|
|
5
|
+
border={true}
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="govgr-table-container--border govgr-table-container"
|
|
9
|
+
>
|
|
10
|
+
hello
|
|
11
|
+
</div>
|
|
12
|
+
</ForwardRef(TableContainer)>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`renders the TableContainer with no props 1`] = `
|
|
16
|
+
<ForwardRef(TableContainer)>
|
|
17
|
+
<div
|
|
18
|
+
className="govgr-table-container"
|
|
19
|
+
>
|
|
20
|
+
hello
|
|
21
|
+
</div>
|
|
22
|
+
</ForwardRef(TableContainer)>
|
|
23
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["border", "className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use TableContainer as a wrapper for a Table. It is used when the table is wider that the viewport width.
|
|
9
|
+
*/
|
|
10
|
+
export var TableContainer = /*#__PURE__*/React.forwardRef(function TableContainer(_ref, ref) {
|
|
11
|
+
var _ref$border = _ref.border,
|
|
12
|
+
border = _ref$border === void 0 ? false : _ref$border,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: clsx(className, border && 'govgr-table-container--border', true && 'govgr-table-container')
|
|
20
|
+
}, props), children);
|
|
21
|
+
});
|
|
22
|
+
export default TableContainer;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import TableContainer from '@digigov/react-core/TableContainer';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(TableContainer, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the TableContainer with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(TableContainer, {
|
|
12
|
+
border: true
|
|
13
|
+
}, "hello");
|
|
14
|
+
|
|
15
|
+
it('renders the TableContainer with border prop', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.
|
|
1
|
+
/** @license Digigov v0.13.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,6 +8,8 @@ export { default as AccordionControls } from '@digigov/react-core/AccordionContr
|
|
|
8
8
|
export { default as AccordionSection } from '@digigov/react-core/AccordionSection';
|
|
9
9
|
export { default as AccordionSectionContent } from '@digigov/react-core/AccordionSectionContent';
|
|
10
10
|
export { default as AccordionSectionHeader } from '@digigov/react-core/AccordionSectionHeader';
|
|
11
|
+
export { default as AccordionSectionSummary } from '@digigov/react-core/AccordionSectionSummary';
|
|
12
|
+
export { default as AccordionSectionSummaryHeading } from '@digigov/react-core/AccordionSectionSummaryHeading';
|
|
11
13
|
export { default as ArrowIcon } from '@digigov/react-core/ArrowIcon';
|
|
12
14
|
export { default as Aside } from '@digigov/react-core/Aside';
|
|
13
15
|
export { default as BackLink } from '@digigov/react-core/BackLink';
|
|
@@ -104,6 +106,7 @@ export { default as PageTitleCaption } from '@digigov/react-core/PageTitleCaptio
|
|
|
104
106
|
export { default as PageTitleHeading } from '@digigov/react-core/PageTitleHeading';
|
|
105
107
|
export { default as PageTitleSection } from '@digigov/react-core/PageTitleSection';
|
|
106
108
|
export { default as Paragraph } from '@digigov/react-core/Paragraph';
|
|
109
|
+
export { default as PhaseBannerHeaderContainer } from '@digigov/react-core/PhaseBannerHeaderContainer';
|
|
107
110
|
export { default as PhaseBanner } from '@digigov/react-core/PhaseBanner';
|
|
108
111
|
export { default as PhaseBannerTag } from '@digigov/react-core/PhaseBannerTag';
|
|
109
112
|
export { default as PhaseBannerText } from '@digigov/react-core/PhaseBannerText';
|
|
@@ -123,6 +126,7 @@ export { default as SvgIcon } from '@digigov/react-core/SvgIcon';
|
|
|
123
126
|
export { default as Table } from '@digigov/react-core/Table';
|
|
124
127
|
export { default as TableBody } from '@digigov/react-core/TableBody';
|
|
125
128
|
export { default as TableCaption } from '@digigov/react-core/TableCaption';
|
|
129
|
+
export { default as TableContainer } from '@digigov/react-core/TableContainer';
|
|
126
130
|
export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
|
|
127
131
|
export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
|
|
128
132
|
export { default as TableHead } from '@digigov/react-core/TableHead';
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { default as AccordionControls } from '@digigov/react-core/AccordionContr
|
|
|
3
3
|
export { default as AccordionSection } from '@digigov/react-core/AccordionSection';
|
|
4
4
|
export { default as AccordionSectionContent } from '@digigov/react-core/AccordionSectionContent';
|
|
5
5
|
export { default as AccordionSectionHeader } from '@digigov/react-core/AccordionSectionHeader';
|
|
6
|
+
export { default as AccordionSectionSummary } from '@digigov/react-core/AccordionSectionSummary';
|
|
7
|
+
export { default as AccordionSectionSummaryHeading } from '@digigov/react-core/AccordionSectionSummaryHeading';
|
|
6
8
|
export { default as ArrowIcon } from '@digigov/react-core/ArrowIcon';
|
|
7
9
|
export { default as Aside } from '@digigov/react-core/Aside';
|
|
8
10
|
export { default as BackLink } from '@digigov/react-core/BackLink';
|
|
@@ -99,6 +101,7 @@ export { default as PageTitleCaption } from '@digigov/react-core/PageTitleCaptio
|
|
|
99
101
|
export { default as PageTitleHeading } from '@digigov/react-core/PageTitleHeading';
|
|
100
102
|
export { default as PageTitleSection } from '@digigov/react-core/PageTitleSection';
|
|
101
103
|
export { default as Paragraph } from '@digigov/react-core/Paragraph';
|
|
104
|
+
export { default as PhaseBannerHeaderContainer } from '@digigov/react-core/PhaseBannerHeaderContainer';
|
|
102
105
|
export { default as PhaseBanner } from '@digigov/react-core/PhaseBanner';
|
|
103
106
|
export { default as PhaseBannerTag } from '@digigov/react-core/PhaseBannerTag';
|
|
104
107
|
export { default as PhaseBannerText } from '@digigov/react-core/PhaseBannerText';
|
|
@@ -118,6 +121,7 @@ export { default as SvgIcon } from '@digigov/react-core/SvgIcon';
|
|
|
118
121
|
export { default as Table } from '@digigov/react-core/Table';
|
|
119
122
|
export { default as TableBody } from '@digigov/react-core/TableBody';
|
|
120
123
|
export { default as TableCaption } from '@digigov/react-core/TableCaption';
|
|
124
|
+
export { default as TableContainer } from '@digigov/react-core/TableContainer';
|
|
121
125
|
export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
|
|
122
126
|
export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
|
|
123
127
|
export { default as TableHead } from '@digigov/react-core/TableHead';
|