@digigov/react-core 0.6.1 → 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 (118) hide show
  1. package/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
  2. package/ArrowIcon/index.d.ts +4 -3
  3. package/ArrowIcon/index.js +13 -27
  4. package/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
  5. package/BurgerIcon/index.d.ts +13 -7
  6. package/BurgerIcon/index.js +13 -33
  7. package/BurgerIcon/index.test.js +47 -5
  8. package/Button/index.d.ts +1 -1
  9. package/CHANGELOG.md +23 -1
  10. package/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
  11. package/CaretIcon/index.d.ts +4 -3
  12. package/CaretIcon/index.js +13 -27
  13. package/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
  14. package/CheckIcon/index.d.ts +7 -11
  15. package/CheckIcon/index.js +10 -34
  16. package/CheckboxItem/index.d.ts +1 -1
  17. package/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
  18. package/CloseIcon/index.d.ts +9 -3
  19. package/CloseIcon/index.js +10 -7
  20. package/DateInputItem/index.d.ts +1 -1
  21. package/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  22. package/Dropdown/index.d.ts +30 -0
  23. package/Dropdown/index.js +42 -0
  24. package/Dropdown/index.test.d.ts +1 -0
  25. package/Dropdown/index.test.js +101 -0
  26. package/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  27. package/DropdownButton/index.d.ts +28 -0
  28. package/DropdownButton/index.js +47 -0
  29. package/DropdownButton/index.test.d.ts +1 -0
  30. package/DropdownButton/index.test.js +195 -0
  31. package/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  32. package/DropdownContent/index.d.ts +9 -0
  33. package/DropdownContent/index.js +35 -0
  34. package/DropdownContent/index.test.d.ts +1 -0
  35. package/DropdownContent/index.test.js +15 -0
  36. package/FieldsetLegend/index.d.ts +1 -1
  37. package/FileUpload/index.d.ts +1 -1
  38. package/Grid/index.d.ts +1 -1
  39. package/LabelTitle/index.d.ts +1 -1
  40. package/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
  41. package/MoreVertIcon/index.d.ts +7 -11
  42. package/MoreVertIcon/index.js +10 -34
  43. package/NormalText/index.d.ts +1 -1
  44. package/Paragraph/index.d.ts +1 -1
  45. package/RadioItem/index.d.ts +1 -1
  46. package/Select/index.d.ts +1 -1
  47. package/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
  48. package/SvgIcon/index.d.ts +20 -0
  49. package/SvgIcon/index.js +41 -0
  50. package/SvgIcon/index.test.d.ts +1 -0
  51. package/SvgIcon/index.test.js +129 -0
  52. package/Table/index.d.ts +1 -1
  53. package/TableDataCell/index.d.ts +1 -1
  54. package/TableHeaderCell/index.d.ts +1 -1
  55. package/TextArea/index.d.ts +1 -1
  56. package/TextInput/index.d.ts +1 -1
  57. package/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
  58. package/UncheckIcon/index.d.ts +9 -13
  59. package/UncheckIcon/index.js +15 -39
  60. package/es/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
  61. package/es/ArrowIcon/index.js +12 -19
  62. package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
  63. package/es/BurgerIcon/index.js +12 -25
  64. package/es/BurgerIcon/index.test.js +47 -5
  65. package/es/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
  66. package/es/CaretIcon/index.js +12 -19
  67. package/es/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
  68. package/es/CheckIcon/index.js +9 -26
  69. package/es/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
  70. package/es/CloseIcon/index.js +9 -7
  71. package/es/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  72. package/es/Dropdown/index.js +27 -0
  73. package/es/Dropdown/index.test.js +95 -0
  74. package/es/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  75. package/es/DropdownButton/index.js +31 -0
  76. package/es/DropdownButton/index.test.js +189 -0
  77. package/es/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  78. package/es/DropdownContent/index.js +20 -0
  79. package/es/DropdownContent/index.test.js +9 -0
  80. package/es/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
  81. package/es/MoreVertIcon/index.js +9 -26
  82. package/es/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
  83. package/es/SvgIcon/index.js +26 -0
  84. package/es/SvgIcon/index.test.js +123 -0
  85. package/es/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
  86. package/es/UncheckIcon/index.js +12 -29
  87. package/es/index.js +4 -0
  88. package/esm/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
  89. package/esm/ArrowIcon/index.js +12 -19
  90. package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
  91. package/esm/BurgerIcon/index.js +12 -25
  92. package/esm/BurgerIcon/index.test.js +47 -5
  93. package/esm/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
  94. package/esm/CaretIcon/index.js +12 -19
  95. package/esm/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
  96. package/esm/CheckIcon/index.js +9 -26
  97. package/esm/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
  98. package/esm/CloseIcon/index.js +9 -7
  99. package/esm/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  100. package/esm/Dropdown/index.js +27 -0
  101. package/esm/Dropdown/index.test.js +95 -0
  102. package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  103. package/esm/DropdownButton/index.js +31 -0
  104. package/esm/DropdownButton/index.test.js +189 -0
  105. package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  106. package/esm/DropdownContent/index.js +20 -0
  107. package/esm/DropdownContent/index.test.js +9 -0
  108. package/esm/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
  109. package/esm/MoreVertIcon/index.js +9 -26
  110. package/esm/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
  111. package/esm/SvgIcon/index.js +26 -0
  112. package/esm/SvgIcon/index.test.js +123 -0
  113. package/esm/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
  114. package/esm/UncheckIcon/index.js +12 -29
  115. package/esm/index.js +5 -1
  116. package/index.d.ts +4 -0
  117. package/index.js +32 -0
  118. 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
+ });