@abgov/react-components 4.0.0-alpha.4 → 4.0.0-alpha.7
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/lib/app-footer/app-footer.d.ts +2 -0
- package/lib/button/button.d.ts +6 -1
- package/lib/chip/chip.d.ts +3 -2
- package/lib/modal/modal.d.ts +2 -0
- package/package.json +1 -1
- package/react-components.esm.js +20 -11
- package/react-components.umd.js +23 -13
|
@@ -5,6 +5,7 @@ interface WCProps {
|
|
|
5
5
|
title?: string;
|
|
6
6
|
copyrighturl?: string;
|
|
7
7
|
copyrighttext?: string;
|
|
8
|
+
multicolumnsectionnames?: string;
|
|
8
9
|
}
|
|
9
10
|
declare global {
|
|
10
11
|
namespace JSX {
|
|
@@ -19,6 +20,7 @@ export interface Props {
|
|
|
19
20
|
title?: string;
|
|
20
21
|
copyrightUrl?: string;
|
|
21
22
|
copyrightText?: string;
|
|
23
|
+
multiColumnSectionNames?: string;
|
|
22
24
|
}
|
|
23
25
|
export declare const GoAAppFooter: FC<Props>;
|
|
24
26
|
export default GoAAppFooter;
|
package/lib/button/button.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import './button.css';
|
|
3
|
-
|
|
3
|
+
import { GoAIconType } from '../icons';
|
|
4
|
+
export declare type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'start';
|
|
4
5
|
export declare type ButtonSize = 'compact' | 'normal';
|
|
5
6
|
export declare type ButtonVariant = 'default' | 'danger';
|
|
6
7
|
interface WCProps {
|
|
@@ -9,6 +10,8 @@ interface WCProps {
|
|
|
9
10
|
variant?: ButtonVariant;
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
title?: string;
|
|
13
|
+
leadingicon?: string;
|
|
14
|
+
trailingicon?: string;
|
|
12
15
|
ref: React.RefObject<HTMLElement>;
|
|
13
16
|
}
|
|
14
17
|
declare global {
|
|
@@ -24,6 +27,8 @@ declare type ButtonProps = {
|
|
|
24
27
|
size?: ButtonSize;
|
|
25
28
|
variant?: ButtonVariant;
|
|
26
29
|
disabled?: boolean;
|
|
30
|
+
leadingIcon?: GoAIconType;
|
|
31
|
+
trailingIcon?: GoAIconType;
|
|
27
32
|
onClick: (e: any) => void;
|
|
28
33
|
children: ReactNode;
|
|
29
34
|
};
|
package/lib/chip/chip.d.ts
CHANGED
|
@@ -14,10 +14,11 @@ declare global {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
export interface Props {
|
|
17
|
-
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
deletable?: boolean;
|
|
18
19
|
leadingIcon?: string;
|
|
19
20
|
error?: boolean;
|
|
20
21
|
content: string;
|
|
21
22
|
}
|
|
22
|
-
export declare const GoAChip: ({ leadingIcon, error, content,
|
|
23
|
+
export declare const GoAChip: ({ leadingIcon, deletable, error, content, onClick }: Props) => JSX.Element;
|
|
23
24
|
export default GoAChip;
|
package/lib/modal/modal.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ interface WCProps {
|
|
|
6
6
|
width?: string;
|
|
7
7
|
closable?: boolean;
|
|
8
8
|
scrollable?: boolean;
|
|
9
|
+
transition?: "fast" | "slow" | "none";
|
|
9
10
|
}
|
|
10
11
|
declare global {
|
|
11
12
|
namespace JSX {
|
|
@@ -19,6 +20,7 @@ interface Props {
|
|
|
19
20
|
width?: string;
|
|
20
21
|
actions?: React.ReactElement;
|
|
21
22
|
onClose?: () => void;
|
|
23
|
+
transition?: "fast" | "slow" | "none";
|
|
22
24
|
open?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const GoAModal: FC<Props>;
|
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -21,6 +21,7 @@ const GoAAppFooter = ({
|
|
|
21
21
|
title,
|
|
22
22
|
copyrightUrl,
|
|
23
23
|
copyrightText,
|
|
24
|
+
multiColumnSectionNames,
|
|
24
25
|
children
|
|
25
26
|
}) => {
|
|
26
27
|
return jsx("goa-app-footer", Object.assign({
|
|
@@ -28,7 +29,8 @@ const GoAAppFooter = ({
|
|
|
28
29
|
appurl: appUrl,
|
|
29
30
|
title: title,
|
|
30
31
|
copyrighturl: copyrightUrl,
|
|
31
|
-
copyrighttext: copyrightText
|
|
32
|
+
copyrighttext: copyrightText,
|
|
33
|
+
multicolumnsectionnames: multiColumnSectionNames
|
|
32
34
|
}, {
|
|
33
35
|
children: children
|
|
34
36
|
}), void 0);
|
|
@@ -160,6 +162,8 @@ const GoAButton = ({
|
|
|
160
162
|
type: _type = 'primary',
|
|
161
163
|
size: _size = 'normal',
|
|
162
164
|
variant: _variant = 'default',
|
|
165
|
+
leadingIcon,
|
|
166
|
+
trailingIcon,
|
|
163
167
|
children,
|
|
164
168
|
onClick
|
|
165
169
|
}) => {
|
|
@@ -187,13 +191,15 @@ const GoAButton = ({
|
|
|
187
191
|
size: _size,
|
|
188
192
|
variant: _variant,
|
|
189
193
|
disabled: _disabled,
|
|
190
|
-
title: title
|
|
194
|
+
title: title,
|
|
195
|
+
leadingicon: leadingIcon,
|
|
196
|
+
trailingicon: trailingIcon
|
|
191
197
|
}, {
|
|
192
198
|
children: children
|
|
193
199
|
}), void 0);
|
|
194
200
|
};
|
|
195
201
|
|
|
196
|
-
var css_248z = "goa-button-group > goa-button ~ goa-button {\n margin: 0;\n margin-top: 0.25rem;\n}\n\n@media (min-width:
|
|
202
|
+
var css_248z = "goa-button-group > goa-button ~ goa-button {\n margin: 0;\n margin-top: 0.25rem;\n}\n\n@media (min-width: 480px) {\n goa-button-group > goa-button ~ goa-button {\n margin: 0;\n }\n}\n";
|
|
197
203
|
styleInject(css_248z);
|
|
198
204
|
|
|
199
205
|
const GoAButtonGroup = ({
|
|
@@ -266,30 +272,31 @@ const GoACheckbox = ({
|
|
|
266
272
|
|
|
267
273
|
const GoAChip = ({
|
|
268
274
|
leadingIcon: _leadingIcon = "",
|
|
275
|
+
deletable: _deletable = false,
|
|
269
276
|
error: _error = false,
|
|
270
277
|
content,
|
|
271
|
-
|
|
278
|
+
onClick
|
|
272
279
|
}) => {
|
|
273
280
|
const el = useRef(null);
|
|
274
281
|
useEffect(() => {
|
|
275
282
|
if (!el.current) return;
|
|
276
|
-
if (!
|
|
283
|
+
if (!onClick) return;
|
|
277
284
|
const current = el.current;
|
|
278
285
|
|
|
279
286
|
const listener = e => {
|
|
280
|
-
|
|
287
|
+
onClick();
|
|
281
288
|
};
|
|
282
289
|
|
|
283
|
-
current.addEventListener('
|
|
290
|
+
current.addEventListener('_click', listener);
|
|
284
291
|
return () => {
|
|
285
|
-
current.removeEventListener('
|
|
292
|
+
current.removeEventListener('_click', listener);
|
|
286
293
|
};
|
|
287
|
-
}, [el,
|
|
294
|
+
}, [el, onClick]);
|
|
288
295
|
return jsx("goa-chip", {
|
|
289
296
|
ref: el,
|
|
290
297
|
leadingicon: _leadingIcon,
|
|
291
298
|
error: _error,
|
|
292
|
-
deletable:
|
|
299
|
+
deletable: _deletable,
|
|
293
300
|
content: content
|
|
294
301
|
}, void 0);
|
|
295
302
|
};
|
|
@@ -674,6 +681,7 @@ const GoAModal = ({
|
|
|
674
681
|
open,
|
|
675
682
|
width,
|
|
676
683
|
actions,
|
|
684
|
+
transition,
|
|
677
685
|
onClose
|
|
678
686
|
}) => {
|
|
679
687
|
const el = useRef(null);
|
|
@@ -699,7 +707,8 @@ const GoAModal = ({
|
|
|
699
707
|
open: open,
|
|
700
708
|
closable: !!onClose,
|
|
701
709
|
scrollable: true,
|
|
702
|
-
width: width
|
|
710
|
+
width: width,
|
|
711
|
+
transition: transition
|
|
703
712
|
}, {
|
|
704
713
|
children: [actions && jsx("div", Object.assign({
|
|
705
714
|
slot: "actions"
|
package/react-components.umd.js
CHANGED
|
@@ -60,13 +60,15 @@
|
|
|
60
60
|
title = _a.title,
|
|
61
61
|
copyrightUrl = _a.copyrightUrl,
|
|
62
62
|
copyrightText = _a.copyrightText,
|
|
63
|
+
multiColumnSectionNames = _a.multiColumnSectionNames,
|
|
63
64
|
children = _a.children;
|
|
64
65
|
return jsxRuntime.jsx("goa-app-footer", __assign({
|
|
65
66
|
id: id,
|
|
66
67
|
appurl: appUrl,
|
|
67
68
|
title: title,
|
|
68
69
|
copyrighturl: copyrightUrl,
|
|
69
|
-
copyrighttext: copyrightText
|
|
70
|
+
copyrighttext: copyrightText,
|
|
71
|
+
multicolumnsectionnames: multiColumnSectionNames
|
|
70
72
|
}, {
|
|
71
73
|
children: children
|
|
72
74
|
}), void 0);
|
|
@@ -195,6 +197,8 @@
|
|
|
195
197
|
size = _d === void 0 ? 'normal' : _d,
|
|
196
198
|
_e = _a.variant,
|
|
197
199
|
variant = _e === void 0 ? 'default' : _e,
|
|
200
|
+
leadingIcon = _a.leadingIcon,
|
|
201
|
+
trailingIcon = _a.trailingIcon,
|
|
198
202
|
children = _a.children,
|
|
199
203
|
onClick = _a.onClick;
|
|
200
204
|
var el = react.useRef(null);
|
|
@@ -221,13 +225,15 @@
|
|
|
221
225
|
size: size,
|
|
222
226
|
variant: variant,
|
|
223
227
|
disabled: disabled,
|
|
224
|
-
title: title
|
|
228
|
+
title: title,
|
|
229
|
+
leadingicon: leadingIcon,
|
|
230
|
+
trailingicon: trailingIcon
|
|
225
231
|
}, {
|
|
226
232
|
children: children
|
|
227
233
|
}), void 0);
|
|
228
234
|
};
|
|
229
235
|
|
|
230
|
-
var css_248z = "goa-button-group > goa-button ~ goa-button {\n margin: 0;\n margin-top: 0.25rem;\n}\n\n@media (min-width:
|
|
236
|
+
var css_248z = "goa-button-group > goa-button ~ goa-button {\n margin: 0;\n margin-top: 0.25rem;\n}\n\n@media (min-width: 480px) {\n goa-button-group > goa-button ~ goa-button {\n margin: 0;\n }\n}\n";
|
|
231
237
|
styleInject(css_248z);
|
|
232
238
|
|
|
233
239
|
var GoAButtonGroup = function GoAButtonGroup(_a) {
|
|
@@ -299,30 +305,32 @@
|
|
|
299
305
|
var GoAChip = function GoAChip(_a) {
|
|
300
306
|
var _b = _a.leadingIcon,
|
|
301
307
|
leadingIcon = _b === void 0 ? "" : _b,
|
|
302
|
-
_c = _a.
|
|
303
|
-
|
|
308
|
+
_c = _a.deletable,
|
|
309
|
+
deletable = _c === void 0 ? false : _c,
|
|
310
|
+
_d = _a.error,
|
|
311
|
+
error = _d === void 0 ? false : _d,
|
|
304
312
|
content = _a.content,
|
|
305
|
-
|
|
313
|
+
onClick = _a.onClick;
|
|
306
314
|
var el = react.useRef(null);
|
|
307
315
|
react.useEffect(function () {
|
|
308
316
|
if (!el.current) return;
|
|
309
|
-
if (!
|
|
317
|
+
if (!onClick) return;
|
|
310
318
|
var current = el.current;
|
|
311
319
|
|
|
312
320
|
var listener = function listener(e) {
|
|
313
|
-
|
|
321
|
+
onClick();
|
|
314
322
|
};
|
|
315
323
|
|
|
316
|
-
current.addEventListener('
|
|
324
|
+
current.addEventListener('_click', listener);
|
|
317
325
|
return function () {
|
|
318
|
-
current.removeEventListener('
|
|
326
|
+
current.removeEventListener('_click', listener);
|
|
319
327
|
};
|
|
320
|
-
}, [el,
|
|
328
|
+
}, [el, onClick]);
|
|
321
329
|
return jsxRuntime.jsx("goa-chip", {
|
|
322
330
|
ref: el,
|
|
323
331
|
leadingicon: leadingIcon,
|
|
324
332
|
error: error,
|
|
325
|
-
deletable:
|
|
333
|
+
deletable: deletable,
|
|
326
334
|
content: content
|
|
327
335
|
}, void 0);
|
|
328
336
|
};
|
|
@@ -677,6 +685,7 @@
|
|
|
677
685
|
open = _a.open,
|
|
678
686
|
width = _a.width,
|
|
679
687
|
actions = _a.actions,
|
|
688
|
+
transition = _a.transition,
|
|
680
689
|
onClose = _a.onClose;
|
|
681
690
|
var el = react.useRef(null);
|
|
682
691
|
react.useEffect(function () {
|
|
@@ -701,7 +710,8 @@
|
|
|
701
710
|
open: open,
|
|
702
711
|
closable: !!onClose,
|
|
703
712
|
scrollable: true,
|
|
704
|
-
width: width
|
|
713
|
+
width: width,
|
|
714
|
+
transition: transition
|
|
705
715
|
}, {
|
|
706
716
|
children: [actions && jsxRuntime.jsx("div", __assign({
|
|
707
717
|
slot: "actions"
|