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

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/index.d.ts CHANGED
@@ -3,6 +3,9 @@
3
3
  */
4
4
  import '@abgov/web-components';
5
5
  import { GoAAppHeader } from './lib/app-header/app-header';
6
+ import { GoAAppFooter } from './lib/app-footer/app-footer';
7
+ import { GoAMetaLink } from './lib/app-footer/meta-link';
8
+ import { GoANavigationLink } from './lib/app-footer/navigation-link';
6
9
  import { GoABadge, GoAInfoBadge, GoAEmergencyBadge, GoASuccessBadge, GoAWarningBadge } from './lib/badge/badge';
7
10
  import { GoAButton } from './lib/button/button';
8
11
  import { GoAButtonGroup } from './lib/button-group/button-group';
@@ -30,4 +33,4 @@ import type { GoAIconType } from './lib/icons';
30
33
  import type { GoABadgeType } from './lib/badge/badge';
31
34
  export type { GoAIconType };
32
35
  export type { GoABadgeType };
33
- export { 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, GoAMicrositeHeader, GoAModal, GoANotification, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoAWarningBadge, };
36
+ export { GoAAppHeader, GoAAppFooter, GoAMetaLink, GoANavigationLink, 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, GoAMicrositeHeader, GoAModal, GoANotification, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoAWarningBadge, };
@@ -0,0 +1,24 @@
1
+ import React, { FC } from 'react';
2
+ interface WCProps {
3
+ id?: string;
4
+ appurl?: string;
5
+ title?: string;
6
+ copyrighturl?: string;
7
+ copyrighttext?: string;
8
+ }
9
+ declare global {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ 'goa-app-footer': WCProps & React.HTMLAttributes<HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+ export interface Props {
17
+ id?: string;
18
+ appUrl?: string;
19
+ title?: string;
20
+ copyrightUrl?: string;
21
+ copyrightText?: string;
22
+ }
23
+ export declare const GoAAppFooter: FC<Props>;
24
+ export default GoAAppFooter;
@@ -0,0 +1,20 @@
1
+ import React, { FC } from 'react';
2
+ interface WCProps {
3
+ footerid?: string;
4
+ url: string;
5
+ title: string;
6
+ }
7
+ declare global {
8
+ namespace JSX {
9
+ interface IntrinsicElements {
10
+ 'goa-meta-link': WCProps & React.HTMLAttributes<HTMLElement>;
11
+ }
12
+ }
13
+ }
14
+ interface Props {
15
+ footerId?: string;
16
+ url: string;
17
+ title: string;
18
+ }
19
+ export declare const GoAMetaLink: FC<Props>;
20
+ export default GoAMetaLink;
@@ -0,0 +1,22 @@
1
+ import React, { FC } from 'react';
2
+ interface WCProps {
3
+ footerid?: string;
4
+ url: string;
5
+ title: string;
6
+ section?: string;
7
+ }
8
+ declare global {
9
+ namespace JSX {
10
+ interface IntrinsicElements {
11
+ 'goa-navigation-link': WCProps & React.HTMLAttributes<HTMLElement>;
12
+ }
13
+ }
14
+ }
15
+ interface Props {
16
+ footerId?: string;
17
+ url: string;
18
+ title: string;
19
+ section?: string;
20
+ }
21
+ export declare const GoANavigationLink: FC<Props>;
22
+ export default GoANavigationLink;
package/lib/flex/row.d.ts CHANGED
@@ -1,7 +1,16 @@
1
- import { FC } from "react";
2
- interface Props {
3
- gap?: 'small' | 'medium' | 'large';
4
- minWidth?: number | string;
1
+ import React, { FC } from "react";
2
+ interface WCProps {
3
+ gap: 'small' | 'medium' | 'large';
4
+ }
5
+ declare global {
6
+ namespace JSX {
7
+ interface IntrinsicElements {
8
+ 'goa-flex-row': WCProps & React.HTMLAttributes<HTMLElement>;
9
+ }
10
+ }
11
+ }
12
+ export interface Props {
13
+ gap: 'small' | 'medium' | 'large';
5
14
  }
6
15
  export declare const GoAFlexRow: FC<Props>;
7
16
  export default GoAFlexRow;
@@ -11,10 +11,11 @@ interface WCProps {
11
11
  trailingicon?: string;
12
12
  variant: string;
13
13
  disabled?: boolean;
14
- error?: string;
14
+ error?: boolean;
15
15
  readonly?: boolean;
16
16
  focused?: boolean;
17
17
  handletrailingiconclick: boolean;
18
+ width?: string;
18
19
  testid?: string;
19
20
  }
20
21
  declare global {
@@ -37,7 +38,8 @@ export interface Props {
37
38
  variant?: 'goa' | 'bare';
38
39
  focused?: boolean;
39
40
  readonly?: boolean;
40
- error?: string;
41
+ error?: boolean;
42
+ width?: string;
41
43
  testId?: string;
42
44
  }
43
45
  export declare const GoAInput: FC<Props & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -1,6 +1,6 @@
1
1
  import '@abgov/web-components';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import React, { useRef, useEffect } from 'react';
3
+ import { useRef, useEffect } from 'react';
4
4
 
5
5
  const GoAAppHeader = ({
6
6
  title,
@@ -15,6 +15,57 @@ const GoAAppHeader = ({
15
15
  }), void 0);
16
16
  };
17
17
 
18
+ const GoAAppFooter = ({
19
+ id,
20
+ appUrl,
21
+ title,
22
+ copyrightUrl,
23
+ copyrightText,
24
+ children
25
+ }) => {
26
+ return jsx("goa-app-footer", Object.assign({
27
+ id: id,
28
+ appurl: appUrl,
29
+ title: title,
30
+ copyrighturl: copyrightUrl,
31
+ copyrighttext: copyrightText
32
+ }, {
33
+ children: children
34
+ }), void 0);
35
+ };
36
+
37
+ const GoAMetaLink = ({
38
+ footerId,
39
+ url,
40
+ title,
41
+ children
42
+ }) => {
43
+ return jsx("goa-meta-link", Object.assign({
44
+ footerid: footerId,
45
+ url: url,
46
+ title: title
47
+ }, {
48
+ children: children
49
+ }), void 0);
50
+ };
51
+
52
+ const GoANavigationLink = ({
53
+ footerId,
54
+ url,
55
+ title,
56
+ section,
57
+ children
58
+ }) => {
59
+ return jsx("goa-navigation-link", Object.assign({
60
+ footerid: footerId,
61
+ url: url,
62
+ title: title,
63
+ section: section
64
+ }, {
65
+ children: children
66
+ }), void 0);
67
+ };
68
+
18
69
  const GoABadge = ({
19
70
  type,
20
71
  content,
@@ -336,32 +387,12 @@ const GoADropdown = props => {
336
387
 
337
388
  const GoAFlexRow = ({
338
389
  gap,
339
- minWidth,
340
390
  children
341
391
  }) => {
342
- const style = {
343
- gap: gap === 'small' ? '1rem' : gap === 'medium' ? '2rem' : gap === 'large' ? '3rem' : '0'
344
- };
345
-
346
- const getChildren = () => {
347
- if (!children) {
348
- return null;
349
- }
350
-
351
- return React.Children.map(children, child => {
352
- return /*#__PURE__*/React.cloneElement(child, {
353
- style: Object.assign({
354
- flexBasis: minWidth
355
- }, child.props.style)
356
- });
357
- });
358
- };
359
-
360
- return jsx("div", Object.assign({
361
- className: "goa-flex-row",
362
- style: style
392
+ return jsx("goa-flex-row", Object.assign({
393
+ gap: gap
363
394
  }, {
364
- children: getChildren()
395
+ children: children
365
396
  }), void 0);
366
397
  };
367
398
 
@@ -495,6 +526,7 @@ const GoAInput = ({
495
526
  value,
496
527
  placeholder,
497
528
  error,
529
+ width,
498
530
  testId,
499
531
  onTrailingIconClick,
500
532
  onChange
@@ -541,6 +573,7 @@ const GoAInput = ({
541
573
  error: error,
542
574
  "data-testid": testId,
543
575
  value: value,
576
+ width: width,
544
577
  handletrailingiconclick: !!onTrailingIconClick
545
578
  }, void 0);
546
579
  };
@@ -827,4 +860,4 @@ const GoATextArea = ({
827
860
  }, void 0);
828
861
  };
829
862
 
830
- export { 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, GoAMicrositeHeader, GoAModal, GoANotification, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoAWarningBadge };
863
+ 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 };
@@ -2,11 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@abgov/web-components'), require('react/jsx-runtime'), require('react')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', '@abgov/web-components', 'react/jsx-runtime', 'react'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactComponents = {}, null, global.jsxRuntime, global.React));
5
- })(this, (function (exports, webComponents, jsxRuntime, React) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
5
+ })(this, (function (exports, webComponents, jsxRuntime, react) { 'use strict';
10
6
 
11
7
  /*! *****************************************************************************
12
8
  Copyright (c) Microsoft Corporation.
@@ -58,6 +54,54 @@
58
54
  }), void 0);
59
55
  };
60
56
 
57
+ var GoAAppFooter = function GoAAppFooter(_a) {
58
+ var id = _a.id,
59
+ appUrl = _a.appUrl,
60
+ title = _a.title,
61
+ copyrightUrl = _a.copyrightUrl,
62
+ copyrightText = _a.copyrightText,
63
+ children = _a.children;
64
+ return jsxRuntime.jsx("goa-app-footer", __assign({
65
+ id: id,
66
+ appurl: appUrl,
67
+ title: title,
68
+ copyrighturl: copyrightUrl,
69
+ copyrighttext: copyrightText
70
+ }, {
71
+ children: children
72
+ }), void 0);
73
+ };
74
+
75
+ var GoAMetaLink = function GoAMetaLink(_a) {
76
+ var footerId = _a.footerId,
77
+ url = _a.url,
78
+ title = _a.title,
79
+ children = _a.children;
80
+ return jsxRuntime.jsx("goa-meta-link", __assign({
81
+ footerid: footerId,
82
+ url: url,
83
+ title: title
84
+ }, {
85
+ children: children
86
+ }), void 0);
87
+ };
88
+
89
+ var GoANavigationLink = function GoANavigationLink(_a) {
90
+ var footerId = _a.footerId,
91
+ url = _a.url,
92
+ title = _a.title,
93
+ section = _a.section,
94
+ children = _a.children;
95
+ return jsxRuntime.jsx("goa-navigation-link", __assign({
96
+ footerid: footerId,
97
+ url: url,
98
+ title: title,
99
+ section: section
100
+ }, {
101
+ children: children
102
+ }), void 0);
103
+ };
104
+
61
105
  var GoABadge = function GoABadge(_a) {
62
106
  var type = _a.type,
63
107
  content = _a.content,
@@ -153,8 +197,8 @@
153
197
  variant = _e === void 0 ? 'default' : _e,
154
198
  children = _a.children,
155
199
  onClick = _a.onClick;
156
- var el = React.useRef(null);
157
- React.useEffect(function () {
200
+ var el = react.useRef(null);
201
+ react.useEffect(function () {
158
202
  if (!el.current) {
159
203
  return;
160
204
  }
@@ -220,8 +264,8 @@
220
264
  text = _a.text,
221
265
  children = _a.children,
222
266
  onChange = _a.onChange;
223
- var el = React.useRef(null);
224
- React.useEffect(function () {
267
+ var el = react.useRef(null);
268
+ react.useEffect(function () {
225
269
  if (!el.current) {
226
270
  return;
227
271
  }
@@ -259,8 +303,8 @@
259
303
  error = _c === void 0 ? false : _c,
260
304
  content = _a.content,
261
305
  onDeleteIconClick = _a.onDeleteIconClick;
262
- var el = React.useRef(null);
263
- React.useEffect(function () {
306
+ var el = react.useRef(null);
307
+ react.useEffect(function () {
264
308
  if (!el.current) return;
265
309
  if (!onDeleteIconClick) return;
266
310
  var current = el.current;
@@ -335,8 +379,8 @@
335
379
  };
336
380
 
337
381
  var GoADropdown = function GoADropdown(props) {
338
- var el = React.useRef(null);
339
- React.useEffect(function () {
382
+ var el = react.useRef(null);
383
+ react.useEffect(function () {
340
384
  if (!el.current) {
341
385
  return;
342
386
  }
@@ -374,31 +418,11 @@
374
418
 
375
419
  var GoAFlexRow = function GoAFlexRow(_a) {
376
420
  var gap = _a.gap,
377
- minWidth = _a.minWidth,
378
421
  children = _a.children;
379
- var style = {
380
- gap: gap === 'small' ? '1rem' : gap === 'medium' ? '2rem' : gap === 'large' ? '3rem' : '0'
381
- };
382
-
383
- var getChildren = function getChildren() {
384
- if (!children) {
385
- return null;
386
- }
387
-
388
- return React__default["default"].Children.map(children, function (child) {
389
- return /*#__PURE__*/React__default["default"].cloneElement(child, {
390
- style: __assign({
391
- flexBasis: minWidth
392
- }, child.props.style)
393
- });
394
- });
395
- };
396
-
397
- return jsxRuntime.jsx("div", __assign({
398
- className: "goa-flex-row",
399
- style: style
422
+ return jsxRuntime.jsx("goa-flex-row", __assign({
423
+ gap: gap
400
424
  }, {
401
- children: getChildren()
425
+ children: children
402
426
  }), void 0);
403
427
  };
404
428
 
@@ -462,8 +486,8 @@
462
486
  size = _c === void 0 ? 'medium' : _c,
463
487
  title = _a.title,
464
488
  children = _a.children;
465
- var ref = React.useRef(null);
466
- React.useEffect(function () {
489
+ var ref = react.useRef(null);
490
+ react.useEffect(function () {
467
491
  if (!ref.current) {
468
492
  return;
469
493
  }
@@ -505,11 +529,12 @@
505
529
  value = _a.value,
506
530
  placeholder = _a.placeholder,
507
531
  error = _a.error,
532
+ width = _a.width,
508
533
  testId = _a.testId,
509
534
  onTrailingIconClick = _a.onTrailingIconClick,
510
535
  onChange = _a.onChange;
511
- var ref = React.useRef(null);
512
- React.useEffect(function () {
536
+ var ref = react.useRef(null);
537
+ react.useEffect(function () {
513
538
  if (!ref.current) {
514
539
  return;
515
540
  }
@@ -549,6 +574,7 @@
549
574
  error: error,
550
575
  "data-testid": testId,
551
576
  value: value,
577
+ width: width,
552
578
  handletrailingiconclick: !!onTrailingIconClick
553
579
  }, void 0);
554
580
  };
@@ -648,8 +674,8 @@
648
674
  width = _a.width,
649
675
  actions = _a.actions,
650
676
  onClose = _a.onClose;
651
- var el = React.useRef(null);
652
- React.useEffect(function () {
677
+ var el = react.useRef(null);
678
+ react.useEffect(function () {
653
679
  if (!el.current) {
654
680
  return;
655
681
  }
@@ -733,8 +759,8 @@
733
759
  error = _d === void 0 ? false : _d,
734
760
  testId = _a.testId,
735
761
  onChange = _a.onChange;
736
- var el = React.useRef(null);
737
- React.useEffect(function () {
762
+ var el = react.useRef(null);
763
+ react.useEffect(function () {
738
764
  if (!el.current) {
739
765
  return;
740
766
  }
@@ -801,8 +827,8 @@
801
827
  testId = _a.testId,
802
828
  error = _a.error,
803
829
  onChange = _a.onChange;
804
- var el = React.useRef(null);
805
- React.useEffect(function () {
830
+ var el = react.useRef(null);
831
+ react.useEffect(function () {
806
832
  if (!el.current) {
807
833
  return;
808
834
  }
@@ -833,6 +859,7 @@
833
859
  }, void 0);
834
860
  };
835
861
 
862
+ exports.GoAAppFooter = GoAAppFooter;
836
863
  exports.GoAAppHeader = GoAAppHeader;
837
864
  exports.GoABadge = GoABadge;
838
865
  exports.GoAButton = GoAButton;
@@ -866,8 +893,10 @@
866
893
  exports.GoAInputText = GoAInputText;
867
894
  exports.GoAInputTime = GoAInputTime;
868
895
  exports.GoAInputUrl = GoAInputUrl;
896
+ exports.GoAMetaLink = GoAMetaLink;
869
897
  exports.GoAMicrositeHeader = GoAMicrositeHeader;
870
898
  exports.GoAModal = GoAModal;
899
+ exports.GoANavigationLink = GoANavigationLink;
871
900
  exports.GoANotification = GoANotification;
872
901
  exports.GoAPageBlock = GoAPageBlock;
873
902
  exports.GoARadioGroup = GoARadioGroup;