@abgov/react-components 3.4.0-alpha.6 → 3.4.0-alpha.60

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.
@@ -58,36 +58,6 @@
58
58
  }), void 0);
59
59
  };
60
60
 
61
- function styleInject(css, ref) {
62
- if ( ref === void 0 ) ref = {};
63
- var insertAt = ref.insertAt;
64
-
65
- if (!css || typeof document === 'undefined') { return; }
66
-
67
- var head = document.head || document.getElementsByTagName('head')[0];
68
- var style = document.createElement('style');
69
- style.type = 'text/css';
70
-
71
- if (insertAt === 'top') {
72
- if (head.firstChild) {
73
- head.insertBefore(style, head.firstChild);
74
- } else {
75
- head.appendChild(style);
76
- }
77
- } else {
78
- head.appendChild(style);
79
- }
80
-
81
- if (style.styleSheet) {
82
- style.styleSheet.cssText = css;
83
- } else {
84
- style.appendChild(document.createTextNode(css));
85
- }
86
- }
87
-
88
- var css_248z$3 = "goa-badge {\n margin-left: 0.25rem;\n}";
89
- styleInject(css_248z$3);
90
-
91
61
  var GoABadge = function GoABadge(_a) {
92
62
  var type = _a.type,
93
63
  content = _a.content,
@@ -141,8 +111,35 @@
141
111
  }, void 0);
142
112
  };
143
113
 
144
- var css_248z$2 = "goa-button + goa-button {\n margin-top: 1.5rem;\n}\n\n/* TODO: these margins need to match UI specs */\n@media (min-width: 480px) {\n goa-button + goa-button {\n margin-left: 1rem;\n }\n}\n";
145
- styleInject(css_248z$2);
114
+ function styleInject(css, ref) {
115
+ if ( ref === void 0 ) ref = {};
116
+ var insertAt = ref.insertAt;
117
+
118
+ if (!css || typeof document === 'undefined') { return; }
119
+
120
+ var head = document.head || document.getElementsByTagName('head')[0];
121
+ var style = document.createElement('style');
122
+ style.type = 'text/css';
123
+
124
+ if (insertAt === 'top') {
125
+ if (head.firstChild) {
126
+ head.insertBefore(style, head.firstChild);
127
+ } else {
128
+ head.appendChild(style);
129
+ }
130
+ } else {
131
+ head.appendChild(style);
132
+ }
133
+
134
+ if (style.styleSheet) {
135
+ style.styleSheet.cssText = css;
136
+ } else {
137
+ style.appendChild(document.createTextNode(css));
138
+ }
139
+ }
140
+
141
+ var css_248z$1 = "goa-button + goa-button {\n margin-top: 1.5rem;\n}\n\n/* TODO: these margins need to match UI specs */\n@media (min-width: 480px) {\n goa-button + goa-button {\n margin-left: 1rem;\n }\n}\n";
142
+ styleInject(css_248z$1);
146
143
 
147
144
  var GoAButton = function GoAButton(_a) {
148
145
  var title = _a.title,
@@ -165,7 +162,7 @@
165
162
  var current = el.current;
166
163
 
167
164
  var listener = function listener(e) {
168
- onClick();
165
+ onClick(e);
169
166
  };
170
167
 
171
168
  current.addEventListener('_click', listener);
@@ -185,8 +182,8 @@
185
182
  }), void 0);
186
183
  };
187
184
 
188
- var css_248z$1 = "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";
189
- styleInject(css_248z$1);
185
+ 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";
186
+ styleInject(css_248z);
190
187
 
191
188
  var GoAButtonGroup = function GoAButtonGroup(_a) {
192
189
  var alignment = _a.alignment,
@@ -212,14 +209,13 @@
212
209
  };
213
210
 
214
211
  var GoACheckbox = function GoACheckbox(_a) {
215
- var name = _a.name,
212
+ var id = _a.id,
213
+ name = _a.name,
216
214
  testId = _a.testId,
217
215
  error = _a.error,
218
216
  disabled = _a.disabled,
219
217
  checked = _a.checked,
220
- indeterminate = _a.indeterminate,
221
- _b = _a.value,
222
- value = _b === void 0 ? true : _b,
218
+ value = _a.value,
223
219
  text = _a.text,
224
220
  children = _a.children,
225
221
  onChange = _a.onChange;
@@ -243,11 +239,11 @@
243
239
  return jsxRuntime.jsx("goa-checkbox", __assign({
244
240
  "data-testid": testId,
245
241
  ref: el,
242
+ id: id,
246
243
  name: name,
247
244
  error: error,
248
245
  checked: checked,
249
246
  disabled: disabled,
250
- indeterminate: indeterminate,
251
247
  text: text,
252
248
  value: value
253
249
  }, {
@@ -255,13 +251,30 @@
255
251
  }), void 0);
256
252
  };
257
253
 
254
+ var GoACircularProgress = function GoACircularProgress(_a) {
255
+ var type = _a.type,
256
+ visible = _a.visible,
257
+ message = _a.message,
258
+ progress = _a.progress,
259
+ variant = _a.variant,
260
+ size = _a.size;
261
+ return jsxRuntime.jsx("goa-circular-progress", {
262
+ type: type,
263
+ visible: visible ? "true" : "false",
264
+ message: message,
265
+ progress: progress,
266
+ variant: variant,
267
+ size: size
268
+ }, void 0);
269
+ };
270
+
258
271
  var GoAContainer = function GoAContainer(_a) {
259
272
  var headingSize = _a.headingSize,
260
273
  title = _a.title,
261
274
  children = _a.children,
262
275
  actions = _a.actions,
263
276
  _b = _a.variant,
264
- variant = _b === void 0 ? 'primary' : _b;
277
+ variant = _b === void 0 ? 'default' : _b;
265
278
  return jsxRuntime.jsxs("goa-container", __assign({
266
279
  variant: variant,
267
280
  headingsize: headingSize
@@ -299,7 +312,7 @@
299
312
  var current = el.current;
300
313
 
301
314
  var handler = function handler(state) {
302
- var _a = state.detail.data,
315
+ var _a = state.detail,
303
316
  name = _a.name,
304
317
  value = _a.value;
305
318
  props.onChange(name, value);
@@ -313,22 +326,20 @@
313
326
  return jsxRuntime.jsx("goa-dropdown", __assign({
314
327
  ref: el,
315
328
  name: props.name,
316
- values: JSON.stringify(props.selectedValues),
329
+ values: JSON.stringify(props.values),
317
330
  leadingicon: props.leadingIcon,
318
331
  maxheight: props.maxHeight,
319
332
  placeholder: props.placeholder,
320
- autocomplete: props.autoComplete,
333
+ filterable: props.filterable,
321
334
  disabled: props.disabled,
322
- multiselect: props.multiSelect,
335
+ multiselect: props.multiselect,
336
+ error: props.error,
323
337
  "data-testid": props.testId
324
338
  }, {
325
339
  children: props.children
326
340
  }), void 0);
327
341
  };
328
342
 
329
- var css_248z = "";
330
- styleInject(css_248z);
331
-
332
343
  var GoAFlexRow = function GoAFlexRow(_a) {
333
344
  var gap = _a.gap,
334
345
  minWidth = _a.minWidth,
@@ -359,21 +370,13 @@
359
370
  }), void 0);
360
371
  };
361
372
 
362
- var row = /*#__PURE__*/Object.freeze({
363
- __proto__: null,
364
- GoAFlexRow: GoAFlexRow,
365
- 'default': GoAFlexRow
366
- });
367
-
368
373
  var GoAFormItem = function GoAFormItem(_a) {
369
374
  var children = _a.children,
370
375
  helpText = _a.helpText,
371
376
  error = _a.error,
372
377
  optional = _a.optional,
373
- name = _a.name,
374
378
  label = _a.label;
375
379
  return jsxRuntime.jsx("goa-form-item", __assign({
376
- name: name,
377
380
  label: label,
378
381
  error: error,
379
382
  optional: optional,
@@ -383,12 +386,6 @@
383
386
  }), void 0);
384
387
  };
385
388
 
386
- var formItem = /*#__PURE__*/Object.freeze({
387
- __proto__: null,
388
- GoAFormItem: GoAFormItem,
389
- 'default': GoAFormItem
390
- });
391
-
392
389
  var GoAHeroBanner = function GoAHeroBanner(_a) {
393
390
  var title = _a.title,
394
391
  backgroundUrl = _a.backgroundUrl,
@@ -401,15 +398,6 @@
401
398
  }), void 0);
402
399
  };
403
400
 
404
- var GoAHeroBannerContent = function GoAHeroBannerContent(_a) {
405
- var children = _a.children;
406
- return jsxRuntime.jsx("div", __assign({
407
- slot: "content"
408
- }, {
409
- children: children
410
- }), void 0);
411
- };
412
-
413
401
  var GoAHeroBannerActions = function GoAHeroBannerActions(_a) {
414
402
  var children = _a.children;
415
403
  return jsxRuntime.jsx("div", __assign({
@@ -478,13 +466,14 @@
478
466
  leadingIcon = _a.leadingIcon,
479
467
  trailingIcon = _a.trailingIcon,
480
468
  _b = _a.variant,
481
- variant = _b === void 0 ? 'goa' : _b;
482
- _a.focused;
483
- var disabled = _a.disabled,
469
+ variant = _b === void 0 ? 'goa' : _b,
470
+ focused = _a.focused,
471
+ disabled = _a.disabled,
484
472
  readonly = _a.readonly,
485
473
  value = _a.value,
486
474
  placeholder = _a.placeholder,
487
475
  error = _a.error,
476
+ testId = _a.testId,
488
477
  onTrailingIconClick = _a.onTrailingIconClick,
489
478
  onChange = _a.onChange;
490
479
  var ref = React.useRef(null);
@@ -496,34 +485,26 @@
496
485
  var current = ref.current;
497
486
 
498
487
  var changeListener = function changeListener(e) {
499
- var _a = e.detail.data,
488
+ var _a = e.detail,
500
489
  name = _a.name,
501
490
  value = _a.value;
502
491
  onChange(name, value);
503
- }; // TODO: determinw the propery type of the e (CustomEvent does not work)
504
-
492
+ };
505
493
 
506
494
  var clickListener = function clickListener(e) {
507
495
  onTrailingIconClick === null || onTrailingIconClick === void 0 ? void 0 : onTrailingIconClick();
508
496
  };
509
497
 
510
- current.addEventListener('_change', changeListener); // TODO: remove all the `on:` prefixes
511
-
512
- current.addEventListener('_ontrailingiconclick', clickListener);
498
+ current.addEventListener('_change', changeListener);
499
+ current.addEventListener('_trailingIconClick', clickListener);
513
500
  return function () {
514
501
  current.removeEventListener('_change', changeListener);
515
- current.removeEventListener('_ontrailingiconclick', clickListener);
502
+ current.removeEventListener('_trailingIconClick', clickListener);
516
503
  };
517
- }, [ref, onChange, onTrailingIconClick]); // useEffect(() => {
518
- // if (focused) {
519
- // inputRef.current?.focus();
520
- // } else {
521
- // inputRef.current?.blur();
522
- // }
523
- // }, [focused, inputRef]);
524
-
504
+ }, [ref, onChange, onTrailingIconClick]);
525
505
  return jsxRuntime.jsx("goa-input", {
526
506
  ref: ref,
507
+ focused: focused,
527
508
  type: type,
528
509
  name: name,
529
510
  id: id,
@@ -534,6 +515,7 @@
534
515
  readonly: readonly,
535
516
  placeholder: placeholder,
536
517
  error: error,
518
+ "data-testid": testId,
537
519
  value: value,
538
520
  handletrailingiconclick: !!onTrailingIconClick
539
521
  }, void 0);
@@ -611,19 +593,28 @@
611
593
  _a.step;
612
594
  var props = __rest(_a, ["step"]);
613
595
 
614
- return jsxRuntime.jsx("input", __assign({}, props, {
615
- type: "range",
616
- onChange: function (e) {
617
- return props.onChange(e.target.name, e.target.value);
618
- }
596
+ return jsxRuntime.jsx(GoAInput, __assign({}, props, {
597
+ type: "range"
619
598
  }), void 0);
620
599
  };
621
600
 
601
+ var GoAMicrositeHeader = function GoAMicrositeHeader(_a) {
602
+ var level = _a.level,
603
+ version = _a.version,
604
+ feedbackUrl = _a.feedbackUrl;
605
+ return jsxRuntime.jsx("goa-microsite-header", {
606
+ level: level,
607
+ version: version,
608
+ feedbackurl: feedbackUrl
609
+ }, void 0);
610
+ };
611
+
622
612
  var GoAModal = function GoAModal(_a) {
623
- var title = _a.title,
613
+ var heading = _a.heading,
624
614
  children = _a.children,
625
615
  open = _a.open,
626
- closable = _a.closable,
616
+ width = _a.width,
617
+ actions = _a.actions,
627
618
  onClose = _a.onClose;
628
619
  var el = React.useRef(null);
629
620
  React.useEffect(function () {
@@ -642,14 +633,19 @@
642
633
  current.removeEventListener('_close', listener);
643
634
  };
644
635
  }, [el, onClose]);
645
- return jsxRuntime.jsx("goa-modal", __assign({
636
+ return jsxRuntime.jsxs("goa-modal", __assign({
646
637
  ref: el,
647
- title: title,
638
+ heading: heading,
648
639
  open: open,
649
- closable: closable,
650
- scrollable: true
640
+ closable: !!onClose,
641
+ scrollable: true,
642
+ width: width
651
643
  }, {
652
- children: children
644
+ children: [actions && jsxRuntime.jsx("div", __assign({
645
+ slot: "actions"
646
+ }, {
647
+ children: actions
648
+ }), void 0), children]
653
649
  }), void 0);
654
650
  };
655
651
 
@@ -664,22 +660,14 @@
664
660
  }), void 0);
665
661
  };
666
662
 
667
- var GoAPageLoader = function GoAPageLoader(_a) {
668
- var type = _a.type,
669
- visible = _a.visible,
670
- message = _a.message,
671
- progress = _a.progress,
672
- variant = _a.variant;
673
- return jsxRuntime.jsx("goa-page-loader", {
674
- type: type,
675
- visible: visible,
676
- message: message,
677
- progress: progress,
678
- variant: variant
663
+ var GoAPageBlock = function GoAPageBlock(_a) {
664
+ var children = _a.children;
665
+ return jsxRuntime.jsx("goa-page-block", {
666
+ children: children
679
667
  }, void 0);
680
668
  };
681
669
 
682
- var GoARadio = function GoARadio(_a) {
670
+ var GoARadioItem = function GoARadioItem(_a) {
683
671
  var name = _a.name,
684
672
  label = _a.label,
685
673
  value = _a.value,
@@ -707,6 +695,10 @@
707
695
  children = _a.children,
708
696
  _b = _a.orientation,
709
697
  orientation = _b === void 0 ? 'vertical' : _b,
698
+ _c = _a.disabled,
699
+ disabled = _c === void 0 ? false : _c,
700
+ _d = _a.error,
701
+ error = _d === void 0 ? false : _d,
710
702
  testId = _a.testId,
711
703
  onChange = _a.onChange;
712
704
  var el = React.useRef(null);
@@ -716,6 +708,11 @@
716
708
  }
717
709
 
718
710
  var listener = function listener(e) {
711
+ if (!onChange) {
712
+ console.warn("Missing onChange function");
713
+ return;
714
+ }
715
+
719
716
  onChange(name, e.detail.value);
720
717
  };
721
718
 
@@ -730,16 +727,36 @@
730
727
  ref: el,
731
728
  name: name,
732
729
  value: value,
733
- orientation: orientation
730
+ orientation: orientation,
731
+ disabled: disabled,
732
+ error: error
734
733
  }, {
735
734
  children: children
736
735
  }), void 0);
737
736
  };
738
737
 
739
- var GoAServiceLevelHeader = function GoAServiceLevelHeader(_a) {
740
- var level = _a.level;
741
- return jsxRuntime.jsx("goa-service-level-header", {
742
- level: level
738
+ var GoASkeleton = function GoASkeleton(_a) {
739
+ var type = _a.type,
740
+ _b = _a.size,
741
+ size = _b === void 0 ? 1 : _b;
742
+ return jsxRuntime.jsx("goa-skeleton", {
743
+ type: type,
744
+ size: size
745
+ }, void 0);
746
+ };
747
+
748
+ var GoASpinner = function GoASpinner(_a) {
749
+ var type = _a.type,
750
+ size = _a.size,
751
+ progress = _a.progress,
752
+ invert = _a.invert,
753
+ testId = _a.testId;
754
+ return jsxRuntime.jsx("goa-spinner", {
755
+ type: type,
756
+ size: size,
757
+ progress: progress,
758
+ invert: invert,
759
+ testid: testId
743
760
  }, void 0);
744
761
  };
745
762
 
@@ -749,6 +766,8 @@
749
766
  placeholder = _a.placeholder,
750
767
  rows = _a.rows,
751
768
  disabled = _a.disabled,
769
+ testId = _a.testId,
770
+ error = _a.error,
752
771
  onChange = _a.onChange;
753
772
  var el = React.useRef(null);
754
773
  React.useEffect(function () {
@@ -759,7 +778,7 @@
759
778
  var current = el.current;
760
779
 
761
780
  var listener = function listener(e) {
762
- var _a = e.detail.data,
781
+ var _a = e.detail,
763
782
  name = _a.name,
764
783
  value = _a.value;
765
784
  onChange(name, value);
@@ -776,7 +795,9 @@
776
795
  placeholder: placeholder,
777
796
  value: value,
778
797
  rows: rows,
779
- disabled: disabled
798
+ disabled: disabled,
799
+ error: error,
800
+ "data-testid": testId
780
801
  }, void 0);
781
802
  };
782
803
 
@@ -786,15 +807,15 @@
786
807
  exports.GoAButtonGroup = GoAButtonGroup;
787
808
  exports.GoACallout = GoACallout;
788
809
  exports.GoACheckbox = GoACheckbox;
810
+ exports.GoACircularProgress = GoACircularProgress;
789
811
  exports.GoAContainer = GoAContainer;
790
812
  exports.GoADropdown = GoADropdown;
791
813
  exports.GoADropdownOption = GoADropdownOption;
792
814
  exports.GoAEmergencyBadge = GoAEmergencyBadge;
793
- exports.GoAFlexRow = row;
794
- exports.GoAFormItem = formItem;
815
+ exports.GoAFlexRow = GoAFlexRow;
816
+ exports.GoAFormItem = GoAFormItem;
795
817
  exports.GoAHeroBanner = GoAHeroBanner;
796
818
  exports.GoAHeroBannerActions = GoAHeroBannerActions;
797
- exports.GoAHeroBannerContent = GoAHeroBannerContent;
798
819
  exports.GoAIcon = GoAIcon;
799
820
  exports.GoAIconButton = GoAIconButton;
800
821
  exports.GoAInfoBadge = GoAInfoBadge;
@@ -812,12 +833,14 @@
812
833
  exports.GoAInputText = GoAInputText;
813
834
  exports.GoAInputTime = GoAInputTime;
814
835
  exports.GoAInputUrl = GoAInputUrl;
836
+ exports.GoAMicrositeHeader = GoAMicrositeHeader;
815
837
  exports.GoAModal = GoAModal;
816
838
  exports.GoANotification = GoANotification;
817
- exports.GoAPageLoader = GoAPageLoader;
818
- exports.GoARadio = GoARadio;
839
+ exports.GoAPageBlock = GoAPageBlock;
819
840
  exports.GoARadioGroup = GoARadioGroup;
820
- exports.GoAServiceLevelHeader = GoAServiceLevelHeader;
841
+ exports.GoARadioItem = GoARadioItem;
842
+ exports.GoASkeleton = GoASkeleton;
843
+ exports.GoASpinner = GoASpinner;
821
844
  exports.GoASuccessBadge = GoASuccessBadge;
822
845
  exports.GoATextArea = GoATextArea;
823
846
  exports.GoAWarningBadge = GoAWarningBadge;
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- export declare type GoAHeroBannerContentType = FC;
3
- export declare const GoAHeroBannerContent: GoAHeroBannerContentType;
4
- export default GoAHeroBannerContent;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- declare type PageLoaderType = 'infinite' | 'progress';
3
- declare type PageLoaderVariant = "fullscreen" | "inline";
4
- interface WCProps {
5
- type?: PageLoaderType;
6
- variant?: PageLoaderVariant;
7
- message?: string;
8
- visible?: boolean;
9
- progress?: number;
10
- }
11
- declare global {
12
- namespace JSX {
13
- interface IntrinsicElements {
14
- 'goa-page-loader': WCProps & React.HTMLAttributes<HTMLElement>;
15
- }
16
- }
17
- }
18
- export interface PageLoaderProps {
19
- type?: PageLoaderType;
20
- variant?: PageLoaderVariant;
21
- message?: string;
22
- visible?: boolean;
23
- progress?: number;
24
- }
25
- export declare const GoAPageLoader: ({ type, visible, message, progress, variant }: PageLoaderProps) => JSX.Element;
26
- export default GoAPageLoader;