UNPKG

@wordpress/components

Version:
46 lines (45 loc) • 1.51 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let ___context_index_ts = require("../context/index.cjs"); let ___view_index_ts = require("../view/index.cjs"); let __hook_ts = require("./hook.cjs"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/components/src/spacer/component.tsx function UnconnectedSpacer(props, forwardedRef) { const spacerProps = (0, __hook_ts.useSpacer)(props); return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___view_index_ts.View, { ...spacerProps, ref: forwardedRef }); } /** * `Spacer` is a primitive layout component that providers inner (`padding`) or outer (`margin`) space in-between components. It can also be used to adaptively provide space within an `HStack` or `VStack`. * * `Spacer` comes with a bunch of shorthand props to adjust `margin` and `padding`. The values of these props * can either be a number (which will act as a multiplier to the library's grid system base of 4px), * or a literal CSS value string. * * ```jsx * import { Spacer } from `@wordpress/components` * * function Example() { * return ( * <View> * <Spacer> * <Heading>WordPress.org</Heading> * </Spacer> * <Text> * Code is Poetry * </Text> * </View> * ); * } * ``` */ const Spacer = (0, ___context_index_ts.contextConnect)(UnconnectedSpacer, "Spacer"); exports.Spacer = Spacer; exports.default = Spacer; //# sourceMappingURL=component.cjs.map