@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
66 lines (54 loc) • 3.36 kB
JavaScript
import {useColumn as $hdQOH$useColumn} from "./column-components.fa405a9f.js";
import {LocalStorage as $dca7f3f29da0270d$export$19fffca37ef3e106} from "./column-components.fe6bac23.js";
import {ColumnBox as $d16be394456cbec0$export$32a0ad71237b9760} from "./column-components.19500205.js";
import {ColumnScroller as $33c4f196beb7d386$export$e60368c40bae9fd4} from "./column-components.6705ffc4.js";
import $hdQOH$macrostrathyper from "@macrostrat/hyper";
import {forwardRef as $hdQOH$forwardRef, createElement as $hdQOH$createElement} from "react";
import {expandInnerSize as $hdQOH$expandInnerSize, extractPadding as $hdQOH$extractPadding, extractMargin as $hdQOH$extractMargin, removeMargin as $hdQOH$removeMargin, removePadding as $hdQOH$removePadding} from "@macrostrat/ui-components";
import $hdQOH$classnames from "classnames";
const $039e0fecf5651a2f$export$59fd23dbe26daf79 = {
xmlns: "http://www.w3.org/2000/svg",
xmlnsXlink: "http://www.w3.org/1999/xlink"
};
const $039e0fecf5651a2f$export$13f4b12aafeba5d6 = (0, $hdQOH$forwardRef)((props, ref)=>{
const { children: children, innerRef: innerRef, ...props1 } = props;
const { style: style, ...rest } = (0, $hdQOH$expandInnerSize)(props1);
// Sizing
const { paddingLeft: paddingLeft, paddingTop: paddingTop } = (0, $hdQOH$extractPadding)(props);
const margin = (0, $hdQOH$extractMargin)(props);
const realRest = (0, $hdQOH$removeMargin)((0, $hdQOH$removePadding)(rest));
return (0, $hdQOH$macrostrathyper)("svg", {
ref: ref,
style: {
...margin,
...style
},
...realRest,
...$039e0fecf5651a2f$export$59fd23dbe26daf79
}, (0, $hdQOH$macrostrathyper)("g", {
transform: `translate(${paddingLeft},${paddingTop})`
}, children));
});
const $039e0fecf5651a2f$export$86f236f5872f181 = (props)=>(0, $hdQOH$createElement)("foreignObject", props);
const $039e0fecf5651a2f$export$31992eb1fd599dfe = function(props) {
//# Need to rework to use UI Box code
const { children: children, className: className, innerRef: innerRef, style: style, ...rest } = props;
const { pixelHeight: pixelHeight } = (0, $hdQOH$useColumn)();
const nextProps = (0, $hdQOH$expandInnerSize)({
innerHeight: pixelHeight,
...rest
});
const { paddingLeft: paddingLeft, paddingTop: paddingTop, innerHeight: innerHeight, innerWidth: innerWidth, height: height, width: width, ...remainingProps } = nextProps;
return (0, $hdQOH$macrostrathyper)($039e0fecf5651a2f$export$13f4b12aafeba5d6, {
className: (0, $hdQOH$classnames)(className, "section"),
height: height,
width: width,
innerRef: innerRef,
...remainingProps,
style: style
}, (0, $hdQOH$macrostrathyper)("g.backdrop", {
transform: `translate(${paddingLeft},${paddingTop})`
}, children));
};
export {$039e0fecf5651a2f$export$59fd23dbe26daf79 as SVGNamespaces, $039e0fecf5651a2f$export$13f4b12aafeba5d6 as SVG, $039e0fecf5651a2f$export$86f236f5872f181 as ForeignObject, $039e0fecf5651a2f$export$31992eb1fd599dfe as ColumnSVG, $dca7f3f29da0270d$export$19fffca37ef3e106 as LocalStorage, $d16be394456cbec0$export$32a0ad71237b9760 as ColumnBox, $33c4f196beb7d386$export$e60368c40bae9fd4 as ColumnScroller};
//# sourceMappingURL=column-components.0e8de8de.js.map