UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

18 lines (17 loc) 1.05 kB
import { __assign, __rest } from "tslib"; import clsx from 'clsx'; import React from 'react'; import { getBaseProps } from '../internal/base-component'; import styles from './styles.css.js'; import flattenChildren from 'react-keyed-flatten-children'; import { useTelemetry } from '../internal/hooks/use-telemetry'; export default function SpaceBetween(_a) { var _b = _a.direction, direction = _b === void 0 ? 'vertical' : _b, size = _a.size, children = _a.children, props = __rest(_a, ["direction", "size", "children"]); useTelemetry('SpaceBetween'); var baseProps = getBaseProps(props); var flattenedChildren = flattenChildren(children); return (React.createElement("div", __assign({}, baseProps, { className: clsx(baseProps.className, styles.root, styles[direction], styles[direction + "-" + size]) }), flattenedChildren.map(function (child) { var key = child.key; return (React.createElement("div", { key: key, className: clsx(styles.child, styles["child-" + direction + "-" + size]) }, child)); }))); }