@abgov/react-components 4.0.0-alpha.3 → 4.0.0-alpha.6

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.
@@ -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;
@@ -1,6 +1,7 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import './button.css';
3
- export declare type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'get-started';
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
  };
@@ -14,10 +14,11 @@ declare global {
14
14
  }
15
15
  }
16
16
  export interface Props {
17
- onDeleteIconClick?: () => void;
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, onDeleteIconClick }: Props) => JSX.Element;
23
+ export declare const GoAChip: ({ leadingIcon, deletable, error, content, onClick }: Props) => JSX.Element;
23
24
  export default GoAChip;
@@ -14,6 +14,8 @@ interface WCProps {
14
14
  error?: boolean;
15
15
  readonly?: boolean;
16
16
  focused?: boolean;
17
+ showcounter?: boolean;
18
+ maxcharcount?: number;
17
19
  handletrailingiconclick: boolean;
18
20
  width?: string;
19
21
  testid?: string;
@@ -40,6 +42,8 @@ export interface Props {
40
42
  readonly?: boolean;
41
43
  error?: boolean;
42
44
  width?: string;
45
+ showCounter?: boolean;
46
+ maxCharCount?: number;
43
47
  testId?: string;
44
48
  }
45
49
  export declare const GoAInput: FC<Props & {
@@ -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>;
@@ -5,8 +5,10 @@ interface WCProps {
5
5
  value: string;
6
6
  placeholder?: string;
7
7
  rows?: number;
8
- error: boolean;
9
- disabled: boolean;
8
+ error?: boolean;
9
+ disabled?: boolean;
10
+ showcounter?: boolean;
11
+ maxcharcount?: number;
10
12
  }
11
13
  declare global {
12
14
  namespace JSX {
@@ -21,9 +23,11 @@ interface Props {
21
23
  id?: string;
22
24
  placeholder?: string;
23
25
  rows?: number;
24
- error: boolean;
25
- disabled: boolean;
26
- testId: string;
26
+ error?: boolean;
27
+ disabled?: boolean;
28
+ showCounter?: boolean;
29
+ maxCharCount?: number;
30
+ testId?: string;
27
31
  onChange: (name: string, value: string) => void;
28
32
  }
29
33
  export declare const GoATextArea: FC<Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.3",
3
+ "version": "4.0.0-alpha.6",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -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: 320px) {\n goa-button-group > goa-button ~ goa-button {\n margin: 0;\n /* margin-left: 0.25rem; */\n }\n}\n";
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
- onDeleteIconClick
278
+ onClick
272
279
  }) => {
273
280
  const el = useRef(null);
274
281
  useEffect(() => {
275
282
  if (!el.current) return;
276
- if (!onDeleteIconClick) return;
283
+ if (!onClick) return;
277
284
  const current = el.current;
278
285
 
279
286
  const listener = e => {
280
- onDeleteIconClick();
287
+ onClick();
281
288
  };
282
289
 
283
- current.addEventListener('_onDeleteIconClick', listener);
290
+ current.addEventListener('_click', listener);
284
291
  return () => {
285
- current.removeEventListener('_onDeleteIconClick', listener);
292
+ current.removeEventListener('_click', listener);
286
293
  };
287
- }, [el, onDeleteIconClick]);
294
+ }, [el, onClick]);
288
295
  return jsx("goa-chip", {
289
296
  ref: el,
290
297
  leadingicon: _leadingIcon,
291
298
  error: _error,
292
- deletable: !!onDeleteIconClick,
299
+ deletable: _deletable,
293
300
  content: content
294
301
  }, void 0);
295
302
  };
@@ -527,6 +534,8 @@ const GoAInput = ({
527
534
  placeholder,
528
535
  error,
529
536
  width,
537
+ showCounter,
538
+ maxCharCount,
530
539
  testId,
531
540
  onTrailingIconClick,
532
541
  onChange
@@ -574,6 +583,8 @@ const GoAInput = ({
574
583
  "data-testid": testId,
575
584
  value: value,
576
585
  width: width,
586
+ showcounter: showCounter,
587
+ maxcharcount: maxCharCount,
577
588
  handletrailingiconclick: !!onTrailingIconClick
578
589
  }, void 0);
579
590
  };
@@ -670,6 +681,7 @@ const GoAModal = ({
670
681
  open,
671
682
  width,
672
683
  actions,
684
+ transition,
673
685
  onClose
674
686
  }) => {
675
687
  const el = useRef(null);
@@ -695,7 +707,8 @@ const GoAModal = ({
695
707
  open: open,
696
708
  closable: !!onClose,
697
709
  scrollable: true,
698
- width: width
710
+ width: width,
711
+ transition: transition
699
712
  }, {
700
713
  children: [actions && jsx("div", Object.assign({
701
714
  slot: "actions"
@@ -823,6 +836,8 @@ const GoATextArea = ({
823
836
  placeholder,
824
837
  rows,
825
838
  disabled,
839
+ showCounter,
840
+ maxCharCount,
826
841
  testId,
827
842
  error,
828
843
  onChange
@@ -855,6 +870,8 @@ const GoATextArea = ({
855
870
  value: value,
856
871
  rows: rows,
857
872
  disabled: disabled,
873
+ showcounter: showCounter,
874
+ maxcharcount: maxCharCount,
858
875
  error: error,
859
876
  "data-testid": testId
860
877
  }, void 0);
@@ -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: 320px) {\n goa-button-group > goa-button ~ goa-button {\n margin: 0;\n /* margin-left: 0.25rem; */\n }\n}\n";
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.error,
303
- error = _c === void 0 ? false : _c,
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
- onDeleteIconClick = _a.onDeleteIconClick;
313
+ onClick = _a.onClick;
306
314
  var el = react.useRef(null);
307
315
  react.useEffect(function () {
308
316
  if (!el.current) return;
309
- if (!onDeleteIconClick) return;
317
+ if (!onClick) return;
310
318
  var current = el.current;
311
319
 
312
320
  var listener = function listener(e) {
313
- onDeleteIconClick();
321
+ onClick();
314
322
  };
315
323
 
316
- current.addEventListener('_onDeleteIconClick', listener);
324
+ current.addEventListener('_click', listener);
317
325
  return function () {
318
- current.removeEventListener('_onDeleteIconClick', listener);
326
+ current.removeEventListener('_click', listener);
319
327
  };
320
- }, [el, onDeleteIconClick]);
328
+ }, [el, onClick]);
321
329
  return jsxRuntime.jsx("goa-chip", {
322
330
  ref: el,
323
331
  leadingicon: leadingIcon,
324
332
  error: error,
325
- deletable: !!onDeleteIconClick,
333
+ deletable: deletable,
326
334
  content: content
327
335
  }, void 0);
328
336
  };
@@ -530,6 +538,8 @@
530
538
  placeholder = _a.placeholder,
531
539
  error = _a.error,
532
540
  width = _a.width,
541
+ showCounter = _a.showCounter,
542
+ maxCharCount = _a.maxCharCount,
533
543
  testId = _a.testId,
534
544
  onTrailingIconClick = _a.onTrailingIconClick,
535
545
  onChange = _a.onChange;
@@ -575,6 +585,8 @@
575
585
  "data-testid": testId,
576
586
  value: value,
577
587
  width: width,
588
+ showcounter: showCounter,
589
+ maxcharcount: maxCharCount,
578
590
  handletrailingiconclick: !!onTrailingIconClick
579
591
  }, void 0);
580
592
  };
@@ -673,6 +685,7 @@
673
685
  open = _a.open,
674
686
  width = _a.width,
675
687
  actions = _a.actions,
688
+ transition = _a.transition,
676
689
  onClose = _a.onClose;
677
690
  var el = react.useRef(null);
678
691
  react.useEffect(function () {
@@ -697,7 +710,8 @@
697
710
  open: open,
698
711
  closable: !!onClose,
699
712
  scrollable: true,
700
- width: width
713
+ width: width,
714
+ transition: transition
701
715
  }, {
702
716
  children: [actions && jsxRuntime.jsx("div", __assign({
703
717
  slot: "actions"
@@ -824,6 +838,8 @@
824
838
  placeholder = _a.placeholder,
825
839
  rows = _a.rows,
826
840
  disabled = _a.disabled,
841
+ showCounter = _a.showCounter,
842
+ maxCharCount = _a.maxCharCount,
827
843
  testId = _a.testId,
828
844
  error = _a.error,
829
845
  onChange = _a.onChange;
@@ -854,6 +870,8 @@
854
870
  value: value,
855
871
  rows: rows,
856
872
  disabled: disabled,
873
+ showcounter: showCounter,
874
+ maxcharcount: maxCharCount,
857
875
  error: error,
858
876
  "data-testid": testId
859
877
  }, void 0);