Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/Wizard/WizardFooter.js

raw
1 import { __rest } from "tslib";
2 import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3 import { css } from '@patternfly/react-styles';
4 import styles from '@patternfly/react-styles/css/components/Wizard/wizard.mjs';
5 import { Button, ButtonVariant } from '../Button';
6 import { isCustomWizardFooter } from './types';
7 import { ActionList, ActionListGroup, ActionListItem } from '../ActionList';
8 export const WizardFooterWrapper = (_a) => {
9 var { children, className } = _a, props = __rest(_a, ["children", "className"]);
10 return (_jsx("footer", Object.assign({ className: css(styles.wizardFooter, className) }, props, { children: children })));
11 };
12 export const WizardFooter = (_a) => {
13 var { activeStep } = _a, internalProps = __rest(_a, ["activeStep"]);
14 const activeStepFooter = !isCustomWizardFooter(activeStep === null || activeStep === void 0 ? void 0 : activeStep.footer) && (activeStep === null || activeStep === void 0 ? void 0 : activeStep.footer);
15 return _jsx(InternalWizardFooter, Object.assign({}, internalProps, activeStepFooter));
16 };
17 const InternalWizardFooter = (_a) => {
18 var { onNext, onBack, onClose, isNextDisabled, isBackDisabled, isBackHidden, isCancelHidden, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel', nextButtonProps, backButtonProps, cancelButtonProps, className } = _a, props = __rest(_a, ["onNext", "onBack", "onClose", "isNextDisabled", "isBackDisabled", "isBackHidden", "isCancelHidden", "nextButtonText", "backButtonText", "cancelButtonText", "nextButtonProps", "backButtonProps", "cancelButtonProps", "className"]);
19 return (_jsx(WizardFooterWrapper, Object.assign({ className: className }, props, { children: _jsxs(ActionList, { children: [_jsxs(ActionListGroup, { children: [!isBackHidden && (_jsx(ActionListItem, { children: _jsx(Button, Object.assign({ variant: ButtonVariant.secondary, onClick: onBack, isDisabled: isBackDisabled }, backButtonProps, { children: backButtonText })) })), _jsx(ActionListItem, { children: _jsx(Button, Object.assign({ variant: ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: isNextDisabled }, nextButtonProps, { children: nextButtonText })) })] }), !isCancelHidden && (_jsx(ActionListGroup, { children: _jsx(ActionListItem, { children: _jsx(Button, Object.assign({ variant: ButtonVariant.link, onClick: onClose }, cancelButtonProps, { children: cancelButtonText })) }) }))] }) })));
20 };
21 WizardFooterWrapper.displayName = 'WizardFooterWrapper';
22 WizardFooter.displayName = 'WizardFooter';
23 //# sourceMappingURL=WizardFooter.js.map