@abgov/react-components 4.0.0-alpha.16 → 4.0.0-alpha.17

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.
@@ -2,6 +2,235 @@ import '@abgov/web-components';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useRef, useEffect } from 'react';
4
4
 
5
+ const GoABadge = ({
6
+ type,
7
+ content,
8
+ icon,
9
+ testId
10
+ }) => {
11
+ return jsx("goa-badge", {
12
+ type: type,
13
+ content: content,
14
+ icon: icon,
15
+ testid: testId
16
+ }, void 0);
17
+ };
18
+ const GoAInfoBadge = ({
19
+ content,
20
+ testId
21
+ }) => {
22
+ return jsx(GoABadge, {
23
+ type: "information",
24
+ icon: "information-circle",
25
+ content: content,
26
+ testId: testId
27
+ }, void 0);
28
+ };
29
+ const GoASuccessBadge = ({
30
+ content,
31
+ testId
32
+ }) => {
33
+ return jsx(GoABadge, {
34
+ type: "success",
35
+ icon: "checkmark-circle",
36
+ content: content,
37
+ testId: testId
38
+ }, void 0);
39
+ };
40
+ const GoAWarningBadge = ({
41
+ content,
42
+ testId
43
+ }) => {
44
+ return jsx(GoABadge, {
45
+ type: "warning",
46
+ icon: "warning",
47
+ content: content,
48
+ testId: testId
49
+ }, void 0);
50
+ };
51
+ const GoAEmergencyBadge = ({
52
+ content,
53
+ testId
54
+ }) => {
55
+ return jsx(GoABadge, {
56
+ type: "emergency",
57
+ icon: "alert-circle",
58
+ content: content,
59
+ testId: testId
60
+ }, void 0);
61
+ };
62
+
63
+ /*! *****************************************************************************
64
+ Copyright (c) Microsoft Corporation.
65
+
66
+ Permission to use, copy, modify, and/or distribute this software for any
67
+ purpose with or without fee is hereby granted.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
70
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
71
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
72
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
73
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
74
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
75
+ PERFORMANCE OF THIS SOFTWARE.
76
+ ***************************************************************************** */
77
+
78
+ function __rest(s, e) {
79
+ var t = {};
80
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
81
+ t[p] = s[p];
82
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
83
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
84
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
85
+ t[p[i]] = s[p[i]];
86
+ }
87
+ return t;
88
+ }
89
+
90
+ const GoAInput = ({
91
+ id,
92
+ name,
93
+ type,
94
+ leadingIcon,
95
+ trailingIcon,
96
+ variant: _variant = 'goa',
97
+ focused,
98
+ disabled,
99
+ readonly,
100
+ value,
101
+ placeholder,
102
+ error,
103
+ width,
104
+ showCounter,
105
+ maxCharCount,
106
+ testId,
107
+ onTrailingIconClick,
108
+ onChange
109
+ }) => {
110
+ const ref = useRef(null);
111
+ useEffect(() => {
112
+ if (!ref.current) {
113
+ return;
114
+ }
115
+
116
+ const current = ref.current;
117
+
118
+ const changeListener = e => {
119
+ const {
120
+ name,
121
+ value
122
+ } = e.detail;
123
+ onChange(name, value);
124
+ };
125
+
126
+ const clickListener = e => {
127
+ onTrailingIconClick === null || onTrailingIconClick === void 0 ? void 0 : onTrailingIconClick();
128
+ };
129
+
130
+ current.addEventListener('_change', changeListener);
131
+ current.addEventListener('_trailingIconClick', clickListener);
132
+ return () => {
133
+ current.removeEventListener('_change', changeListener);
134
+ current.removeEventListener('_trailingIconClick', clickListener);
135
+ };
136
+ }, [ref, onChange, onTrailingIconClick]);
137
+ return jsx("goa-input", {
138
+ ref: ref,
139
+ focused: focused,
140
+ type: type,
141
+ name: name,
142
+ id: id,
143
+ leadingicon: leadingIcon,
144
+ trailingicon: trailingIcon,
145
+ variant: _variant,
146
+ disabled: disabled,
147
+ readonly: readonly,
148
+ placeholder: placeholder,
149
+ error: error,
150
+ "data-testid": testId,
151
+ value: value,
152
+ width: width,
153
+ showcounter: showCounter,
154
+ maxcharcount: maxCharCount,
155
+ handletrailingiconclick: !!onTrailingIconClick
156
+ }, void 0);
157
+ };
158
+ const GoAInputText = props => {
159
+ return jsx(GoAInput, Object.assign({}, props, {
160
+ type: "text"
161
+ }), void 0);
162
+ };
163
+ const GoAInputPassword = props => {
164
+ return jsx(GoAInput, Object.assign({}, props, {
165
+ type: "password"
166
+ }), void 0);
167
+ };
168
+ const GoAInputDate = props => {
169
+ return jsx(GoAInput, Object.assign({}, props, {
170
+ type: "date"
171
+ }), void 0);
172
+ };
173
+ const GoAInputTime = props => {
174
+ return jsx(GoAInput, Object.assign({}, props, {
175
+ type: "time"
176
+ }), void 0);
177
+ };
178
+ const GoAInputDateTime = props => {
179
+ return jsx(GoAInput, Object.assign({}, props, {
180
+ type: "datetime-local"
181
+ }), void 0);
182
+ };
183
+ const GoAInputEmail = props => {
184
+ return jsx(GoAInput, Object.assign({}, props, {
185
+ type: "email"
186
+ }), void 0);
187
+ };
188
+ const GoAInputSearch = props => {
189
+ return jsx(GoAInput, Object.assign({}, props, {
190
+ type: "search",
191
+ trailingIcon: "search"
192
+ }), void 0);
193
+ };
194
+ const GoAInputUrl = props => {
195
+ return jsx(GoAInput, Object.assign({}, props, {
196
+ type: "url"
197
+ }), void 0);
198
+ };
199
+ const GoAInputTel = props => {
200
+ return jsx(GoAInput, Object.assign({}, props, {
201
+ type: "tel"
202
+ }), void 0);
203
+ };
204
+ const GoAInputFile = props => {
205
+ return jsx("input", {
206
+ id: props.id,
207
+ name: props.name,
208
+ type: "file",
209
+ onChange: e => props.onChange(e.target.name, e.target.value),
210
+ style: {
211
+ backgroundColor: 'revert'
212
+ }
213
+ }, void 0);
214
+ };
215
+ const GoAInputMonth = props => {
216
+ return jsx(GoAInput, Object.assign({}, props, {
217
+ type: "month"
218
+ }), void 0);
219
+ };
220
+ const GoAInputNumber = props => {
221
+ return jsx(GoAInput, Object.assign({}, props, {
222
+ value: props.value.toString(),
223
+ type: "number"
224
+ }), void 0);
225
+ };
226
+ const GoAInputRange = _a => {
227
+ var props = __rest(_a, ["step"]);
228
+
229
+ return jsx(GoAInput, Object.assign({}, props, {
230
+ type: "range"
231
+ }), void 0);
232
+ };
233
+
5
234
  const GoAAppHeader = ({
6
235
  title,
7
236
  url,
@@ -68,64 +297,6 @@ const GoANavigationLink = ({
68
297
  }), void 0);
69
298
  };
70
299
 
71
- const GoABadge = ({
72
- type,
73
- content,
74
- icon,
75
- testId
76
- }) => {
77
- return jsx("goa-badge", {
78
- type: type,
79
- content: content,
80
- icon: icon,
81
- testid: testId
82
- }, void 0);
83
- };
84
- const GoAInfoBadge = ({
85
- content,
86
- testId
87
- }) => {
88
- return jsx(GoABadge, {
89
- type: "information",
90
- icon: "information-circle",
91
- content: content,
92
- testId: testId
93
- }, void 0);
94
- };
95
- const GoASuccessBadge = ({
96
- content,
97
- testId
98
- }) => {
99
- return jsx(GoABadge, {
100
- type: "success",
101
- icon: "checkmark-circle",
102
- content: content,
103
- testId: testId
104
- }, void 0);
105
- };
106
- const GoAWarningBadge = ({
107
- content,
108
- testId
109
- }) => {
110
- return jsx(GoABadge, {
111
- type: "warning",
112
- icon: "warning",
113
- content: content,
114
- testId: testId
115
- }, void 0);
116
- };
117
- const GoAEmergencyBadge = ({
118
- content,
119
- testId
120
- }) => {
121
- return jsx(GoABadge, {
122
- type: "emergency",
123
- icon: "alert-circle",
124
- content: content,
125
- testId: testId
126
- }, void 0);
127
- };
128
-
129
300
  function styleInject(css, ref) {
130
301
  if ( ref === void 0 ) ref = {};
131
302
  var insertAt = ref.insertAt;
@@ -322,13 +493,15 @@ const GoACircularProgress = ({
322
493
  const GoAContainer = ({
323
494
  headingSize,
324
495
  title,
496
+ colored: _colored = false,
325
497
  children,
326
498
  actions,
327
499
  variant: _variant = 'default'
328
500
  }) => {
329
501
  return jsxs("goa-container", Object.assign({
330
502
  variant: _variant,
331
- headingsize: headingSize
503
+ headingsize: headingSize,
504
+ colored: _colored
332
505
  }, {
333
506
  children: [title && jsx("div", Object.assign({
334
507
  slot: "title"
@@ -495,176 +668,6 @@ const GoAIconButton = ({
495
668
  }), void 0);
496
669
  };
497
670
 
498
- /*! *****************************************************************************
499
- Copyright (c) Microsoft Corporation.
500
-
501
- Permission to use, copy, modify, and/or distribute this software for any
502
- purpose with or without fee is hereby granted.
503
-
504
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
505
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
506
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
507
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
508
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
509
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
510
- PERFORMANCE OF THIS SOFTWARE.
511
- ***************************************************************************** */
512
-
513
- function __rest(s, e) {
514
- var t = {};
515
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
516
- t[p] = s[p];
517
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
518
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
519
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
520
- t[p[i]] = s[p[i]];
521
- }
522
- return t;
523
- }
524
-
525
- const GoAInput = ({
526
- id,
527
- name,
528
- type,
529
- leadingIcon,
530
- trailingIcon,
531
- variant: _variant = 'goa',
532
- focused,
533
- disabled,
534
- readonly,
535
- value,
536
- placeholder,
537
- error,
538
- width,
539
- showCounter,
540
- maxCharCount,
541
- testId,
542
- onTrailingIconClick,
543
- onChange
544
- }) => {
545
- const ref = useRef(null);
546
- useEffect(() => {
547
- if (!ref.current) {
548
- return;
549
- }
550
-
551
- const current = ref.current;
552
-
553
- const changeListener = e => {
554
- const {
555
- name,
556
- value
557
- } = e.detail;
558
- onChange(name, value);
559
- };
560
-
561
- const clickListener = e => {
562
- onTrailingIconClick === null || onTrailingIconClick === void 0 ? void 0 : onTrailingIconClick();
563
- };
564
-
565
- current.addEventListener('_change', changeListener);
566
- current.addEventListener('_trailingIconClick', clickListener);
567
- return () => {
568
- current.removeEventListener('_change', changeListener);
569
- current.removeEventListener('_trailingIconClick', clickListener);
570
- };
571
- }, [ref, onChange, onTrailingIconClick]);
572
- return jsx("goa-input", {
573
- ref: ref,
574
- focused: focused,
575
- type: type,
576
- name: name,
577
- id: id,
578
- leadingicon: leadingIcon,
579
- trailingicon: trailingIcon,
580
- variant: _variant,
581
- disabled: disabled,
582
- readonly: readonly,
583
- placeholder: placeholder,
584
- error: error,
585
- "data-testid": testId,
586
- value: value,
587
- width: width,
588
- showcounter: showCounter,
589
- maxcharcount: maxCharCount,
590
- handletrailingiconclick: !!onTrailingIconClick
591
- }, void 0);
592
- };
593
- const GoAInputText = props => {
594
- return jsx(GoAInput, Object.assign({}, props, {
595
- type: "text"
596
- }), void 0);
597
- };
598
- const GoAInputPassword = props => {
599
- return jsx(GoAInput, Object.assign({}, props, {
600
- type: "password"
601
- }), void 0);
602
- };
603
- const GoAInputDate = props => {
604
- return jsx(GoAInput, Object.assign({}, props, {
605
- type: "date"
606
- }), void 0);
607
- };
608
- const GoAInputTime = props => {
609
- return jsx(GoAInput, Object.assign({}, props, {
610
- type: "time"
611
- }), void 0);
612
- };
613
- const GoAInputDateTime = props => {
614
- return jsx(GoAInput, Object.assign({}, props, {
615
- type: "datetime-local"
616
- }), void 0);
617
- };
618
- const GoAInputEmail = props => {
619
- return jsx(GoAInput, Object.assign({}, props, {
620
- type: "email"
621
- }), void 0);
622
- };
623
- const GoAInputSearch = props => {
624
- return jsx(GoAInput, Object.assign({}, props, {
625
- type: "search",
626
- trailingIcon: "search"
627
- }), void 0);
628
- };
629
- const GoAInputUrl = props => {
630
- return jsx(GoAInput, Object.assign({}, props, {
631
- type: "url"
632
- }), void 0);
633
- };
634
- const GoAInputTel = props => {
635
- return jsx(GoAInput, Object.assign({}, props, {
636
- type: "tel"
637
- }), void 0);
638
- };
639
- const GoAInputFile = props => {
640
- return jsx("input", {
641
- id: props.id,
642
- name: props.name,
643
- type: "file",
644
- onChange: e => props.onChange(e.target.name, e.target.value),
645
- style: {
646
- backgroundColor: 'revert'
647
- }
648
- }, void 0);
649
- };
650
- const GoAInputMonth = props => {
651
- return jsx(GoAInput, Object.assign({}, props, {
652
- type: "month"
653
- }), void 0);
654
- };
655
- const GoAInputNumber = props => {
656
- return jsx(GoAInput, Object.assign({}, props, {
657
- type: "number"
658
- }), void 0);
659
- };
660
- const GoAInputRange = _a => {
661
- var props = __rest(_a, ["step"]);
662
-
663
- return jsx(GoAInput, Object.assign({}, props, {
664
- type: "range"
665
- }), void 0);
666
- };
667
-
668
671
  const GoAMicrositeHeader = ({
669
672
  level,
670
673
  version,
@@ -731,12 +734,12 @@ const GoANotification = ({
731
734
  }), void 0);
732
735
  };
733
736
 
734
- const GoAPageBlock = ({
735
- children
736
- }) => {
737
- return jsx("goa-page-block", {
738
- children: children
739
- }, void 0);
737
+ const GoAPageBlock = props => {
738
+ return jsx("goa-page-block", Object.assign({
739
+ width: props.width
740
+ }, {
741
+ children: props.children
742
+ }), void 0);
740
743
  };
741
744
 
742
745
  const GoARadioItem = ({
@@ -881,4 +884,27 @@ const GoATextArea = ({
881
884
  }, void 0);
882
885
  };
883
886
 
884
- export { GoAAppFooter, GoAAppHeader, GoABadge, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADropdown, GoADropdownOption, GoAEmergencyBadge, GoAFlexRow, GoAFormItem, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMetaLink, GoAMicrositeHeader, GoAModal, GoANavigationLink, GoANotification, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoAWarningBadge };
887
+ const GoAFlexCol = ({
888
+ gap,
889
+ children
890
+ }) => {
891
+ return jsx("goa-flex-col", Object.assign({
892
+ gap: gap
893
+ }, {
894
+ children: children
895
+ }), void 0);
896
+ };
897
+
898
+ function GoAPage(props) {
899
+ return jsx("goa-page", {
900
+ children: props.children
901
+ }, void 0);
902
+ }
903
+
904
+ function GoADivider(props) {
905
+ return jsx("goa-divider", {
906
+ spacing: props.spacing
907
+ }, void 0);
908
+ }
909
+
910
+ export { GoAAppFooter, GoAAppHeader, GoABadge, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADivider, GoADropdown, GoADropdownOption, GoAEmergencyBadge, GoAFlexCol, GoAFlexRow, GoAFormItem, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMetaLink, GoAMicrositeHeader, GoAModal, GoANavigationLink, GoANotification, GoAPage, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoAWarningBadge };