@abgov/react-components 5.2.0 → 5.3.0
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/experimental/form/form-summary.d.ts +9 -0
- package/experimental/form/form.d.ts +35 -0
- package/experimental/form/task-list.d.ts +18 -0
- package/experimental/form/task.d.ts +18 -0
- package/experimental/form-hook.d.ts +8 -0
- package/experimental/index.d.ts +2 -0
- package/experimental/resizable-panel/ResizablePanel.d.ts +7 -0
- package/experimental/validators.d.ts +50 -0
- package/experimental.js +123 -0
- package/experimental.js.map +1 -0
- package/experimental.mjs +123 -0
- package/experimental.mjs.map +1 -0
- package/icon-1IRcN4Uf.js +38 -0
- package/icon-1IRcN4Uf.js.map +1 -0
- package/icon-DgSW1II3.mjs +39 -0
- package/icon-DgSW1II3.mjs.map +1 -0
- package/index.js +44 -48
- package/index.js.map +1 -1
- package/index.mjs +32 -36
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +4 -1
- package/lib/app-header/app-header.d.ts +4 -1
- package/lib/callout/callout.d.ts +4 -1
- package/lib/card/card-actions.d.ts +12 -0
- package/lib/card/card-content.d.ts +12 -0
- package/lib/card/card-group.d.ts +12 -0
- package/lib/card/card-image.d.ts +17 -0
- package/lib/card/card.d.ts +21 -0
- package/lib/card/index.d.ts +5 -0
- package/lib/drawer/drawer.d.ts +30 -0
- package/lib/side-menu-group/side-menu-group.d.ts +6 -2
- package/package.json +6 -1
- package/style.css +49 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { Margins } from "../../common/styling";
|
|
3
3
|
export type GoAHeadingSize = "small" | "medium";
|
|
4
|
+
export type GoAIconPosition = "left" | "right";
|
|
4
5
|
interface WCProps extends Margins {
|
|
5
6
|
open?: boolean;
|
|
6
7
|
headingSize?: GoAHeadingSize;
|
|
@@ -9,6 +10,7 @@ interface WCProps extends Margins {
|
|
|
9
10
|
headingContent?: ReactNode;
|
|
10
11
|
maxwidth?: string;
|
|
11
12
|
testid?: string;
|
|
13
|
+
iconposition?: GoAIconPosition;
|
|
12
14
|
}
|
|
13
15
|
declare global {
|
|
14
16
|
namespace JSX {
|
|
@@ -25,7 +27,8 @@ export interface GoAAccordionProps extends Margins {
|
|
|
25
27
|
headingContent?: ReactNode;
|
|
26
28
|
maxWidth?: string;
|
|
27
29
|
testid?: string;
|
|
30
|
+
iconPosition?: GoAIconPosition;
|
|
28
31
|
children: ReactNode;
|
|
29
32
|
}
|
|
30
|
-
export declare function GoAAccordion({ open, heading, headingSize, secondaryText, headingContent, maxWidth, testid, children, mt, mr, mb, ml, }: GoAAccordionProps): JSX.Element;
|
|
33
|
+
export declare function GoAAccordion({ open, heading, headingSize, secondaryText, headingContent, iconPosition, maxWidth, testid, children, mt, mr, mb, ml, }: GoAAccordionProps): JSX.Element;
|
|
31
34
|
export default GoAAccordion;
|
|
@@ -3,6 +3,8 @@ interface WCProps {
|
|
|
3
3
|
url?: string;
|
|
4
4
|
maxcontentwidth?: string;
|
|
5
5
|
fullmenubreakpoint?: number;
|
|
6
|
+
hasmenuclickhandler?: boolean;
|
|
7
|
+
ref: React.RefObject<HTMLElement>;
|
|
6
8
|
testid?: string;
|
|
7
9
|
}
|
|
8
10
|
declare global {
|
|
@@ -18,7 +20,8 @@ export interface GoAAppHeaderProps {
|
|
|
18
20
|
maxContentWidth?: string;
|
|
19
21
|
fullMenuBreakpoint?: number;
|
|
20
22
|
children?: React.ReactNode;
|
|
23
|
+
onMenuClick?: () => void;
|
|
21
24
|
testId?: string;
|
|
22
25
|
}
|
|
23
|
-
export declare function GoAAppHeader({ heading, url, maxContentWidth, fullMenuBreakpoint, testId, children, }: GoAAppHeaderProps): JSX.Element;
|
|
26
|
+
export declare function GoAAppHeader({ heading, url, maxContentWidth, fullMenuBreakpoint, testId, children, onMenuClick, }: GoAAppHeaderProps): JSX.Element;
|
|
24
27
|
export default GoAAppHeader;
|
package/lib/callout/callout.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { Margins } from "../../common/styling";
|
|
|
2
2
|
export type GoACalloutType = "important" | "information" | "event" | "success" | "emergency";
|
|
3
3
|
export type GoACalloutSize = "medium" | "large";
|
|
4
4
|
export type GoACalloutAriaLive = "off" | "polite" | "assertive";
|
|
5
|
+
export type GoACalloutIconTheme = "outline" | "filled";
|
|
5
6
|
interface WCProps extends Margins {
|
|
6
7
|
heading?: string;
|
|
7
8
|
type?: GoACalloutType;
|
|
8
9
|
size?: GoACalloutSize;
|
|
9
10
|
maxwidth?: string;
|
|
10
11
|
arialive?: GoACalloutAriaLive;
|
|
12
|
+
icontheme?: GoACalloutIconTheme;
|
|
11
13
|
testid?: string;
|
|
12
14
|
}
|
|
13
15
|
declare global {
|
|
@@ -21,11 +23,12 @@ export interface GoACalloutProps extends Margins {
|
|
|
21
23
|
heading?: string;
|
|
22
24
|
type?: GoACalloutType;
|
|
23
25
|
size?: GoACalloutSize;
|
|
26
|
+
iconTheme?: GoACalloutIconTheme;
|
|
24
27
|
maxWidth?: string;
|
|
25
28
|
testId?: string;
|
|
26
29
|
ariaLive?: GoACalloutAriaLive;
|
|
27
30
|
children?: React.ReactNode;
|
|
28
31
|
}
|
|
29
32
|
export type CalloutProps = GoACalloutProps;
|
|
30
|
-
export declare const GoACallout: ({ heading, type, size, maxWidth, testId, ariaLive, children, mt, mr, mb, ml, }: GoACalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const GoACallout: ({ heading, type, iconTheme, size, maxWidth, testId, ariaLive, children, mt, mr, mb, ml, }: GoACalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
34
|
export default GoACallout;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace JSX {
|
|
3
|
+
interface IntrinsicElements {
|
|
4
|
+
"goa-card-actions": React.HTMLAttributes<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface GoACardActionsProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function GoACardActions({ children }: GoACardActionsProps): JSX.Element;
|
|
12
|
+
export default GoACardActions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace JSX {
|
|
3
|
+
interface IntrinsicElements {
|
|
4
|
+
"goa-card-content": React.HTMLAttributes<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface GoACardContentProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function GoACardContent({ children }: GoACardContentProps): JSX.Element;
|
|
12
|
+
export default GoACardContent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace JSX {
|
|
3
|
+
interface IntrinsicElements {
|
|
4
|
+
"goa-card-group": React.HTMLAttributes<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface GoACardGroupProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function GoACardGroup({ children }: GoACardGroupProps): JSX.Element;
|
|
12
|
+
export default GoACardGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface WCProps {
|
|
2
|
+
src: string;
|
|
3
|
+
height: string;
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
"goa-card-image": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export interface GoACardImageProps {
|
|
13
|
+
src: string;
|
|
14
|
+
height: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function GoACardImage({ src, height }: GoACardImageProps): JSX.Element;
|
|
17
|
+
export default GoACardImage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Margins } from "../../common/styling";
|
|
2
|
+
interface WCProps extends Margins {
|
|
3
|
+
elevation?: number;
|
|
4
|
+
width?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
"goa-card": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface GoACardProps extends Margins {
|
|
15
|
+
elevation?: number;
|
|
16
|
+
width?: string;
|
|
17
|
+
testId?: string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function GoACard({ elevation, width, mt, mr, mb, ml, testId, children, }: GoACardProps): JSX.Element;
|
|
21
|
+
export default GoACard;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type DrawerPosition = "bottom" | "left" | "right" | undefined;
|
|
3
|
+
type DrawerSizeUnit = "px" | "rem" | "ch" | "vh" | "vw";
|
|
4
|
+
type DrawerSize = `${number}${DrawerSizeUnit}` | undefined;
|
|
5
|
+
interface WCProps {
|
|
6
|
+
open: boolean | undefined;
|
|
7
|
+
position: DrawerPosition;
|
|
8
|
+
heading?: string;
|
|
9
|
+
maxsize?: DrawerSize;
|
|
10
|
+
testid?: string;
|
|
11
|
+
ref: React.RefObject<HTMLElement>;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
namespace JSX {
|
|
15
|
+
interface IntrinsicElements {
|
|
16
|
+
"goa-drawer": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export interface GoADrawerProps {
|
|
21
|
+
open: boolean;
|
|
22
|
+
position: DrawerPosition;
|
|
23
|
+
heading?: string;
|
|
24
|
+
maxSize?: DrawerSize;
|
|
25
|
+
testId?: string;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function GoADrawer({ open, position, heading, maxSize, testId, children, onClose, }: GoADrawerProps): JSX.Element;
|
|
30
|
+
export default GoADrawer;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
import { GoAIconType } from "../icon/icon";
|
|
3
|
+
import { Margins } from "../../common/styling";
|
|
4
|
+
interface WCProps extends Margins {
|
|
3
5
|
heading: string;
|
|
6
|
+
icon?: GoAIconType;
|
|
4
7
|
testid?: string;
|
|
5
8
|
}
|
|
6
9
|
declare global {
|
|
@@ -10,8 +13,9 @@ declare global {
|
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
|
-
export interface GoASideMenuGroupProps {
|
|
16
|
+
export interface GoASideMenuGroupProps extends Margins {
|
|
14
17
|
heading: string;
|
|
18
|
+
icon?: GoAIconType;
|
|
15
19
|
testId?: string;
|
|
16
20
|
children?: ReactNode;
|
|
17
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/react-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Government of Alberta - UI components for React",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/GovAlta/ui-components/issues"
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"import": "./index.mjs",
|
|
30
30
|
"require": "./index.js",
|
|
31
31
|
"types": "./index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./experimental": {
|
|
34
|
+
"import": "./experimental.mjs",
|
|
35
|
+
"require": "./experimental.js",
|
|
36
|
+
"types": "./experimental/index.d.ts"
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
}
|
package/style.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
._panel_m3z4m_1 {
|
|
2
|
+
display: flex;
|
|
3
|
+
border: var(--goa-border-width-s) solid var(--goa-color-greyscale-200);
|
|
4
|
+
border-radius: var(--goa-border-radius-m);
|
|
5
|
+
background: var(--goa-color-greyscale-white);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
._panelBackground_m3z4m_8 {
|
|
9
|
+
background: #F8F8F8;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
._children_m3z4m_12 {
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
padding: 2rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
._handle_m3z4m_17 {
|
|
18
|
+
flex: 0 0 1rem;
|
|
19
|
+
top: 0;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
width: 1rem;
|
|
23
|
+
background-color: var(--goa-color-greyscale-100);
|
|
24
|
+
border-left: var(--goa-border-width-s) solid var(--goa-color-greyscale-200);
|
|
25
|
+
cursor: col-resize;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
border-top-right-radius: calc(var(--goa-border-radius-m) - 1);
|
|
28
|
+
border-bottom-right-radius: calc(var(--goa-border-radius-m) - 1);
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
._handle_m3z4m_17:active {
|
|
34
|
+
cursor: col-resize;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
._handle_m3z4m_17 goa-icon {
|
|
38
|
+
transform: rotate(90deg);
|
|
39
|
+
opacity: 0.8;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
._width_m3z4m_42 {
|
|
43
|
+
float: right;
|
|
44
|
+
position: relative;
|
|
45
|
+
top: -2rem;
|
|
46
|
+
color: var(--goa-color-greyscale-400);
|
|
47
|
+
font-family: var(--goa-font-family-number);
|
|
48
|
+
font-size: var(--goa-font-size-2);
|
|
49
|
+
}
|