@digigov/react-core 2.0.0-f2d82d25 → 2.0.0-rc.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.
@@ -19,6 +19,29 @@ exports[`renders the SvgIcon with no props 1`] = `
19
19
  </ForwardRef(SvgIcon)>
20
20
  `;
21
21
 
22
+ exports[`renders the SvgIcon with prop color=base-content 1`] = `
23
+ <ForwardRef(SvgIcon)
24
+ color="base-content"
25
+ >
26
+ <ForwardRef(Base)
27
+ aria-hidden="true"
28
+ as="svg"
29
+ className="ds-svg-icon--base-content ds-svg-icon"
30
+ focusable="false"
31
+ viewBox="0 0 24 24"
32
+ >
33
+ <svg
34
+ aria-hidden="true"
35
+ className="ds-svg-icon--base-content ds-svg-icon"
36
+ focusable="false"
37
+ viewBox="0 0 24 24"
38
+ >
39
+ hello
40
+ </svg>
41
+ </ForwardRef(Base)>
42
+ </ForwardRef(SvgIcon)>
43
+ `;
44
+
22
45
  exports[`renders the SvgIcon with prop color=dark 1`] = `
23
46
  <ForwardRef(SvgIcon)
24
47
  color="dark"
@@ -135,20 +158,20 @@ exports[`renders the SvgIcon with prop color=gray 1`] = `
135
158
  </ForwardRef(SvgIcon)>
136
159
  `;
137
160
 
138
- exports[`renders the SvgIcon with prop color=light 1`] = `
161
+ exports[`renders the SvgIcon with prop color=primary 1`] = `
139
162
  <ForwardRef(SvgIcon)
140
- color="light"
163
+ color="primary"
141
164
  >
142
165
  <ForwardRef(Base)
143
166
  aria-hidden="true"
144
167
  as="svg"
145
- className="ds-svg-icon--light ds-svg-icon"
168
+ className="ds-svg-icon--primary ds-svg-icon"
146
169
  focusable="false"
147
170
  viewBox="0 0 24 24"
148
171
  >
149
172
  <svg
150
173
  aria-hidden="true"
151
- className="ds-svg-icon--light ds-svg-icon"
174
+ className="ds-svg-icon--primary ds-svg-icon"
152
175
  focusable="false"
153
176
  viewBox="0 0 24 24"
154
177
  >
@@ -158,20 +181,20 @@ exports[`renders the SvgIcon with prop color=light 1`] = `
158
181
  </ForwardRef(SvgIcon)>
159
182
  `;
160
183
 
161
- exports[`renders the SvgIcon with prop color=primary 1`] = `
184
+ exports[`renders the SvgIcon with prop color=success 1`] = `
162
185
  <ForwardRef(SvgIcon)
163
- color="primary"
186
+ color="success"
164
187
  >
165
188
  <ForwardRef(Base)
166
189
  aria-hidden="true"
167
190
  as="svg"
168
- className="ds-svg-icon--primary ds-svg-icon"
191
+ className="ds-svg-icon--success ds-svg-icon"
169
192
  focusable="false"
170
193
  viewBox="0 0 24 24"
171
194
  >
172
195
  <svg
173
196
  aria-hidden="true"
174
- className="ds-svg-icon--primary ds-svg-icon"
197
+ className="ds-svg-icon--success ds-svg-icon"
175
198
  focusable="false"
176
199
  viewBox="0 0 24 24"
177
200
  >
@@ -181,20 +204,20 @@ exports[`renders the SvgIcon with prop color=primary 1`] = `
181
204
  </ForwardRef(SvgIcon)>
182
205
  `;
183
206
 
184
- exports[`renders the SvgIcon with prop color=success 1`] = `
207
+ exports[`renders the SvgIcon with prop color=warning 1`] = `
185
208
  <ForwardRef(SvgIcon)
186
- color="success"
209
+ color="warning"
187
210
  >
188
211
  <ForwardRef(Base)
189
212
  aria-hidden="true"
190
213
  as="svg"
191
- className="ds-svg-icon--success ds-svg-icon"
214
+ className="ds-svg-icon--warning ds-svg-icon"
192
215
  focusable="false"
193
216
  viewBox="0 0 24 24"
194
217
  >
195
218
  <svg
196
219
  aria-hidden="true"
197
- className="ds-svg-icon--success ds-svg-icon"
220
+ className="ds-svg-icon--warning ds-svg-icon"
198
221
  focusable="false"
199
222
  viewBox="0 0 24 24"
200
223
  >
@@ -204,20 +227,21 @@ exports[`renders the SvgIcon with prop color=success 1`] = `
204
227
  </ForwardRef(SvgIcon)>
205
228
  `;
206
229
 
207
- exports[`renders the SvgIcon with prop color=warning 1`] = `
230
+ exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
208
231
  <ForwardRef(SvgIcon)
209
232
  color="warning"
233
+ size="sm"
210
234
  >
211
235
  <ForwardRef(Base)
212
236
  aria-hidden="true"
213
237
  as="svg"
214
- className="ds-svg-icon--warning ds-svg-icon"
238
+ className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
215
239
  focusable="false"
216
240
  viewBox="0 0 24 24"
217
241
  >
218
242
  <svg
219
243
  aria-hidden="true"
220
- className="ds-svg-icon--warning ds-svg-icon"
244
+ className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
221
245
  focusable="false"
222
246
  viewBox="0 0 24 24"
223
247
  >
@@ -227,21 +251,20 @@ exports[`renders the SvgIcon with prop color=warning 1`] = `
227
251
  </ForwardRef(SvgIcon)>
228
252
  `;
229
253
 
230
- exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
254
+ exports[`renders the SvgIcon with prop color=white 1`] = `
231
255
  <ForwardRef(SvgIcon)
232
- color="warning"
233
- size="sm"
256
+ color="white"
234
257
  >
235
258
  <ForwardRef(Base)
236
259
  aria-hidden="true"
237
260
  as="svg"
238
- className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
261
+ className="ds-svg-icon--white ds-svg-icon"
239
262
  focusable="false"
240
263
  viewBox="0 0 24 24"
241
264
  >
242
265
  <svg
243
266
  aria-hidden="true"
244
- className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
267
+ className="ds-svg-icon--white ds-svg-icon"
245
268
  focusable="false"
246
269
  viewBox="0 0 24 24"
247
270
  >
@@ -15,18 +15,19 @@ export interface SvgIconProps extends BaseProps<'svg'> {
15
15
  /**
16
16
  * color property styles svg icon with Gov.gr palette's basic colors.
17
17
  * color property is optional.
18
- * @value 'dark'
19
- * @value 'light'
18
+ * @value 'base-content'
19
+ * @value 'dark', always dark, among all themes
20
+ * @value 'white', always white, among all themes
20
21
  * @value 'gray'
21
22
  * @value 'primary'
22
23
  * @value 'success'
23
24
  * @value 'warning'
24
25
  * @value 'error'
25
- * @value 'focus'
26
+ * @value 'focus', use only in focus state, in dark background
26
27
  * @value 'info'
27
28
  * @value 'link'
28
29
  */
29
- color?: 'dark' | 'light' | 'gray' | 'primary' | 'success' | 'warning' | 'error' | 'focus' | 'info' | 'link';
30
+ color?: 'base-content' | 'dark' | 'white' | 'gray' | 'primary' | 'success' | 'warning' | 'error' | 'focus' | 'info' | 'link';
30
31
  }
31
32
  /**
32
33
  * Use SvgIcon as global svg component.
@@ -36,64 +36,70 @@ it('renders the SvgIcon with prop size=xl', function () {
36
36
  expect(mount(_ref6)).toMatchSnapshot();
37
37
  });
38
38
  var _ref7 = /*#__PURE__*/React.createElement(SvgIcon, {
39
- color: "dark"
39
+ color: "base-content"
40
40
  }, "hello");
41
- it('renders the SvgIcon with prop color=dark', function () {
41
+ it('renders the SvgIcon with prop color=base-content', function () {
42
42
  expect(mount(_ref7)).toMatchSnapshot();
43
43
  });
44
44
  var _ref8 = /*#__PURE__*/React.createElement(SvgIcon, {
45
- color: "light"
45
+ color: "dark"
46
46
  }, "hello");
47
- it('renders the SvgIcon with prop color=light', function () {
47
+ it('renders the SvgIcon with prop color=dark', function () {
48
48
  expect(mount(_ref8)).toMatchSnapshot();
49
49
  });
50
50
  var _ref9 = /*#__PURE__*/React.createElement(SvgIcon, {
51
- color: "gray"
51
+ color: "white"
52
52
  }, "hello");
53
- it('renders the SvgIcon with prop color=gray', function () {
53
+ it('renders the SvgIcon with prop color=white', function () {
54
54
  expect(mount(_ref9)).toMatchSnapshot();
55
55
  });
56
56
  var _ref10 = /*#__PURE__*/React.createElement(SvgIcon, {
57
- color: "primary"
57
+ color: "gray"
58
58
  }, "hello");
59
- it('renders the SvgIcon with prop color=primary', function () {
59
+ it('renders the SvgIcon with prop color=gray', function () {
60
60
  expect(mount(_ref10)).toMatchSnapshot();
61
61
  });
62
62
  var _ref11 = /*#__PURE__*/React.createElement(SvgIcon, {
63
- color: "success"
63
+ color: "primary"
64
64
  }, "hello");
65
- it('renders the SvgIcon with prop color=success', function () {
65
+ it('renders the SvgIcon with prop color=primary', function () {
66
66
  expect(mount(_ref11)).toMatchSnapshot();
67
67
  });
68
68
  var _ref12 = /*#__PURE__*/React.createElement(SvgIcon, {
69
- color: "warning"
69
+ color: "success"
70
70
  }, "hello");
71
- it('renders the SvgIcon with prop color=warning', function () {
71
+ it('renders the SvgIcon with prop color=success', function () {
72
72
  expect(mount(_ref12)).toMatchSnapshot();
73
73
  });
74
74
  var _ref13 = /*#__PURE__*/React.createElement(SvgIcon, {
75
- color: "error"
75
+ color: "warning"
76
76
  }, "hello");
77
- it('renders the SvgIcon with prop color=error', function () {
77
+ it('renders the SvgIcon with prop color=warning', function () {
78
78
  expect(mount(_ref13)).toMatchSnapshot();
79
79
  });
80
80
  var _ref14 = /*#__PURE__*/React.createElement(SvgIcon, {
81
- color: "focus"
81
+ color: "error"
82
82
  }, "hello");
83
- it('renders the SvgIcon with prop color=focus', function () {
83
+ it('renders the SvgIcon with prop color=error', function () {
84
84
  expect(mount(_ref14)).toMatchSnapshot();
85
85
  });
86
86
  var _ref15 = /*#__PURE__*/React.createElement(SvgIcon, {
87
+ color: "focus"
88
+ }, "hello");
89
+ it('renders the SvgIcon with prop color=focus', function () {
90
+ expect(mount(_ref15)).toMatchSnapshot();
91
+ });
92
+ var _ref16 = /*#__PURE__*/React.createElement(SvgIcon, {
87
93
  color: "warning",
88
94
  size: "sm"
89
95
  }, "hello");
90
96
  it('renders the SvgIcon with prop color=warning and size=sm', function () {
91
- expect(mount(_ref15)).toMatchSnapshot();
97
+ expect(mount(_ref16)).toMatchSnapshot();
92
98
  });
93
- var _ref16 = /*#__PURE__*/React.createElement(SvgIcon, {
99
+ var _ref17 = /*#__PURE__*/React.createElement(SvgIcon, {
94
100
  color: "warning",
95
101
  size: "xl"
96
102
  }, "hello");
97
103
  it('renders the SvgIcon with prop color=error and size= xl', function () {
98
- expect(mount(_ref16)).toMatchSnapshot();
104
+ expect(mount(_ref17)).toMatchSnapshot();
99
105
  });
@@ -19,6 +19,29 @@ exports[`renders the SvgIcon with no props 1`] = `
19
19
  </ForwardRef(SvgIcon)>
20
20
  `;
21
21
 
22
+ exports[`renders the SvgIcon with prop color=base-content 1`] = `
23
+ <ForwardRef(SvgIcon)
24
+ color="base-content"
25
+ >
26
+ <ForwardRef(Base)
27
+ aria-hidden="true"
28
+ as="svg"
29
+ className="ds-svg-icon--base-content ds-svg-icon"
30
+ focusable="false"
31
+ viewBox="0 0 24 24"
32
+ >
33
+ <svg
34
+ aria-hidden="true"
35
+ className="ds-svg-icon--base-content ds-svg-icon"
36
+ focusable="false"
37
+ viewBox="0 0 24 24"
38
+ >
39
+ hello
40
+ </svg>
41
+ </ForwardRef(Base)>
42
+ </ForwardRef(SvgIcon)>
43
+ `;
44
+
22
45
  exports[`renders the SvgIcon with prop color=dark 1`] = `
23
46
  <ForwardRef(SvgIcon)
24
47
  color="dark"
@@ -135,20 +158,20 @@ exports[`renders the SvgIcon with prop color=gray 1`] = `
135
158
  </ForwardRef(SvgIcon)>
136
159
  `;
137
160
 
138
- exports[`renders the SvgIcon with prop color=light 1`] = `
161
+ exports[`renders the SvgIcon with prop color=primary 1`] = `
139
162
  <ForwardRef(SvgIcon)
140
- color="light"
163
+ color="primary"
141
164
  >
142
165
  <ForwardRef(Base)
143
166
  aria-hidden="true"
144
167
  as="svg"
145
- className="ds-svg-icon--light ds-svg-icon"
168
+ className="ds-svg-icon--primary ds-svg-icon"
146
169
  focusable="false"
147
170
  viewBox="0 0 24 24"
148
171
  >
149
172
  <svg
150
173
  aria-hidden="true"
151
- className="ds-svg-icon--light ds-svg-icon"
174
+ className="ds-svg-icon--primary ds-svg-icon"
152
175
  focusable="false"
153
176
  viewBox="0 0 24 24"
154
177
  >
@@ -158,20 +181,20 @@ exports[`renders the SvgIcon with prop color=light 1`] = `
158
181
  </ForwardRef(SvgIcon)>
159
182
  `;
160
183
 
161
- exports[`renders the SvgIcon with prop color=primary 1`] = `
184
+ exports[`renders the SvgIcon with prop color=success 1`] = `
162
185
  <ForwardRef(SvgIcon)
163
- color="primary"
186
+ color="success"
164
187
  >
165
188
  <ForwardRef(Base)
166
189
  aria-hidden="true"
167
190
  as="svg"
168
- className="ds-svg-icon--primary ds-svg-icon"
191
+ className="ds-svg-icon--success ds-svg-icon"
169
192
  focusable="false"
170
193
  viewBox="0 0 24 24"
171
194
  >
172
195
  <svg
173
196
  aria-hidden="true"
174
- className="ds-svg-icon--primary ds-svg-icon"
197
+ className="ds-svg-icon--success ds-svg-icon"
175
198
  focusable="false"
176
199
  viewBox="0 0 24 24"
177
200
  >
@@ -181,20 +204,20 @@ exports[`renders the SvgIcon with prop color=primary 1`] = `
181
204
  </ForwardRef(SvgIcon)>
182
205
  `;
183
206
 
184
- exports[`renders the SvgIcon with prop color=success 1`] = `
207
+ exports[`renders the SvgIcon with prop color=warning 1`] = `
185
208
  <ForwardRef(SvgIcon)
186
- color="success"
209
+ color="warning"
187
210
  >
188
211
  <ForwardRef(Base)
189
212
  aria-hidden="true"
190
213
  as="svg"
191
- className="ds-svg-icon--success ds-svg-icon"
214
+ className="ds-svg-icon--warning ds-svg-icon"
192
215
  focusable="false"
193
216
  viewBox="0 0 24 24"
194
217
  >
195
218
  <svg
196
219
  aria-hidden="true"
197
- className="ds-svg-icon--success ds-svg-icon"
220
+ className="ds-svg-icon--warning ds-svg-icon"
198
221
  focusable="false"
199
222
  viewBox="0 0 24 24"
200
223
  >
@@ -204,20 +227,21 @@ exports[`renders the SvgIcon with prop color=success 1`] = `
204
227
  </ForwardRef(SvgIcon)>
205
228
  `;
206
229
 
207
- exports[`renders the SvgIcon with prop color=warning 1`] = `
230
+ exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
208
231
  <ForwardRef(SvgIcon)
209
232
  color="warning"
233
+ size="sm"
210
234
  >
211
235
  <ForwardRef(Base)
212
236
  aria-hidden="true"
213
237
  as="svg"
214
- className="ds-svg-icon--warning ds-svg-icon"
238
+ className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
215
239
  focusable="false"
216
240
  viewBox="0 0 24 24"
217
241
  >
218
242
  <svg
219
243
  aria-hidden="true"
220
- className="ds-svg-icon--warning ds-svg-icon"
244
+ className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
221
245
  focusable="false"
222
246
  viewBox="0 0 24 24"
223
247
  >
@@ -227,21 +251,20 @@ exports[`renders the SvgIcon with prop color=warning 1`] = `
227
251
  </ForwardRef(SvgIcon)>
228
252
  `;
229
253
 
230
- exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
254
+ exports[`renders the SvgIcon with prop color=white 1`] = `
231
255
  <ForwardRef(SvgIcon)
232
- color="warning"
233
- size="sm"
256
+ color="white"
234
257
  >
235
258
  <ForwardRef(Base)
236
259
  aria-hidden="true"
237
260
  as="svg"
238
- className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
261
+ className="ds-svg-icon--white ds-svg-icon"
239
262
  focusable="false"
240
263
  viewBox="0 0 24 24"
241
264
  >
242
265
  <svg
243
266
  aria-hidden="true"
244
- className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
267
+ className="ds-svg-icon--white ds-svg-icon"
245
268
  focusable="false"
246
269
  viewBox="0 0 24 24"
247
270
  >
@@ -39,64 +39,70 @@ it('renders the SvgIcon with prop size=xl', function () {
39
39
  expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
40
40
  });
41
41
  var _ref7 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
42
- color: "dark"
42
+ color: "base-content"
43
43
  }, "hello");
44
- it('renders the SvgIcon with prop color=dark', function () {
44
+ it('renders the SvgIcon with prop color=base-content', function () {
45
45
  expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
46
46
  });
47
47
  var _ref8 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
48
- color: "light"
48
+ color: "dark"
49
49
  }, "hello");
50
- it('renders the SvgIcon with prop color=light', function () {
50
+ it('renders the SvgIcon with prop color=dark', function () {
51
51
  expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
52
52
  });
53
53
  var _ref9 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
54
- color: "gray"
54
+ color: "white"
55
55
  }, "hello");
56
- it('renders the SvgIcon with prop color=gray', function () {
56
+ it('renders the SvgIcon with prop color=white', function () {
57
57
  expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
58
58
  });
59
59
  var _ref10 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
60
- color: "primary"
60
+ color: "gray"
61
61
  }, "hello");
62
- it('renders the SvgIcon with prop color=primary', function () {
62
+ it('renders the SvgIcon with prop color=gray', function () {
63
63
  expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
64
64
  });
65
65
  var _ref11 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
66
- color: "success"
66
+ color: "primary"
67
67
  }, "hello");
68
- it('renders the SvgIcon with prop color=success', function () {
68
+ it('renders the SvgIcon with prop color=primary', function () {
69
69
  expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
70
70
  });
71
71
  var _ref12 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
72
- color: "warning"
72
+ color: "success"
73
73
  }, "hello");
74
- it('renders the SvgIcon with prop color=warning', function () {
74
+ it('renders the SvgIcon with prop color=success', function () {
75
75
  expect((0, _enzyme.mount)(_ref12)).toMatchSnapshot();
76
76
  });
77
77
  var _ref13 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
78
- color: "error"
78
+ color: "warning"
79
79
  }, "hello");
80
- it('renders the SvgIcon with prop color=error', function () {
80
+ it('renders the SvgIcon with prop color=warning', function () {
81
81
  expect((0, _enzyme.mount)(_ref13)).toMatchSnapshot();
82
82
  });
83
83
  var _ref14 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
84
- color: "focus"
84
+ color: "error"
85
85
  }, "hello");
86
- it('renders the SvgIcon with prop color=focus', function () {
86
+ it('renders the SvgIcon with prop color=error', function () {
87
87
  expect((0, _enzyme.mount)(_ref14)).toMatchSnapshot();
88
88
  });
89
89
  var _ref15 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
90
+ color: "focus"
91
+ }, "hello");
92
+ it('renders the SvgIcon with prop color=focus', function () {
93
+ expect((0, _enzyme.mount)(_ref15)).toMatchSnapshot();
94
+ });
95
+ var _ref16 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
90
96
  color: "warning",
91
97
  size: "sm"
92
98
  }, "hello");
93
99
  it('renders the SvgIcon with prop color=warning and size=sm', function () {
94
- expect((0, _enzyme.mount)(_ref15)).toMatchSnapshot();
100
+ expect((0, _enzyme.mount)(_ref16)).toMatchSnapshot();
95
101
  });
96
- var _ref16 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
102
+ var _ref17 = /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], {
97
103
  color: "warning",
98
104
  size: "xl"
99
105
  }, "hello");
100
106
  it('renders the SvgIcon with prop color=error and size= xl', function () {
101
- expect((0, _enzyme.mount)(_ref16)).toMatchSnapshot();
107
+ expect((0, _enzyme.mount)(_ref17)).toMatchSnapshot();
102
108
  });