UNPKG

@talend/react-forms

Version:

React forms library based on json schema form.

29 lines 1.26 kB
import { SkeletonButton, SkeletonInput, StackItem, StackVertical } from '@talend/design-system'; import theme from './FormSkeleton.module.scss'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export default function FormSkeleton({ displayMode, actions, anchorButtonsToFooter }) { // null/undefined actions prop will display default buttons const hasButtons = displayMode !== 'text' && (actions === null || actions === void 0 ? void 0 : actions.length) !== 0; const buttonsSkeleton = /*#__PURE__*/_jsx(StackItem, { align: "end", children: /*#__PURE__*/_jsx(SkeletonButton, {}) }); const buttons = anchorButtonsToFooter ? /*#__PURE__*/_jsx("div", { "data-drawer-absolute-footer-buttons": true, className: theme['drawer-absolute-footer-buttons'], children: buttonsSkeleton }) : buttonsSkeleton; return /*#__PURE__*/_jsxs(StackVertical, { gap: "S", align: "stretch", "data-testid": "form.skeleton", "data-test": "form.skeleton", "aria-busy": true, children: [/*#__PURE__*/_jsx(SkeletonInput, {}), /*#__PURE__*/_jsx(SkeletonInput, {}), /*#__PURE__*/_jsx(SkeletonInput, {}), /*#__PURE__*/_jsx(SkeletonInput, {}), hasButtons && buttons] }); } //# sourceMappingURL=FormSkeleton.js.map