UNPKG

@jengaui/layout

Version:

Jenga UI Layout component in React

13 lines (8 loc) 912 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var react = require('react'); var tastycss = require('tastycss'); var utils = require('@jengaui/utils'); var jsxRuntime = require('react/jsx-runtime'); var m=tastycss.tasty({element:"Suffix",styles:{position:"absolute",display:"grid",placeContent:"stretch",placeItems:"center",flow:"column",gap:0,right:"@suffix-gap",top:"@suffix-gap",bottom:"@suffix-gap",color:"#dark.75",height:"(100% - (2 * @suffix-gap))"}}),B=react.forwardRef(function(s,f){let{onWidthChange:t,outerGap:i="1bw",children:o,...r}=s,n=tastycss.extractStyles(r,tastycss.CONTAINER_STYLES),e=utils.useCombinedRefs(f);return react.useEffect(()=>{e&&e.current&&t&&t(e.current.offsetWidth);},[o,e,t]),jsxRuntime.jsx(m,{...tastycss.filterBaseProps(r,{eventProps:!0}),ref:e,styles:n,style:{"--suffix-gap":tastycss.parseStyle(i).value},children:o})}); exports.Suffix = B;