@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,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
export interface AccessibilityIconProps extends SvgIconProps {
|
|
5
|
+
/**
|
|
6
|
+
* ref is optional.
|
|
7
|
+
* ref prop declares the reference of the svg icon component.
|
|
8
|
+
* It can be used to to access the DOM element and the React element.
|
|
9
|
+
*/
|
|
10
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Use AccessibilityIcon component when you need to show web accessibility options.
|
|
14
|
+
*/
|
|
15
|
+
export const AccessibilityIcon: React.FC<AccessibilityIconProps> = React.forwardRef<
|
|
16
|
+
SVGSVGElement,
|
|
17
|
+
AccessibilityIconProps
|
|
18
|
+
>(function AccessibilityIcon({ size, variant, className, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<SvgIcon
|
|
21
|
+
size={size}
|
|
22
|
+
variant={variant}
|
|
23
|
+
className={clsx(className, {
|
|
24
|
+
'govgr-svg-icon--accessibility': true,
|
|
25
|
+
})}
|
|
26
|
+
ref={ref}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
<title>Μενού Προσβασιμότητας</title>
|
|
30
|
+
<circle cx="12" cy="3" r="3"/>
|
|
31
|
+
<path
|
|
32
|
+
d="M19.76,6.13c-4.94,2.01-10.57,2.01-15.51,0c-0.71-0.3-1.55-0.04-1.98,0.66c-1.41,2.6,3.27,3.76,4.94,4.37
|
|
33
|
+
c0.4,0.11,0.81,0.2,1.22,0.28c0.56,0.11,0.92,0.67,0.79,1.25c-0.79,3.66-1.96,9.1-1.96,9.1c-0.46,2.27,2.72,3.15,3.39,0.92L12,17.93
|
|
34
|
+
l1.36,4.78c0.67,2.22,3.85,1.36,3.39-0.92c0,0-1.16-5.4-1.95-9.06c-0.12-0.57,0.22-1.16,0.77-1.27c2.01-0.41,3.94-1.17,5.68-2.31
|
|
35
|
+
C22.89,8.04,21.58,5.38,19.76,6.13z"
|
|
36
|
+
/>{' '}
|
|
37
|
+
</SvgIcon>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export default AccessibilityIcon;
|
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AccessibilityTextIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(AccessibilityTextIcon)>
|
|
5
|
+
<ForwardRef(SvgIcon)>
|
|
6
|
+
<ForwardRef(Base)
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
as="svg"
|
|
9
|
+
className="govgr-svg-icon"
|
|
10
|
+
focusable="false"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
>
|
|
13
|
+
<svg
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
className="govgr-svg-icon"
|
|
16
|
+
focusable="false"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
>
|
|
19
|
+
<g>
|
|
20
|
+
<path
|
|
21
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
25
|
+
/>
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
28
|
+
</ForwardRef(Base)>
|
|
29
|
+
</ForwardRef(SvgIcon)>
|
|
30
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`renders the AccessibilityTextIcon with prop size=l 1`] = `
|
|
34
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
35
|
+
size="l"
|
|
36
|
+
>
|
|
37
|
+
<ForwardRef(SvgIcon)
|
|
38
|
+
size="l"
|
|
39
|
+
>
|
|
40
|
+
<ForwardRef(Base)
|
|
41
|
+
aria-hidden="true"
|
|
42
|
+
as="svg"
|
|
43
|
+
className="govgr-svg-icon--l govgr-svg-icon"
|
|
44
|
+
focusable="false"
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
>
|
|
47
|
+
<svg
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
className="govgr-svg-icon--l govgr-svg-icon"
|
|
50
|
+
focusable="false"
|
|
51
|
+
viewBox="0 0 24 24"
|
|
52
|
+
>
|
|
53
|
+
<g>
|
|
54
|
+
<path
|
|
55
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
56
|
+
/>
|
|
57
|
+
<path
|
|
58
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
59
|
+
/>
|
|
60
|
+
</g>
|
|
61
|
+
</svg>
|
|
62
|
+
</ForwardRef(Base)>
|
|
63
|
+
</ForwardRef(SvgIcon)>
|
|
64
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`renders the AccessibilityTextIcon with prop size=m 1`] = `
|
|
68
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
69
|
+
size="m"
|
|
70
|
+
>
|
|
71
|
+
<ForwardRef(SvgIcon)
|
|
72
|
+
size="m"
|
|
73
|
+
>
|
|
74
|
+
<ForwardRef(Base)
|
|
75
|
+
aria-hidden="true"
|
|
76
|
+
as="svg"
|
|
77
|
+
className="govgr-svg-icon--m govgr-svg-icon"
|
|
78
|
+
focusable="false"
|
|
79
|
+
viewBox="0 0 24 24"
|
|
80
|
+
>
|
|
81
|
+
<svg
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
className="govgr-svg-icon--m govgr-svg-icon"
|
|
84
|
+
focusable="false"
|
|
85
|
+
viewBox="0 0 24 24"
|
|
86
|
+
>
|
|
87
|
+
<g>
|
|
88
|
+
<path
|
|
89
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
90
|
+
/>
|
|
91
|
+
<path
|
|
92
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
93
|
+
/>
|
|
94
|
+
</g>
|
|
95
|
+
</svg>
|
|
96
|
+
</ForwardRef(Base)>
|
|
97
|
+
</ForwardRef(SvgIcon)>
|
|
98
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`renders the AccessibilityTextIcon with prop size=s 1`] = `
|
|
102
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
103
|
+
size="s"
|
|
104
|
+
>
|
|
105
|
+
<ForwardRef(SvgIcon)
|
|
106
|
+
size="s"
|
|
107
|
+
>
|
|
108
|
+
<ForwardRef(Base)
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
as="svg"
|
|
111
|
+
className="govgr-svg-icon--s govgr-svg-icon"
|
|
112
|
+
focusable="false"
|
|
113
|
+
viewBox="0 0 24 24"
|
|
114
|
+
>
|
|
115
|
+
<svg
|
|
116
|
+
aria-hidden="true"
|
|
117
|
+
className="govgr-svg-icon--s govgr-svg-icon"
|
|
118
|
+
focusable="false"
|
|
119
|
+
viewBox="0 0 24 24"
|
|
120
|
+
>
|
|
121
|
+
<g>
|
|
122
|
+
<path
|
|
123
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
124
|
+
/>
|
|
125
|
+
<path
|
|
126
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
127
|
+
/>
|
|
128
|
+
</g>
|
|
129
|
+
</svg>
|
|
130
|
+
</ForwardRef(Base)>
|
|
131
|
+
</ForwardRef(SvgIcon)>
|
|
132
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
exports[`renders the AccessibilityTextIcon with prop size=xl 1`] = `
|
|
136
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
137
|
+
size="xl"
|
|
138
|
+
>
|
|
139
|
+
<ForwardRef(SvgIcon)
|
|
140
|
+
size="xl"
|
|
141
|
+
>
|
|
142
|
+
<ForwardRef(Base)
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
as="svg"
|
|
145
|
+
className="govgr-svg-icon--xl govgr-svg-icon"
|
|
146
|
+
focusable="false"
|
|
147
|
+
viewBox="0 0 24 24"
|
|
148
|
+
>
|
|
149
|
+
<svg
|
|
150
|
+
aria-hidden="true"
|
|
151
|
+
className="govgr-svg-icon--xl govgr-svg-icon"
|
|
152
|
+
focusable="false"
|
|
153
|
+
viewBox="0 0 24 24"
|
|
154
|
+
>
|
|
155
|
+
<g>
|
|
156
|
+
<path
|
|
157
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
158
|
+
/>
|
|
159
|
+
<path
|
|
160
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
161
|
+
/>
|
|
162
|
+
</g>
|
|
163
|
+
</svg>
|
|
164
|
+
</ForwardRef(Base)>
|
|
165
|
+
</ForwardRef(SvgIcon)>
|
|
166
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
exports[`renders the AccessibilityTextIcon with prop variant=dark 1`] = `
|
|
170
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
171
|
+
variant="dark"
|
|
172
|
+
>
|
|
173
|
+
<ForwardRef(SvgIcon)
|
|
174
|
+
variant="dark"
|
|
175
|
+
>
|
|
176
|
+
<ForwardRef(Base)
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
as="svg"
|
|
179
|
+
className="govgr-svg-icon--dark govgr-svg-icon"
|
|
180
|
+
focusable="false"
|
|
181
|
+
viewBox="0 0 24 24"
|
|
182
|
+
>
|
|
183
|
+
<svg
|
|
184
|
+
aria-hidden="true"
|
|
185
|
+
className="govgr-svg-icon--dark govgr-svg-icon"
|
|
186
|
+
focusable="false"
|
|
187
|
+
viewBox="0 0 24 24"
|
|
188
|
+
>
|
|
189
|
+
<g>
|
|
190
|
+
<path
|
|
191
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
192
|
+
/>
|
|
193
|
+
<path
|
|
194
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
195
|
+
/>
|
|
196
|
+
</g>
|
|
197
|
+
</svg>
|
|
198
|
+
</ForwardRef(Base)>
|
|
199
|
+
</ForwardRef(SvgIcon)>
|
|
200
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
201
|
+
`;
|
|
202
|
+
|
|
203
|
+
exports[`renders the AccessibilityTextIcon with prop variant=error 1`] = `
|
|
204
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
205
|
+
variant="error"
|
|
206
|
+
>
|
|
207
|
+
<ForwardRef(SvgIcon)
|
|
208
|
+
variant="error"
|
|
209
|
+
>
|
|
210
|
+
<ForwardRef(Base)
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
as="svg"
|
|
213
|
+
className="govgr-svg-icon--error govgr-svg-icon"
|
|
214
|
+
focusable="false"
|
|
215
|
+
viewBox="0 0 24 24"
|
|
216
|
+
>
|
|
217
|
+
<svg
|
|
218
|
+
aria-hidden="true"
|
|
219
|
+
className="govgr-svg-icon--error govgr-svg-icon"
|
|
220
|
+
focusable="false"
|
|
221
|
+
viewBox="0 0 24 24"
|
|
222
|
+
>
|
|
223
|
+
<g>
|
|
224
|
+
<path
|
|
225
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
226
|
+
/>
|
|
227
|
+
<path
|
|
228
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
229
|
+
/>
|
|
230
|
+
</g>
|
|
231
|
+
</svg>
|
|
232
|
+
</ForwardRef(Base)>
|
|
233
|
+
</ForwardRef(SvgIcon)>
|
|
234
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
235
|
+
`;
|
|
236
|
+
|
|
237
|
+
exports[`renders the AccessibilityTextIcon with prop variant=error and size= xl 1`] = `
|
|
238
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
239
|
+
size="xl"
|
|
240
|
+
variant="warning"
|
|
241
|
+
>
|
|
242
|
+
<ForwardRef(SvgIcon)
|
|
243
|
+
size="xl"
|
|
244
|
+
variant="warning"
|
|
245
|
+
>
|
|
246
|
+
<ForwardRef(Base)
|
|
247
|
+
aria-hidden="true"
|
|
248
|
+
as="svg"
|
|
249
|
+
className="govgr-svg-icon--warning govgr-svg-icon--xl govgr-svg-icon"
|
|
250
|
+
focusable="false"
|
|
251
|
+
viewBox="0 0 24 24"
|
|
252
|
+
>
|
|
253
|
+
<svg
|
|
254
|
+
aria-hidden="true"
|
|
255
|
+
className="govgr-svg-icon--warning govgr-svg-icon--xl govgr-svg-icon"
|
|
256
|
+
focusable="false"
|
|
257
|
+
viewBox="0 0 24 24"
|
|
258
|
+
>
|
|
259
|
+
<g>
|
|
260
|
+
<path
|
|
261
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
262
|
+
/>
|
|
263
|
+
<path
|
|
264
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
265
|
+
/>
|
|
266
|
+
</g>
|
|
267
|
+
</svg>
|
|
268
|
+
</ForwardRef(Base)>
|
|
269
|
+
</ForwardRef(SvgIcon)>
|
|
270
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
271
|
+
`;
|
|
272
|
+
|
|
273
|
+
exports[`renders the AccessibilityTextIcon with prop variant=focus 1`] = `
|
|
274
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
275
|
+
variant="focus"
|
|
276
|
+
>
|
|
277
|
+
<ForwardRef(SvgIcon)
|
|
278
|
+
variant="focus"
|
|
279
|
+
>
|
|
280
|
+
<ForwardRef(Base)
|
|
281
|
+
aria-hidden="true"
|
|
282
|
+
as="svg"
|
|
283
|
+
className="govgr-svg-icon--focus govgr-svg-icon"
|
|
284
|
+
focusable="false"
|
|
285
|
+
viewBox="0 0 24 24"
|
|
286
|
+
>
|
|
287
|
+
<svg
|
|
288
|
+
aria-hidden="true"
|
|
289
|
+
className="govgr-svg-icon--focus govgr-svg-icon"
|
|
290
|
+
focusable="false"
|
|
291
|
+
viewBox="0 0 24 24"
|
|
292
|
+
>
|
|
293
|
+
<g>
|
|
294
|
+
<path
|
|
295
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
296
|
+
/>
|
|
297
|
+
<path
|
|
298
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
299
|
+
/>
|
|
300
|
+
</g>
|
|
301
|
+
</svg>
|
|
302
|
+
</ForwardRef(Base)>
|
|
303
|
+
</ForwardRef(SvgIcon)>
|
|
304
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
305
|
+
`;
|
|
306
|
+
|
|
307
|
+
exports[`renders the AccessibilityTextIcon with prop variant=gray 1`] = `
|
|
308
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
309
|
+
variant="gray"
|
|
310
|
+
>
|
|
311
|
+
<ForwardRef(SvgIcon)
|
|
312
|
+
variant="gray"
|
|
313
|
+
>
|
|
314
|
+
<ForwardRef(Base)
|
|
315
|
+
aria-hidden="true"
|
|
316
|
+
as="svg"
|
|
317
|
+
className="govgr-svg-icon--gray govgr-svg-icon"
|
|
318
|
+
focusable="false"
|
|
319
|
+
viewBox="0 0 24 24"
|
|
320
|
+
>
|
|
321
|
+
<svg
|
|
322
|
+
aria-hidden="true"
|
|
323
|
+
className="govgr-svg-icon--gray govgr-svg-icon"
|
|
324
|
+
focusable="false"
|
|
325
|
+
viewBox="0 0 24 24"
|
|
326
|
+
>
|
|
327
|
+
<g>
|
|
328
|
+
<path
|
|
329
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
330
|
+
/>
|
|
331
|
+
<path
|
|
332
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
333
|
+
/>
|
|
334
|
+
</g>
|
|
335
|
+
</svg>
|
|
336
|
+
</ForwardRef(Base)>
|
|
337
|
+
</ForwardRef(SvgIcon)>
|
|
338
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
339
|
+
`;
|
|
340
|
+
|
|
341
|
+
exports[`renders the AccessibilityTextIcon with prop variant=light 1`] = `
|
|
342
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
343
|
+
variant="light"
|
|
344
|
+
>
|
|
345
|
+
<ForwardRef(SvgIcon)
|
|
346
|
+
variant="light"
|
|
347
|
+
>
|
|
348
|
+
<ForwardRef(Base)
|
|
349
|
+
aria-hidden="true"
|
|
350
|
+
as="svg"
|
|
351
|
+
className="govgr-svg-icon--light govgr-svg-icon"
|
|
352
|
+
focusable="false"
|
|
353
|
+
viewBox="0 0 24 24"
|
|
354
|
+
>
|
|
355
|
+
<svg
|
|
356
|
+
aria-hidden="true"
|
|
357
|
+
className="govgr-svg-icon--light govgr-svg-icon"
|
|
358
|
+
focusable="false"
|
|
359
|
+
viewBox="0 0 24 24"
|
|
360
|
+
>
|
|
361
|
+
<g>
|
|
362
|
+
<path
|
|
363
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
364
|
+
/>
|
|
365
|
+
<path
|
|
366
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
367
|
+
/>
|
|
368
|
+
</g>
|
|
369
|
+
</svg>
|
|
370
|
+
</ForwardRef(Base)>
|
|
371
|
+
</ForwardRef(SvgIcon)>
|
|
372
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
373
|
+
`;
|
|
374
|
+
|
|
375
|
+
exports[`renders the AccessibilityTextIcon with prop variant=primary 1`] = `
|
|
376
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
377
|
+
variant="primary"
|
|
378
|
+
>
|
|
379
|
+
<ForwardRef(SvgIcon)
|
|
380
|
+
variant="primary"
|
|
381
|
+
>
|
|
382
|
+
<ForwardRef(Base)
|
|
383
|
+
aria-hidden="true"
|
|
384
|
+
as="svg"
|
|
385
|
+
className="govgr-svg-icon--primary govgr-svg-icon"
|
|
386
|
+
focusable="false"
|
|
387
|
+
viewBox="0 0 24 24"
|
|
388
|
+
>
|
|
389
|
+
<svg
|
|
390
|
+
aria-hidden="true"
|
|
391
|
+
className="govgr-svg-icon--primary govgr-svg-icon"
|
|
392
|
+
focusable="false"
|
|
393
|
+
viewBox="0 0 24 24"
|
|
394
|
+
>
|
|
395
|
+
<g>
|
|
396
|
+
<path
|
|
397
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
398
|
+
/>
|
|
399
|
+
<path
|
|
400
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
401
|
+
/>
|
|
402
|
+
</g>
|
|
403
|
+
</svg>
|
|
404
|
+
</ForwardRef(Base)>
|
|
405
|
+
</ForwardRef(SvgIcon)>
|
|
406
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
407
|
+
`;
|
|
408
|
+
|
|
409
|
+
exports[`renders the AccessibilityTextIcon with prop variant=success 1`] = `
|
|
410
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
411
|
+
variant="success"
|
|
412
|
+
>
|
|
413
|
+
<ForwardRef(SvgIcon)
|
|
414
|
+
variant="success"
|
|
415
|
+
>
|
|
416
|
+
<ForwardRef(Base)
|
|
417
|
+
aria-hidden="true"
|
|
418
|
+
as="svg"
|
|
419
|
+
className="govgr-svg-icon--success govgr-svg-icon"
|
|
420
|
+
focusable="false"
|
|
421
|
+
viewBox="0 0 24 24"
|
|
422
|
+
>
|
|
423
|
+
<svg
|
|
424
|
+
aria-hidden="true"
|
|
425
|
+
className="govgr-svg-icon--success govgr-svg-icon"
|
|
426
|
+
focusable="false"
|
|
427
|
+
viewBox="0 0 24 24"
|
|
428
|
+
>
|
|
429
|
+
<g>
|
|
430
|
+
<path
|
|
431
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
432
|
+
/>
|
|
433
|
+
<path
|
|
434
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
435
|
+
/>
|
|
436
|
+
</g>
|
|
437
|
+
</svg>
|
|
438
|
+
</ForwardRef(Base)>
|
|
439
|
+
</ForwardRef(SvgIcon)>
|
|
440
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
441
|
+
`;
|
|
442
|
+
|
|
443
|
+
exports[`renders the AccessibilityTextIcon with prop variant=warning 1`] = `
|
|
444
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
445
|
+
variant="warning"
|
|
446
|
+
>
|
|
447
|
+
<ForwardRef(SvgIcon)
|
|
448
|
+
variant="warning"
|
|
449
|
+
>
|
|
450
|
+
<ForwardRef(Base)
|
|
451
|
+
aria-hidden="true"
|
|
452
|
+
as="svg"
|
|
453
|
+
className="govgr-svg-icon--warning govgr-svg-icon"
|
|
454
|
+
focusable="false"
|
|
455
|
+
viewBox="0 0 24 24"
|
|
456
|
+
>
|
|
457
|
+
<svg
|
|
458
|
+
aria-hidden="true"
|
|
459
|
+
className="govgr-svg-icon--warning govgr-svg-icon"
|
|
460
|
+
focusable="false"
|
|
461
|
+
viewBox="0 0 24 24"
|
|
462
|
+
>
|
|
463
|
+
<g>
|
|
464
|
+
<path
|
|
465
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
466
|
+
/>
|
|
467
|
+
<path
|
|
468
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
469
|
+
/>
|
|
470
|
+
</g>
|
|
471
|
+
</svg>
|
|
472
|
+
</ForwardRef(Base)>
|
|
473
|
+
</ForwardRef(SvgIcon)>
|
|
474
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
475
|
+
`;
|
|
476
|
+
|
|
477
|
+
exports[`renders the AccessibilityTextIcon with prop variant=warning and size=s 1`] = `
|
|
478
|
+
<ForwardRef(AccessibilityTextIcon)
|
|
479
|
+
size="s"
|
|
480
|
+
variant="warning"
|
|
481
|
+
>
|
|
482
|
+
<ForwardRef(SvgIcon)
|
|
483
|
+
size="s"
|
|
484
|
+
variant="warning"
|
|
485
|
+
>
|
|
486
|
+
<ForwardRef(Base)
|
|
487
|
+
aria-hidden="true"
|
|
488
|
+
as="svg"
|
|
489
|
+
className="govgr-svg-icon--warning govgr-svg-icon--s govgr-svg-icon"
|
|
490
|
+
focusable="false"
|
|
491
|
+
viewBox="0 0 24 24"
|
|
492
|
+
>
|
|
493
|
+
<svg
|
|
494
|
+
aria-hidden="true"
|
|
495
|
+
className="govgr-svg-icon--warning govgr-svg-icon--s govgr-svg-icon"
|
|
496
|
+
focusable="false"
|
|
497
|
+
viewBox="0 0 24 24"
|
|
498
|
+
>
|
|
499
|
+
<g>
|
|
500
|
+
<path
|
|
501
|
+
d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z"
|
|
502
|
+
/>
|
|
503
|
+
<path
|
|
504
|
+
d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z"
|
|
505
|
+
/>
|
|
506
|
+
</g>
|
|
507
|
+
</svg>
|
|
508
|
+
</ForwardRef(Base)>
|
|
509
|
+
</ForwardRef(SvgIcon)>
|
|
510
|
+
</ForwardRef(AccessibilityTextIcon)>
|
|
511
|
+
`;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import AccessibilityTextIcon from '@digigov/react-core/AccessibilityTextIcon';
|
|
5
|
+
|
|
6
|
+
it('renders the AccessibilityTextIcon with no props', () => {
|
|
7
|
+
expect(mount(<AccessibilityTextIcon />)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
it('renders the AccessibilityTextIcon with prop size=s', () => {
|
|
10
|
+
expect(mount(<AccessibilityTextIcon size="s" />)).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
it('renders the AccessibilityTextIcon with prop size=m', () => {
|
|
13
|
+
expect(mount(<AccessibilityTextIcon size="m" />)).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
it('renders the AccessibilityTextIcon with prop size=l', () => {
|
|
16
|
+
expect(mount(<AccessibilityTextIcon size="l" />)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
it('renders the AccessibilityTextIcon with prop size=xl', () => {
|
|
19
|
+
expect(mount(<AccessibilityTextIcon size="xl" />)).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it('renders the AccessibilityTextIcon with prop variant=dark', () => {
|
|
22
|
+
expect(mount(<AccessibilityTextIcon variant="dark" />)).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
it('renders the AccessibilityTextIcon with prop variant=light', () => {
|
|
25
|
+
expect(mount(<AccessibilityTextIcon variant="light" />)).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
it('renders the AccessibilityTextIcon with prop variant=gray', () => {
|
|
28
|
+
expect(mount(<AccessibilityTextIcon variant="gray" />)).toMatchSnapshot();
|
|
29
|
+
});
|
|
30
|
+
it('renders the AccessibilityTextIcon with prop variant=primary', () => {
|
|
31
|
+
expect(mount(<AccessibilityTextIcon variant="primary" />)).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
it('renders the AccessibilityTextIcon with prop variant=success', () => {
|
|
34
|
+
expect(mount(<AccessibilityTextIcon variant="success" />)).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
it('renders the AccessibilityTextIcon with prop variant=warning', () => {
|
|
37
|
+
expect(mount(<AccessibilityTextIcon variant="warning" />)).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
it('renders the AccessibilityTextIcon with prop variant=error', () => {
|
|
40
|
+
expect(mount(<AccessibilityTextIcon variant="error" />)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
it('renders the AccessibilityTextIcon with prop variant=focus', () => {
|
|
43
|
+
expect(mount(<AccessibilityTextIcon variant="focus" />)).toMatchSnapshot();
|
|
44
|
+
});
|
|
45
|
+
it('renders the AccessibilityTextIcon with prop variant=warning and size=s', () => {
|
|
46
|
+
expect(mount(<AccessibilityTextIcon variant="warning" size="s" />)).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('renders the AccessibilityTextIcon with prop variant=error and size= xl', () => {
|
|
49
|
+
expect(mount(<AccessibilityTextIcon variant="warning" size="xl" />)).toMatchSnapshot();
|
|
50
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
|
|
3
|
+
export interface AccessibilityTextIconProps extends SvgIconProps {
|
|
4
|
+
/**
|
|
5
|
+
* ref is optional.
|
|
6
|
+
* ref prop declares the reference of the svg icon component.
|
|
7
|
+
* It can be used to to access the DOM element and the React element.
|
|
8
|
+
*/
|
|
9
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Use AccessibilityTextIcon component when you need to show web accessibility options about text.
|
|
13
|
+
*/
|
|
14
|
+
export const AccessibilityTextIcon: React.FC<AccessibilityTextIconProps> = React.forwardRef<
|
|
15
|
+
SVGSVGElement,
|
|
16
|
+
AccessibilityTextIconProps
|
|
17
|
+
>(function AccessibilityTextIcon({ ...props }, ref) {
|
|
18
|
+
return (
|
|
19
|
+
<SvgIcon ref={ref} {...props}>
|
|
20
|
+
<g>
|
|
21
|
+
<path d="M19.79,16.09h-6.2l-1.3,3.73H9.41l6.04-16h2.49l6.05,16h-2.9L19.79,16.09z M14.37,13.85h4.64l-2.32-6.64L14.37,13.85z" />
|
|
22
|
+
<path d="M6.09,17.63H2.45l-0.76,2.18H0l3.54-9.38H5l3.55,9.38h-1.7L6.09,17.63z M2.91,16.32h2.72l-1.36-3.89L2.91,16.32z" />
|
|
23
|
+
</g>
|
|
24
|
+
</SvgIcon>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default AccessibilityTextIcon;
|
|
@@ -2,20 +2,26 @@ import React from 'react';
|
|
|
2
2
|
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
export interface DetailsSummaryProps extends BaseProps<'summary'> {
|
|
5
|
+
export interface DetailsSummaryProps extends BaseProps<'summary'> {
|
|
6
|
+
/*
|
|
7
|
+
** size is optional. Default value is 'm'.
|
|
8
|
+
*/
|
|
9
|
+
size?: 'm' | 'l';
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* Use this inside Details.DetailsSummary will be the text to click on.
|
|
8
13
|
*/
|
|
9
14
|
export const DetailsSummary = React.forwardRef<
|
|
10
15
|
HTMLElement,
|
|
11
16
|
DetailsSummaryProps
|
|
12
|
-
>(function DetailsSummary({ className, children, ...props }, ref) {
|
|
17
|
+
>(function DetailsSummary({size, className, children, ...props }, ref) {
|
|
13
18
|
return (
|
|
14
19
|
<Base
|
|
15
20
|
as="summary"
|
|
16
21
|
ref={ref}
|
|
17
22
|
className={clsx(className, {
|
|
18
23
|
'govgr-details__summary': true,
|
|
24
|
+
'govgr-details__summary--l': size==='l',
|
|
19
25
|
})}
|
|
20
26
|
{...props}
|
|
21
27
|
>
|
|
@@ -15,7 +15,7 @@ export const FieldContainer = React.forwardRef<
|
|
|
15
15
|
HTMLDivElement,
|
|
16
16
|
FieldContainerProps
|
|
17
17
|
>(function FieldContainer(
|
|
18
|
-
{ error, className, children, xs = 12, md = 12, lg = 12, xl = 12 },
|
|
18
|
+
{ error, className, children, xs = 12, md = 12, lg = 12, xl = 12, ...props },
|
|
19
19
|
ref
|
|
20
20
|
) {
|
|
21
21
|
return (
|
|
@@ -30,6 +30,7 @@ export const FieldContainer = React.forwardRef<
|
|
|
30
30
|
md={md}
|
|
31
31
|
lg={lg}
|
|
32
32
|
xl={xl}
|
|
33
|
+
{...props}
|
|
33
34
|
>
|
|
34
35
|
{children}
|
|
35
36
|
</Grid>
|