@patternfly/react-core 4.234.2 → 4.235.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/CHANGELOG.md +27 -0
- package/dist/esm/components/LoginPage/LoginFooterItem.d.ts +3 -3
- package/dist/esm/components/LoginPage/LoginForm.d.ts +18 -18
- package/dist/esm/components/LoginPage/LoginHeader.d.ts +1 -1
- package/dist/esm/components/LoginPage/LoginMainBody.d.ts +2 -2
- package/dist/esm/components/LoginPage/LoginMainFooter.d.ts +5 -5
- package/dist/esm/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
- package/dist/esm/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
- package/dist/esm/components/LoginPage/LoginMainHeader.d.ts +6 -4
- package/dist/esm/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
- package/dist/esm/components/LoginPage/LoginMainHeader.js +2 -1
- package/dist/esm/components/LoginPage/LoginMainHeader.js.map +1 -1
- package/dist/esm/components/LoginPage/LoginPage.d.ts +16 -14
- package/dist/esm/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/esm/components/LoginPage/LoginPage.js +2 -2
- package/dist/esm/components/LoginPage/LoginPage.js.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.js +86 -0
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.js +7 -0
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.js +34 -0
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js +11 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js +13 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.js +13 -0
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js +33 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.js +5 -0
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js +81 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.js +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +20 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/index.d.ts +12 -0
- package/dist/esm/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/index.js +12 -0
- package/dist/esm/next/components/Wizard/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/types.d.ts +69 -0
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/types.js +20 -0
- package/dist/esm/next/components/Wizard/types.js.map +1 -0
- package/dist/esm/next/components/Wizard/utils.d.ts +15 -0
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/utils.js +35 -0
- package/dist/esm/next/components/Wizard/utils.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +1 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +1 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/components/LoginPage/LoginFooterItem.d.ts +3 -3
- package/dist/js/components/LoginPage/LoginForm.d.ts +18 -18
- package/dist/js/components/LoginPage/LoginHeader.d.ts +1 -1
- package/dist/js/components/LoginPage/LoginMainBody.d.ts +2 -2
- package/dist/js/components/LoginPage/LoginMainFooter.d.ts +5 -5
- package/dist/js/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
- package/dist/js/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
- package/dist/js/components/LoginPage/LoginMainHeader.d.ts +6 -4
- package/dist/js/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
- package/dist/js/components/LoginPage/LoginMainHeader.js +2 -1
- package/dist/js/components/LoginPage/LoginMainHeader.js.map +1 -1
- package/dist/js/components/LoginPage/LoginPage.d.ts +16 -14
- package/dist/js/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/js/components/LoginPage/LoginPage.js +2 -2
- package/dist/js/components/LoginPage/LoginPage.js.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.js +90 -0
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.js +12 -0
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.js +40 -0
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.js +16 -0
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.js +18 -0
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.js +18 -0
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js +37 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.js +10 -0
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.js +86 -0
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.js +6 -0
- package/dist/js/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +25 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/index.d.ts +12 -0
- package/dist/js/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/index.js +17 -0
- package/dist/js/next/components/Wizard/index.js.map +1 -0
- package/dist/js/next/components/Wizard/types.d.ts +69 -0
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/types.js +29 -0
- package/dist/js/next/components/Wizard/types.js.map +1 -0
- package/dist/js/next/components/Wizard/utils.d.ts +15 -0
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/utils.js +41 -0
- package/dist/js/next/components/Wizard/utils.js.map +1 -0
- package/dist/js/next/components/index.d.ts +1 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +1 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.css +208 -208
- package/dist/umd/react-core.js +4 -3
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Card/examples/Card.md +67 -38
- package/src/components/LoginPage/LoginFooterItem.tsx +3 -3
- package/src/components/LoginPage/LoginForm.tsx +18 -18
- package/src/components/LoginPage/LoginHeader.tsx +1 -1
- package/src/components/LoginPage/LoginMainBody.tsx +2 -2
- package/src/components/LoginPage/LoginMainFooter.tsx +5 -5
- package/src/components/LoginPage/LoginMainFooterBandItem.tsx +2 -2
- package/src/components/LoginPage/LoginMainFooterLinksItem.tsx +5 -5
- package/src/components/LoginPage/LoginMainHeader.tsx +8 -4
- package/src/components/LoginPage/LoginPage.tsx +18 -15
- package/src/components/LoginPage/examples/LoginPage.md +8 -0
- package/src/components/LoginPage/examples/LoginPageBasic.tsx +0 -1
- package/src/components/LoginPage/examples/LoginPageLanguageSelect.tsx +194 -0
- package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +0 -1
- package/src/components/Wizard/examples/Wizard.md +21 -4
- package/src/demos/CardDemos.md +4 -0
- package/src/next/components/Wizard/Wizard.tsx +184 -0
- package/src/next/components/Wizard/WizardBody.tsx +34 -0
- package/src/next/components/Wizard/WizardContext.tsx +104 -0
- package/src/next/components/Wizard/WizardFooter.tsx +63 -0
- package/src/next/components/Wizard/WizardHeader.tsx +53 -0
- package/src/next/components/Wizard/WizardNav.tsx +41 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +103 -0
- package/src/next/components/Wizard/WizardStep.tsx +23 -0
- package/src/next/components/Wizard/WizardToggle.tsx +209 -0
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +298 -0
- package/src/next/components/Wizard/examples/Wizard.md +125 -0
- package/src/next/components/Wizard/examples/WizardBasic.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +46 -0
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +170 -0
- package/src/next/components/Wizard/hooks/index.ts +1 -0
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +22 -0
- package/src/next/components/Wizard/index.ts +11 -0
- package/src/next/components/Wizard/types.tsx +101 -0
- package/src/next/components/Wizard/utils.ts +47 -0
- package/src/next/components/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 4.235.0 (2022-08-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **WizardComposable:** Created composable spinoff of wizard w/ enhancements ([#7703](https://github.com/patternfly/patternfly-react/issues/7703)) ([76eab29](https://github.com/patternfly/patternfly-react/commit/76eab29b640e2f71cd9bd5d42f58fa8dd0eba799))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 4.234.4 (2022-08-23)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 4.234.3 (2022-08-23)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## 4.234.2 (2022-08-23)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginFooterItemProps extends React.HTMLProps<HTMLAnchorElement> {
|
|
3
|
-
/** Content rendered inside the footer
|
|
3
|
+
/** Content rendered inside the footer link item */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** Additional classes added to the
|
|
5
|
+
/** Additional classes added to the footer link item */
|
|
6
6
|
className?: string;
|
|
7
|
-
/** The URL of the
|
|
7
|
+
/** The URL of the footer link item */
|
|
8
8
|
href?: string;
|
|
9
9
|
/** Specifies where to open the linked document */
|
|
10
10
|
target?: string;
|
|
@@ -2,29 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
export interface LoginFormProps extends React.HTMLProps<HTMLFormElement> {
|
|
3
3
|
/** Flag to indicate if the first dropdown item should not gain initial focus */
|
|
4
4
|
noAutoFocus?: boolean;
|
|
5
|
-
/** Additional classes added to the
|
|
5
|
+
/** Additional classes added to the login main body's form */
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Flag indicating the
|
|
7
|
+
/** Flag indicating the helper text is visible * */
|
|
8
8
|
showHelperText?: boolean;
|
|
9
|
-
/** Content displayed in the
|
|
9
|
+
/** Content displayed in the helper text component * */
|
|
10
10
|
helperText?: React.ReactNode;
|
|
11
|
-
/** Icon displayed to the left in the
|
|
11
|
+
/** Icon displayed to the left in the helper text */
|
|
12
12
|
helperTextIcon?: React.ReactNode;
|
|
13
|
-
/** Label for the
|
|
13
|
+
/** Label for the username input field */
|
|
14
14
|
usernameLabel?: string;
|
|
15
|
-
/** Value for the
|
|
15
|
+
/** Value for the username */
|
|
16
16
|
usernameValue?: string;
|
|
17
|
-
/** Function that handles the onChange event for the
|
|
17
|
+
/** Function that handles the onChange event for the username */
|
|
18
18
|
onChangeUsername?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
19
|
-
/** Flag indicating if the
|
|
19
|
+
/** Flag indicating if the username is valid */
|
|
20
20
|
isValidUsername?: boolean;
|
|
21
|
-
/** Label for the
|
|
21
|
+
/** Label for the password input field */
|
|
22
22
|
passwordLabel?: string;
|
|
23
|
-
/** Value for the
|
|
23
|
+
/** Value for the password */
|
|
24
24
|
passwordValue?: string;
|
|
25
|
-
/** Function that handles the onChange event for the
|
|
25
|
+
/** Function that handles the onChange event for the password */
|
|
26
26
|
onChangePassword?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
27
|
-
/** Flag indicating if the
|
|
27
|
+
/** Flag indicating if the password is valid */
|
|
28
28
|
isValidPassword?: boolean;
|
|
29
29
|
/** Flag indicating if the user can toggle hiding the password */
|
|
30
30
|
isShowPasswordEnabled?: boolean;
|
|
@@ -32,17 +32,17 @@ export interface LoginFormProps extends React.HTMLProps<HTMLFormElement> {
|
|
|
32
32
|
showPasswordAriaLabel?: string;
|
|
33
33
|
/** Accessible label for the hide password button */
|
|
34
34
|
hidePasswordAriaLabel?: string;
|
|
35
|
-
/** Label for the
|
|
35
|
+
/** Label for the log in button input */
|
|
36
36
|
loginButtonLabel?: string;
|
|
37
|
-
/** Flag indicating if the
|
|
37
|
+
/** Flag indicating if the login button is disabled */
|
|
38
38
|
isLoginButtonDisabled?: boolean;
|
|
39
|
-
/** Function that is called when the
|
|
39
|
+
/** Function that is called when the login button is clicked */
|
|
40
40
|
onLoginButtonClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
41
|
-
/** Label for the
|
|
41
|
+
/** Label for the remember me checkbox that indicates the user should be kept logged in. If the label is not provided, the checkbox will not show. */
|
|
42
42
|
rememberMeLabel?: string;
|
|
43
|
-
/** Flag indicating if the remember me
|
|
43
|
+
/** Flag indicating if the remember me checkbox is checked. */
|
|
44
44
|
isRememberMeChecked?: boolean;
|
|
45
|
-
/** Function that handles the onChange event for the
|
|
45
|
+
/** Function that handles the onChange event for the remember me checkbox */
|
|
46
46
|
onChangeRememberMe?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
|
|
47
47
|
}
|
|
48
48
|
export declare const LoginForm: React.FunctionComponent<LoginFormProps>;
|
|
@@ -4,7 +4,7 @@ export interface LoginHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
/** Additional classes added to the login header */
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Header
|
|
7
|
+
/** Header brand component (e.g. <LoginHeader />) */
|
|
8
8
|
headerBrand?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export declare const LoginHeader: React.FunctionComponent<LoginHeaderProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginMainBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Content rendered inside the
|
|
3
|
+
/** Content rendered inside the login main body */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** Additional classes added to the
|
|
5
|
+
/** Additional classes added to the login main body */
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const LoginMainBody: React.FunctionComponent<LoginMainBodyProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginMainFooterProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Additional classes added to the
|
|
3
|
+
/** Additional classes added to the login main footer */
|
|
4
4
|
className?: string;
|
|
5
|
-
/** Content rendered inside the
|
|
5
|
+
/** Content rendered inside the login main footer */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/** Content rendered inside the
|
|
7
|
+
/** Content rendered inside the login main footer as social media links* */
|
|
8
8
|
socialMediaLoginContent?: React.ReactNode;
|
|
9
|
-
/** Content rendered inside of
|
|
9
|
+
/** Content rendered inside of login main footer band to display a sign up for account message */
|
|
10
10
|
signUpForAccountMessage?: React.ReactNode;
|
|
11
|
-
/** Content rendered inside of
|
|
11
|
+
/** Content rendered inside of login main footer band do display a forgot credentials link* */
|
|
12
12
|
forgotCredentials?: React.ReactNode;
|
|
13
13
|
}
|
|
14
14
|
export declare const LoginMainFooter: React.FunctionComponent<LoginMainFooterProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginMainFooterBandItemProps extends React.HTMLProps<HTMLParagraphElement> {
|
|
3
|
-
/** Content rendered inside the footer
|
|
3
|
+
/** Content rendered inside the footer link item */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** Additional classes added to the
|
|
5
|
+
/** Additional classes added to the footer link item */
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const LoginMainFooterBandItem: React.FunctionComponent<LoginMainFooterBandItemProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginMainFooterLinksItemProps extends React.HTMLProps<HTMLLIElement> {
|
|
3
|
-
/** Content rendered inside the footer
|
|
3
|
+
/** Content rendered inside the footer link item */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** HREF for
|
|
5
|
+
/** HREF for footer link item */
|
|
6
6
|
href?: string;
|
|
7
|
-
/** Target for
|
|
7
|
+
/** Target for footer link item */
|
|
8
8
|
target?: string;
|
|
9
|
-
/** Additional classes added to the
|
|
9
|
+
/** Additional classes added to the footer link item */
|
|
10
10
|
className?: string;
|
|
11
|
-
/** Component used to render the
|
|
11
|
+
/** Component used to render the footer link item */
|
|
12
12
|
linkComponent?: React.ReactNode;
|
|
13
13
|
/** Props for the LinkComponent */
|
|
14
14
|
linkComponentProps?: any;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface LoginMainHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Content rendered inside the
|
|
3
|
+
/** Content rendered inside the login main header */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/** Additional classes added to the
|
|
5
|
+
/** Additional classes added to the login main header */
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Title for the
|
|
7
|
+
/** Title for the login main header */
|
|
8
8
|
title?: string;
|
|
9
|
-
/** Subtitle that contains the
|
|
9
|
+
/** Subtitle that contains the text, URL, and URL text for the login main header */
|
|
10
10
|
subtitle?: string;
|
|
11
|
+
/** Actions that render for the login main header */
|
|
12
|
+
headerUtilities?: React.ReactNode;
|
|
11
13
|
}
|
|
12
14
|
export declare const LoginMainHeader: React.FunctionComponent<LoginMainHeaderProps>;
|
|
13
15
|
//# sourceMappingURL=LoginMainHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginMainHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginMainHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC3E,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"LoginMainHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginMainHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC3E,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAkBzE,CAAC"}
|
|
@@ -4,10 +4,11 @@ import { Title, TitleSizes } from '../Title';
|
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
6
6
|
export const LoginMainHeader = (_a) => {
|
|
7
|
-
var { children = null, className = '', title = '', subtitle = '' } = _a, props = __rest(_a, ["children", "className", "title", "subtitle"]);
|
|
7
|
+
var { children = null, className = '', title = '', subtitle = '', headerUtilities = null } = _a, props = __rest(_a, ["children", "className", "title", "subtitle", "headerUtilities"]);
|
|
8
8
|
return (React.createElement("header", Object.assign({ className: css(styles.loginMainHeader, className) }, props),
|
|
9
9
|
title && (React.createElement(Title, { headingLevel: "h2", size: TitleSizes['3xl'] }, title)),
|
|
10
10
|
subtitle && React.createElement("p", { className: css(styles.loginMainHeaderDesc) }, subtitle),
|
|
11
|
+
headerUtilities && React.createElement("div", { className: css(styles.loginMainHeaderUtilities) }, headerUtilities),
|
|
11
12
|
children));
|
|
12
13
|
};
|
|
13
14
|
LoginMainHeader.displayName = 'LoginMainHeader';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginMainHeader.js","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginMainHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"LoginMainHeader.js","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginMainHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,qDAAqD,CAAC;AAezE,MAAM,CAAC,MAAM,eAAe,GAAkD,CAAC,EAOxD,EAAE,EAAE;QAPoD,EAC7E,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,EACV,QAAQ,GAAG,EAAE,EACb,eAAe,GAAG,IAAI,OAED,EADlB,KAAK,cANqE,iEAO9E,CADS;IACkB,OAAA,CAC1B,8CAAQ,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,IAAM,KAAK;QACjE,KAAK,IAAI,CACR,oBAAC,KAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAC7C,KAAK,CACA,CACT;QACA,QAAQ,IAAI,2BAAG,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAG,QAAQ,CAAK;QACzE,eAAe,IAAI,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAG,eAAe,CAAO;QAChG,QAAQ,CACF,CACV,CAAA;CAAA,CAAC;AACF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
|
|
@@ -2,33 +2,35 @@ import * as React from 'react';
|
|
|
2
2
|
import { BackgroundImageSrcMap } from '../BackgroundImage';
|
|
3
3
|
import { ListVariant } from '../List';
|
|
4
4
|
export interface LoginPageProps extends React.HTMLProps<HTMLDivElement> {
|
|
5
|
-
/** Anything that can be rendered inside of the
|
|
5
|
+
/** Anything that can be rendered inside of the login page (e.g. <LoginPageForm>) */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/** Additional classes added to the
|
|
7
|
+
/** Additional classes added to the login page */
|
|
8
8
|
className?: string;
|
|
9
|
-
/** Attribute that specifies the URL of the brand image for the
|
|
9
|
+
/** Attribute that specifies the URL of the brand image for the login page */
|
|
10
10
|
brandImgSrc?: string;
|
|
11
|
-
/** Attribute that specifies the alt text of the brand image for the
|
|
11
|
+
/** Attribute that specifies the alt text of the brand image for the login page */
|
|
12
12
|
brandImgAlt?: string;
|
|
13
|
-
/** Attribute that specifies the URL of the background image for the
|
|
13
|
+
/** Attribute that specifies the URL of the background image for the login page */
|
|
14
14
|
backgroundImgSrc?: string | BackgroundImageSrcMap;
|
|
15
|
-
/** Attribute that specifies the alt text of the background image for the
|
|
15
|
+
/** Attribute that specifies the alt text of the background image for the login page */
|
|
16
16
|
backgroundImgAlt?: string;
|
|
17
|
-
/** Content rendered inside of the
|
|
17
|
+
/** Content rendered inside of the text component of the login page */
|
|
18
18
|
textContent?: string;
|
|
19
|
-
/** Items rendered inside of the
|
|
19
|
+
/** Items rendered inside of the footer list component of the login page */
|
|
20
20
|
footerListItems?: React.ReactNode;
|
|
21
|
-
/** Adds list variant styles for the
|
|
21
|
+
/** Adds list variant styles for the footer list component of the login page. The only current value is'inline' */
|
|
22
22
|
footerListVariants?: ListVariant.inline;
|
|
23
|
-
/** Title for the
|
|
23
|
+
/** Title for the login main body header of the login page */
|
|
24
24
|
loginTitle: string;
|
|
25
|
-
/** Subtitle for the
|
|
25
|
+
/** Subtitle for the login main body header of the login page */
|
|
26
26
|
loginSubtitle?: string;
|
|
27
|
-
/**
|
|
27
|
+
/** @beta Header utilities for the login main body header of the login page */
|
|
28
|
+
headerUtilities?: React.ReactNode;
|
|
29
|
+
/** Content rendered inside of login main footer band to display a sign up for account message */
|
|
28
30
|
signUpForAccountMessage?: React.ReactNode;
|
|
29
|
-
/** Content rendered inside of
|
|
31
|
+
/** Content rendered inside of login main footer band to display a forgot credentials link. */
|
|
30
32
|
forgotCredentials?: React.ReactNode;
|
|
31
|
-
/** Content rendered inside of
|
|
33
|
+
/** Content rendered inside of social media login footer section */
|
|
32
34
|
socialMediaLoginContent?: React.ReactNode;
|
|
33
35
|
}
|
|
34
36
|
export declare const LoginPage: React.FunctionComponent<LoginPageProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginPage.d.ts","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAmB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,EAAQ,WAAW,EAAE,MAAM,SAAS,CA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CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3C;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CA+C7D,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { LoginMainHeader } from './LoginMainHeader';
|
|
|
11
11
|
import { LoginMainBody } from './LoginMainBody';
|
|
12
12
|
import { LoginMainFooter } from './LoginMainFooter';
|
|
13
13
|
export const LoginPage = (_a) => {
|
|
14
|
-
var { children = null, className = '', brandImgSrc = '', brandImgAlt = '', backgroundImgSrc = '', backgroundImgAlt = '', footerListItems = null, textContent = '', footerListVariants, loginTitle, loginSubtitle, signUpForAccountMessage = null, forgotCredentials = null, socialMediaLoginContent = null } = _a, props = __rest(_a, ["children", "className", "brandImgSrc", "brandImgAlt", "backgroundImgSrc", "backgroundImgAlt", "footerListItems", "textContent", "footerListVariants", "loginTitle", "loginSubtitle", "signUpForAccountMessage", "forgotCredentials", "socialMediaLoginContent"]);
|
|
14
|
+
var { children = null, className = '', brandImgSrc = '', brandImgAlt = '', backgroundImgSrc = '', backgroundImgAlt = '', footerListItems = null, textContent = '', footerListVariants, loginTitle, loginSubtitle, headerUtilities, signUpForAccountMessage = null, forgotCredentials = null, socialMediaLoginContent = null } = _a, props = __rest(_a, ["children", "className", "brandImgSrc", "brandImgAlt", "backgroundImgSrc", "backgroundImgAlt", "footerListItems", "textContent", "footerListVariants", "loginTitle", "loginSubtitle", "headerUtilities", "signUpForAccountMessage", "forgotCredentials", "socialMediaLoginContent"]);
|
|
15
15
|
const HeaderBrand = (React.createElement(React.Fragment, null,
|
|
16
16
|
React.createElement(Brand, { src: brandImgSrc, alt: brandImgAlt })));
|
|
17
17
|
const Header = React.createElement(LoginHeader, { headerBrand: HeaderBrand });
|
|
@@ -21,7 +21,7 @@ export const LoginPage = (_a) => {
|
|
|
21
21
|
return (React.createElement(React.Fragment, null,
|
|
22
22
|
backgroundImgSrc && React.createElement(BackgroundImage, { src: backgroundImgSrc, alt: backgroundImgAlt }),
|
|
23
23
|
React.createElement(Login, Object.assign({ header: Header, footer: Footer, className: css(className) }, props),
|
|
24
|
-
React.createElement(LoginMainHeader, { title: loginTitle, subtitle: loginSubtitle }),
|
|
24
|
+
React.createElement(LoginMainHeader, { title: loginTitle, subtitle: loginSubtitle, headerUtilities: headerUtilities }),
|
|
25
25
|
React.createElement(LoginMainBody, null, children),
|
|
26
26
|
(socialMediaLoginContent || forgotCredentials || signUpForAccountMessage) && (React.createElement(LoginMainFooter, { socialMediaLoginContent: socialMediaLoginContent, forgotCredentials: forgotCredentials, signUpForAccountMessage: signUpForAccountMessage })))));
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginPage.js","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginPage.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAyB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"LoginPage.js","sourceRoot":"","sources":["../../../../src/components/LoginPage/LoginPage.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM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B,IAAG,eAAe,CAAQ,CAC/C,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ;QACZ,gBAAgB,IAAI,oBAAC,eAAe,IAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAI;QACtF,oBAAC,KAAK,kBAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,IAAM,KAAK;YACzE,oBAAC,eAAe,IAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,GAAI;YACjG,oBAAC,aAAa,QAAE,QAAQ,CAAiB;YACxC,CAAC,uBAAuB,IAAI,iBAAiB,IAAI,uBAAuB,CAAC,IAAI,CAC5E,oBAAC,eAAe,IACd,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,EACpC,uBAAuB,EAAE,uBAAuB,GAChD,CACH,CACK,CACO,CAClB,CAAC;AACJ,CAAC,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DefaultWizardFooterProps, DefaultWizardNavProps, WizardNavStepFunction, CustomWizardNavFunction } from './types';
|
|
3
|
+
import { WizardStepProps } from './WizardStep';
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper for all steps and hosts state, including navigation helpers, within context.
|
|
6
|
+
* The WizardContext provided by default gives any child of wizard access to those resources.
|
|
7
|
+
*/
|
|
8
|
+
export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
|
|
9
|
+
/** Step components */
|
|
10
|
+
children: React.ReactElement<WizardStepProps> | React.ReactElement<WizardStepProps>[];
|
|
11
|
+
/** Wizard header */
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
/** Wizard footer */
|
|
14
|
+
footer?: DefaultWizardFooterProps | React.ReactElement;
|
|
15
|
+
/** Default wizard nav props or a custom WizardNav (with callback) */
|
|
16
|
+
nav?: DefaultWizardNavProps | CustomWizardNavFunction;
|
|
17
|
+
/** The initial index the wizard is to start on (1 or higher). Defaults to 1. */
|
|
18
|
+
startIndex?: number;
|
|
19
|
+
/** Additional classes spread to the wizard */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Custom width of the wizard */
|
|
22
|
+
width?: number | string;
|
|
23
|
+
/** Custom height of the wizard */
|
|
24
|
+
height?: number | string;
|
|
25
|
+
/** Callback function when a step in the nav is clicked */
|
|
26
|
+
onNavByIndex?: WizardNavStepFunction;
|
|
27
|
+
/** Callback function after next button is clicked */
|
|
28
|
+
onNext?: WizardNavStepFunction;
|
|
29
|
+
/** Callback function after back button is clicked */
|
|
30
|
+
onBack?: WizardNavStepFunction;
|
|
31
|
+
/** Callback function to save at the end of the wizard, if not specified uses onClose */
|
|
32
|
+
onSave?: () => void;
|
|
33
|
+
/** Callback function to close the wizard */
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const Wizard: {
|
|
37
|
+
(props: WizardProps): JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/Wizard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EAGrB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C;;;GAGG;AAEH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAClE,sBAAsB;IACtB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;IACtF,oBAAoB;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,oBAAoB;IACpB,MAAM,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC,YAAY,CAAC;IACvD,qEAAqE;IACrE,GAAG,CAAC,EAAE,qBAAqB,GAAG,uBAAuB,CAAC;IACtD,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,qDAAqD;IACrD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,qDAAqD;IACrD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,MAAM;YAAW,WAAW;;CA4FxC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
5
|
+
import { isCustomWizardFooter, isWizardParentStep } from './types';
|
|
6
|
+
import { buildSteps, normalizeNavStep } from './utils';
|
|
7
|
+
import { useWizardContext, WizardContextProvider } from './WizardContext';
|
|
8
|
+
import { WizardFooter } from './WizardFooter';
|
|
9
|
+
import { WizardToggle } from './WizardToggle';
|
|
10
|
+
export const Wizard = (props) => {
|
|
11
|
+
const { startIndex = 1, children, footer, onNavByIndex, onNext, onBack, onSave, onClose } = props, internalProps = __rest(props, ["startIndex", "children", "footer", "onNavByIndex", "onNext", "onBack", "onSave", "onClose"]);
|
|
12
|
+
const [currentStepIndex, setCurrentStepIndex] = React.useState(startIndex);
|
|
13
|
+
const steps = buildSteps(children);
|
|
14
|
+
const goToStepByIndex = (index) => {
|
|
15
|
+
const lastStepIndex = steps.length;
|
|
16
|
+
if (index < 1) {
|
|
17
|
+
index = 1;
|
|
18
|
+
}
|
|
19
|
+
else if (index > lastStepIndex) {
|
|
20
|
+
index = lastStepIndex;
|
|
21
|
+
}
|
|
22
|
+
const currStep = steps[index - 1];
|
|
23
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
24
|
+
setCurrentStepIndex(index);
|
|
25
|
+
return onNavByIndex === null || onNavByIndex === void 0 ? void 0 : onNavByIndex(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
26
|
+
};
|
|
27
|
+
const goToNextStep = () => {
|
|
28
|
+
// Save when on the last step, otherwise close
|
|
29
|
+
if (currentStepIndex >= steps.length) {
|
|
30
|
+
if (onSave) {
|
|
31
|
+
return onSave();
|
|
32
|
+
}
|
|
33
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
34
|
+
}
|
|
35
|
+
let currStep = steps[currentStepIndex];
|
|
36
|
+
let newStepIndex = currentStepIndex + 1;
|
|
37
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
38
|
+
// Skip parent step and focus on the first sub-step if they exist
|
|
39
|
+
if (isWizardParentStep(currStep)) {
|
|
40
|
+
newStepIndex += 1;
|
|
41
|
+
currStep = steps[currentStepIndex + 1];
|
|
42
|
+
}
|
|
43
|
+
setCurrentStepIndex(newStepIndex);
|
|
44
|
+
return onNext === null || onNext === void 0 ? void 0 : onNext(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
45
|
+
};
|
|
46
|
+
const goToPrevStep = () => {
|
|
47
|
+
if (steps.length < currentStepIndex) {
|
|
48
|
+
// Previous step was removed, just update the currentStep state
|
|
49
|
+
setCurrentStepIndex(steps.length);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
let currStep = steps[currentStepIndex - 2];
|
|
53
|
+
let newStepIndex = currentStepIndex - 1;
|
|
54
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
55
|
+
// // Skip parent step and focus on the step prior
|
|
56
|
+
if (isWizardParentStep(currStep)) {
|
|
57
|
+
newStepIndex -= 1;
|
|
58
|
+
currStep = steps[currentStepIndex - 3];
|
|
59
|
+
}
|
|
60
|
+
setCurrentStepIndex(newStepIndex);
|
|
61
|
+
return onBack === null || onBack === void 0 ? void 0 : onBack(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const goToStepById = (id) => {
|
|
65
|
+
const stepIndex = steps.findIndex(step => step.id === id) + 1;
|
|
66
|
+
stepIndex > 0 && setCurrentStepIndex(stepIndex);
|
|
67
|
+
};
|
|
68
|
+
const goToStepByName = (name) => {
|
|
69
|
+
const stepIndex = steps.findIndex(step => step.name === name) + 1;
|
|
70
|
+
stepIndex > 0 && setCurrentStepIndex(stepIndex);
|
|
71
|
+
};
|
|
72
|
+
return (React.createElement(WizardContextProvider, { steps: steps, currentStepIndex: currentStepIndex, footer: isCustomWizardFooter(footer) && footer, onNext: goToNextStep, onBack: goToPrevStep, onClose: onClose, goToStepById: goToStepById, goToStepByName: goToStepByName, goToStepByIndex: goToStepByIndex },
|
|
73
|
+
React.createElement(WizardInternal, Object.assign({}, internalProps, { footer: footer }), children)));
|
|
74
|
+
};
|
|
75
|
+
// eslint-disable-next-line patternfly-react/no-anonymous-functions
|
|
76
|
+
const WizardInternal = (_a) => {
|
|
77
|
+
var _b;
|
|
78
|
+
var { height, width, className, header, footer, nav } = _a, divProps = __rest(_a, ["height", "width", "className", "header", "footer", "nav"]);
|
|
79
|
+
const { activeStep, steps, footer: customFooter, onNext, onBack, onClose, goToStepByIndex } = useWizardContext();
|
|
80
|
+
const wizardFooter = customFooter || (React.createElement(WizardFooter, Object.assign({ activeStep: activeStep, onNext: onNext, onBack: onBack, onClose: onClose, disableBackButton: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === ((_b = steps[0]) === null || _b === void 0 ? void 0 : _b.id) }, footer)));
|
|
81
|
+
return (React.createElement("div", Object.assign({ className: css(styles.wizard, className), style: Object.assign(Object.assign({}, (height ? { height } : {})), (width ? { width } : {})) }, divProps),
|
|
82
|
+
header,
|
|
83
|
+
React.createElement(WizardToggle, { steps: steps, activeStep: activeStep, footer: wizardFooter, nav: nav, goToStepByIndex: goToStepByIndex })));
|
|
84
|
+
};
|
|
85
|
+
Wizard.displayName = 'Wizard';
|
|
86
|
+
//# sourceMappingURL=Wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/Wizard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAE3E,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EAGnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoC9C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC3C,MAAM,EAAE,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAuB,KAAK,EAAvB,aAAa,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0CAAE,EAAE,CAAA,IAC9C,MAAM,EACV,CACH,CAAC;IAEF,OAAO,CACL,2CACE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACxC,KAAK,kCACA,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAC1B,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAEzB,QAAQ;QAEX,MAAM;QACP,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,GAChC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Used as a wrapper for WizardStep content, where the wrapping element is customizable.
|
|
4
|
+
*/
|
|
5
|
+
export interface WizardBodyProps {
|
|
6
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
7
|
+
/** Set to true to remove the default body padding */
|
|
8
|
+
hasNoBodyPadding?: boolean;
|
|
9
|
+
/** An aria-label to use for the wrapper element */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** Sets the aria-labelledby attribute for the wrapper element */
|
|
12
|
+
'aria-labelledby'?: string;
|
|
13
|
+
/** Component used as the wrapping content container */
|
|
14
|
+
wrapperElement?: React.ElementType;
|
|
15
|
+
}
|
|
16
|
+
export declare const WizardBody: {
|
|
17
|
+
({ children, hasNoBodyPadding, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, wrapperElement: Wrapper }: WizardBodyProps): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=WizardBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardBody.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC/C,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACpC;AAED,eAAO,MAAM,UAAU;0HAMpB,eAAe;;CAIjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
export const WizardBody = ({ children, hasNoBodyPadding = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, wrapperElement: Wrapper = 'div' }) => (React.createElement(Wrapper, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: css(styles.wizardMain) },
|
|
5
|
+
React.createElement("div", { className: css(styles.wizardMainBody, hasNoBodyPadding && styles.modifiers.noPadding) }, children)));
|
|
6
|
+
WizardBody.displayName = 'WizardBody';
|
|
7
|
+
//# sourceMappingURL=WizardBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardBody.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAkB/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,gBAAgB,GAAG,KAAK,EACxB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,cAAc,EAAE,OAAO,GAAG,KAAK,EACf,EAAE,EAAE,CAAC,CACrB,oBAAC,OAAO,kBAAa,SAAS,qBAAmB,cAAc,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;IAChG,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,gBAAgB,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAG,QAAQ,CAAO,CACpG,CACX,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WizardControlStep } from './types';
|
|
3
|
+
export interface WizardContextProps {
|
|
4
|
+
/** List of steps */
|
|
5
|
+
steps: WizardControlStep[];
|
|
6
|
+
/** Active step */
|
|
7
|
+
activeStep: WizardControlStep;
|
|
8
|
+
/** Footer element */
|
|
9
|
+
footer: React.ReactElement;
|
|
10
|
+
/** Navigate to the next step */
|
|
11
|
+
onNext: () => void;
|
|
12
|
+
/** Navigate to the previous step */
|
|
13
|
+
onBack: () => void;
|
|
14
|
+
/** Close the wizard */
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
/** Navigate to step by ID */
|
|
17
|
+
goToStepById: (id: number | string) => void;
|
|
18
|
+
/** Navigate to step by name */
|
|
19
|
+
goToStepByName: (name: string) => void;
|
|
20
|
+
/** Navigate to step by index */
|
|
21
|
+
goToStepByIndex: (index: number) => void;
|
|
22
|
+
/** Update the footer with any react element */
|
|
23
|
+
setFooter: (footer: React.ReactElement) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const WizardContext: React.Context<WizardContextProps>;
|
|
26
|
+
interface WizardContextRenderProps {
|
|
27
|
+
steps: WizardControlStep[];
|
|
28
|
+
activeStep: WizardControlStep;
|
|
29
|
+
footer: React.ReactElement;
|
|
30
|
+
onNext(): void;
|
|
31
|
+
onBack(): void;
|
|
32
|
+
onClose(): void;
|
|
33
|
+
}
|
|
34
|
+
export interface WizardContextProviderProps {
|
|
35
|
+
steps: WizardControlStep[];
|
|
36
|
+
currentStepIndex: number;
|
|
37
|
+
footer: React.ReactElement;
|
|
38
|
+
children: React.ReactElement | ((props: WizardContextRenderProps) => React.ReactElement);
|
|
39
|
+
onNext(): void;
|
|
40
|
+
onBack(): void;
|
|
41
|
+
onClose(): void;
|
|
42
|
+
goToStepById(id: number | string): void;
|
|
43
|
+
goToStepByName(name: string): void;
|
|
44
|
+
goToStepByIndex(index: number): void;
|
|
45
|
+
}
|
|
46
|
+
export declare const WizardContextProvider: React.FunctionComponent<WizardContextProviderProps>;
|
|
47
|
+
export declare const useWizardContext: () => WizardContextProps;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=WizardContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,kBAAkB;IAClB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,qBAAqB;IACrB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,oCAAoC;IACpC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6BAA6B;IAC7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|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getActiveStep } from './utils';
|
|
3
|
+
export const WizardContext = React.createContext({});
|
|
4
|
+
// eslint-disable-next-line patternfly-react/no-anonymous-functions
|
|
5
|
+
export const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, currentStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
6
|
+
const [steps, setSteps] = React.useState(initialSteps);
|
|
7
|
+
const [footer, setFooter] = React.useState(initialFooter);
|
|
8
|
+
const activeStep = getActiveStep(steps, currentStepIndex);
|
|
9
|
+
// When the active step changes and the newly active step isn't visited, set the visited flag to true.
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (activeStep && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.visited)) {
|
|
12
|
+
setSteps(prevSteps => prevSteps.map(step => {
|
|
13
|
+
if (step.id === activeStep.id) {
|
|
14
|
+
return Object.assign(Object.assign({}, step), { visited: true });
|
|
15
|
+
}
|
|
16
|
+
return step;
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
}, [activeStep]);
|
|
20
|
+
return (React.createElement(WizardContext.Provider, { value: {
|
|
21
|
+
steps,
|
|
22
|
+
activeStep,
|
|
23
|
+
footer,
|
|
24
|
+
onNext,
|
|
25
|
+
onBack,
|
|
26
|
+
onClose,
|
|
27
|
+
goToStepById,
|
|
28
|
+
goToStepByName,
|
|
29
|
+
goToStepByIndex,
|
|
30
|
+
setFooter
|
|
31
|
+
} }, typeof children === 'function' ? children({ activeStep, steps, footer, onNext, onBack, onClose }) : children));
|
|
32
|
+
};
|
|
33
|
+
export const useWizardContext = () => React.useContext(WizardContext);
|
|
34
|
+
//# sourceMappingURL=WizardContext.js.map
|