@digigov/react-core 0.6.3 → 0.6.4

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  3. package/Dropdown/index.d.ts +30 -0
  4. package/Dropdown/index.js +42 -0
  5. package/Dropdown/index.test.d.ts +1 -0
  6. package/Dropdown/index.test.js +101 -0
  7. package/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  8. package/DropdownButton/index.d.ts +28 -0
  9. package/DropdownButton/index.js +47 -0
  10. package/DropdownButton/index.test.d.ts +1 -0
  11. package/DropdownButton/index.test.js +195 -0
  12. package/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  13. package/DropdownContent/index.d.ts +9 -0
  14. package/DropdownContent/index.js +35 -0
  15. package/DropdownContent/index.test.d.ts +1 -0
  16. package/DropdownContent/index.test.js +15 -0
  17. package/TableDataCell/index.d.ts +1 -1
  18. package/TableHeaderCell/index.d.ts +1 -1
  19. package/es/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  20. package/es/Dropdown/index.js +27 -0
  21. package/es/Dropdown/index.test.js +95 -0
  22. package/es/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  23. package/es/DropdownButton/index.js +31 -0
  24. package/es/DropdownButton/index.test.js +189 -0
  25. package/es/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  26. package/es/DropdownContent/index.js +20 -0
  27. package/es/DropdownContent/index.test.js +9 -0
  28. package/es/index.js +3 -0
  29. package/esm/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  30. package/esm/Dropdown/index.js +27 -0
  31. package/esm/Dropdown/index.test.js +95 -0
  32. package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  33. package/esm/DropdownButton/index.js +31 -0
  34. package/esm/DropdownButton/index.test.js +189 -0
  35. package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  36. package/esm/DropdownContent/index.js +20 -0
  37. package/esm/DropdownContent/index.test.js +9 -0
  38. package/esm/index.js +4 -1
  39. package/index.d.ts +3 -0
  40. package/index.js +24 -0
  41. package/package.json +2 -2
@@ -0,0 +1,189 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import DropdownButton from '@digigov/react-core/DropdownButton';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(DropdownButton, null, "hello");
6
+
7
+ it('renders the DropdownButton with no props', function () {
8
+ expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(DropdownButton, {
12
+ color: "primary"
13
+ }, "hello");
14
+
15
+ it('renders the DropdownButton with color=primary', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
17
+ });
18
+
19
+ var _ref3 = /*#__PURE__*/React.createElement(DropdownButton, {
20
+ color: "secondary"
21
+ }, "hello");
22
+
23
+ it('renders the DropdownButton with color=secondary', function () {
24
+ expect(mount(_ref3)).toMatchSnapshot();
25
+ });
26
+
27
+ var _ref4 = /*#__PURE__*/React.createElement(DropdownButton, {
28
+ variant: "button"
29
+ }, "hello");
30
+
31
+ it('renders the DropdownButton with variant=button', function () {
32
+ expect(mount(_ref4)).toMatchSnapshot();
33
+ });
34
+
35
+ var _ref5 = /*#__PURE__*/React.createElement(DropdownButton, {
36
+ variant: "link"
37
+ }, "hello");
38
+
39
+ it('renders the DropdownButton with variant=link', function () {
40
+ expect(mount(_ref5)).toMatchSnapshot();
41
+ });
42
+
43
+ var _ref6 = /*#__PURE__*/React.createElement(DropdownButton, {
44
+ arrow: false
45
+ }, "hello");
46
+
47
+ it('renders the DropdownButton with arrow=false', function () {
48
+ expect(mount(_ref6)).toMatchSnapshot();
49
+ });
50
+
51
+ var _ref7 = /*#__PURE__*/React.createElement(DropdownButton, {
52
+ arrow: true
53
+ }, "hello");
54
+
55
+ it('renders the DropdownButton with arrow=true', function () {
56
+ expect(mount(_ref7)).toMatchSnapshot();
57
+ });
58
+
59
+ var _ref8 = /*#__PURE__*/React.createElement(DropdownButton, {
60
+ color: "primary",
61
+ variant: "button"
62
+ }, "hello");
63
+
64
+ it('renders the DropdownButton with color=primary and variant="button"', function () {
65
+ expect(mount(_ref8)).toMatchSnapshot();
66
+ });
67
+
68
+ var _ref9 = /*#__PURE__*/React.createElement(DropdownButton, {
69
+ color: "primary",
70
+ variant: "link"
71
+ }, "hello");
72
+
73
+ it('renders the DropdownButton with color=primary and variant="link"', function () {
74
+ expect(mount(_ref9)).toMatchSnapshot();
75
+ });
76
+
77
+ var _ref10 = /*#__PURE__*/React.createElement(DropdownButton, {
78
+ color: "primary",
79
+ arrow: false
80
+ }, "hello");
81
+
82
+ it('renders the DropdownButton with color=primary and arrow={false}', function () {
83
+ expect(mount(_ref10)).toMatchSnapshot();
84
+ });
85
+
86
+ var _ref11 = /*#__PURE__*/React.createElement(DropdownButton, {
87
+ color: "primary",
88
+ arrow: true
89
+ });
90
+
91
+ it('renders the DropdownButton with color=primary and arrow={true}', function () {
92
+ expect(mount(_ref11)).toMatchSnapshot();
93
+ });
94
+
95
+ var _ref12 = /*#__PURE__*/React.createElement(DropdownButton, {
96
+ color: "secondary",
97
+ variant: "button"
98
+ }, "hello");
99
+
100
+ it('renders the DropdownButton with color=secondary and variant="button"', function () {
101
+ expect(mount(_ref12)).toMatchSnapshot();
102
+ });
103
+
104
+ var _ref13 = /*#__PURE__*/React.createElement(DropdownButton, {
105
+ color: "secondary",
106
+ variant: "link"
107
+ }, "hello");
108
+
109
+ it('renders the DropdownButton with color=primary and variant="link"', function () {
110
+ expect(mount(_ref13)).toMatchSnapshot();
111
+ });
112
+
113
+ var _ref14 = /*#__PURE__*/React.createElement(DropdownButton, {
114
+ color: "secondary",
115
+ arrow: false
116
+ }, "hello");
117
+
118
+ it('renders the DropdownButton with color=secondary and arrow={false}', function () {
119
+ expect(mount(_ref14)).toMatchSnapshot();
120
+ });
121
+
122
+ var _ref15 = /*#__PURE__*/React.createElement(DropdownButton, {
123
+ color: "secondary",
124
+ arrow: true
125
+ });
126
+
127
+ it('renders the DropdownButton with color=secondary and arrow={true}', function () {
128
+ expect(mount(_ref15)).toMatchSnapshot();
129
+ });
130
+
131
+ var _ref16 = /*#__PURE__*/React.createElement(DropdownButton, {
132
+ color: "primary",
133
+ variant: "button",
134
+ arrow: false
135
+ }, "hello");
136
+
137
+ it('renders the DropdownButton with color=primary variant="button" and arrow={false}', function () {
138
+ expect(mount(_ref16)).toMatchSnapshot();
139
+ });
140
+
141
+ var _ref17 = /*#__PURE__*/React.createElement(DropdownButton, {
142
+ color: "primary",
143
+ variant: "button",
144
+ arrow: true
145
+ });
146
+
147
+ it('renders the DropdownButton with color=primary variant="button" arrow={true}', function () {
148
+ expect(mount(_ref17)).toMatchSnapshot();
149
+ });
150
+
151
+ var _ref18 = /*#__PURE__*/React.createElement(DropdownButton, {
152
+ color: "primary",
153
+ variant: "link",
154
+ arrow: true
155
+ });
156
+
157
+ it('renders the DropdownButton with color=primary variant="link" arrow={true}', function () {
158
+ expect(mount(_ref18)).toMatchSnapshot();
159
+ });
160
+
161
+ var _ref19 = /*#__PURE__*/React.createElement(DropdownButton, {
162
+ color: "primary",
163
+ variant: "link",
164
+ arrow: false
165
+ }, "hello");
166
+
167
+ it('renders the DropdownButton with color=primary variant="link" arrow={false}', function () {
168
+ expect(mount(_ref19)).toMatchSnapshot();
169
+ });
170
+
171
+ var _ref20 = /*#__PURE__*/React.createElement(DropdownButton, {
172
+ color: "warning",
173
+ variant: "link",
174
+ arrow: false
175
+ }, "hello");
176
+
177
+ it('renders the DropdownButton with color=warning variant="button" arrow={false}', function () {
178
+ expect(mount(_ref20)).toMatchSnapshot();
179
+ });
180
+
181
+ var _ref21 = /*#__PURE__*/React.createElement(DropdownButton, {
182
+ color: "warning",
183
+ variant: "link",
184
+ arrow: true
185
+ }, "hello");
186
+
187
+ it('renders the DropdownButton with color=warning variant="button" arrow={true}', function () {
188
+ expect(mount(_ref21)).toMatchSnapshot();
189
+ });
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the DropdownContent with no props 1`] = `
4
+ <ForwardRef(DropdownContent)>
5
+ <div
6
+ className="govgr-dropdown__content"
7
+ >
8
+ hello
9
+ </div>
10
+ </ForwardRef(DropdownContent)>
11
+ `;
@@ -0,0 +1,20 @@
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
+ * You should use DropdownContent component inside Dropdown component.
9
+ */
10
+ export var DropdownContent = /*#__PURE__*/React.forwardRef(function DropdownContent(_ref, ref) {
11
+ var className = _ref.className,
12
+ children = _ref.children,
13
+ props = _objectWithoutProperties(_ref, _excluded);
14
+
15
+ return /*#__PURE__*/React.createElement("div", _extends({
16
+ ref: ref,
17
+ className: clsx(className, true && 'govgr-dropdown__content')
18
+ }, props), children);
19
+ });
20
+ export default DropdownContent;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import DropdownContent from '@digigov/react-core/DropdownContent';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(DropdownContent, null, "hello");
6
+
7
+ it('renders the DropdownContent with no props', function () {
8
+ expect(mount(_ref)).toMatchSnapshot();
9
+ });
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v0.6.3
1
+ /** @license Digigov v0.6.4
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.
@@ -42,6 +42,9 @@ export { default as DateInputItem } from '@digigov/react-core/DateInputItem';
42
42
  export { default as Details } from '@digigov/react-core/Details';
43
43
  export { default as DetailsContent } from '@digigov/react-core/DetailsContent';
44
44
  export { default as DetailsSummary } from '@digigov/react-core/DetailsSummary';
45
+ export { default as Dropdown } from '@digigov/react-core/Dropdown';
46
+ export { default as DropdownButton } from '@digigov/react-core/DropdownButton';
47
+ export { default as DropdownContent } from '@digigov/react-core/DropdownContent';
45
48
  export { default as ErrorMessage } from '@digigov/react-core/ErrorMessage';
46
49
  export { default as ErrorSummary } from '@digigov/react-core/ErrorSummary';
47
50
  export { default as Fieldset } from '@digigov/react-core/Fieldset';
package/index.d.ts CHANGED
@@ -37,6 +37,9 @@ export { default as DateInputItem } from '@digigov/react-core/DateInputItem';
37
37
  export { default as Details } from '@digigov/react-core/Details';
38
38
  export { default as DetailsContent } from '@digigov/react-core/DetailsContent';
39
39
  export { default as DetailsSummary } from '@digigov/react-core/DetailsSummary';
40
+ export { default as Dropdown } from '@digigov/react-core/Dropdown';
41
+ export { default as DropdownButton } from '@digigov/react-core/DropdownButton';
42
+ export { default as DropdownContent } from '@digigov/react-core/DropdownContent';
40
43
  export { default as ErrorMessage } from '@digigov/react-core/ErrorMessage';
41
44
  export { default as ErrorSummary } from '@digigov/react-core/ErrorSummary';
42
45
  export { default as Fieldset } from '@digigov/react-core/Fieldset';
package/index.js CHANGED
@@ -233,6 +233,24 @@ Object.defineProperty(exports, "DetailsSummary", {
233
233
  return _DetailsSummary["default"];
234
234
  }
235
235
  });
236
+ Object.defineProperty(exports, "Dropdown", {
237
+ enumerable: true,
238
+ get: function get() {
239
+ return _Dropdown["default"];
240
+ }
241
+ });
242
+ Object.defineProperty(exports, "DropdownButton", {
243
+ enumerable: true,
244
+ get: function get() {
245
+ return _DropdownButton["default"];
246
+ }
247
+ });
248
+ Object.defineProperty(exports, "DropdownContent", {
249
+ enumerable: true,
250
+ get: function get() {
251
+ return _DropdownContent["default"];
252
+ }
253
+ });
236
254
  Object.defineProperty(exports, "ErrorMessage", {
237
255
  enumerable: true,
238
256
  get: function get() {
@@ -888,6 +906,12 @@ var _DetailsContent = _interopRequireDefault(require("@digigov/react-core/Detail
888
906
 
889
907
  var _DetailsSummary = _interopRequireDefault(require("@digigov/react-core/DetailsSummary"));
890
908
 
909
+ var _Dropdown = _interopRequireDefault(require("@digigov/react-core/Dropdown"));
910
+
911
+ var _DropdownButton = _interopRequireDefault(require("@digigov/react-core/DropdownButton"));
912
+
913
+ var _DropdownContent = _interopRequireDefault(require("@digigov/react-core/DropdownContent"));
914
+
891
915
  var _ErrorMessage = _interopRequireDefault(require("@digigov/react-core/ErrorMessage"));
892
916
 
893
917
  var _ErrorSummary = _interopRequireDefault(require("@digigov/react-core/ErrorSummary"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/react-core",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "@digigov react core components",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "directory": "dist"
12
12
  },
13
13
  "peerDependencies": {
14
- "@digigov/css": "0.12.0",
14
+ "@digigov/css": "0.13.1",
15
15
  "clsx": "1.1.1",
16
16
  "react": "16.14.0",
17
17
  "react-dom": "16.14.0"